Compare commits

...

22 Commits

  1. 1
      Common/CK.SCP.Common.csproj
  2. 42
      Common/MailManager.cs
  3. 102
      Common/MyWebSmtpMail.cs
  4. 2
      Controller/CK.SCP.Controller.csproj
  5. 19
      Controller/SCP_ASK_CONTROLLER.cs
  6. 2
      Controller/SCP_ASN_CONTROLLER.cs
  7. 622
      Controller/SCP_MPO_CONTROLLER.cs
  8. 752
      Controller/SCP_PO_CONTROLLER.cs
  9. 330
      Controller/SCP_ToleranceProportion_Controller.cs
  10. 12
      Models/CK.SCP.Models.csproj
  11. 7
      Models/Enums/DataState.cs
  12. 24
      Models/ScpEntities.cs
  13. 15
      Models/ScpEntity/ExcelExportEnttity/SCP_PART_ToleranceProportion.cs
  14. 2
      Models/ScpEntity/TA_PART.cs
  15. 26
      Models/ScpEntity/TA_ToleranceProportion.cs
  16. 52
      Models/ScpEntity/TB_MATERIALORDERS.cs
  17. 67
      Models/ScpEntity/TB_MATERIALORDERS_DETAIL.cs
  18. 13
      Models/ScpEntity/TB_MAXPO_DETAIL.cs
  19. 27
      Models/ScpEntity/TS_Email.cs
  20. 41
      Models/ScpEntity/V_MPO_PRINT.cs
  21. 22
      Models/ScpEntity/V_TA_ToleranceProportion.cs
  22. 18
      Models/ScpEntity/V_TB_MAXPO_DETAIL.cs
  23. 63
      Models/ScpEntity/V_TB_MPO.cs
  24. 67
      Models/ScpEntity/V_TB_MPO_DETAIL.cs
  25. 1
      Models/UniApiEntity/UniApiEntities.cs
  26. 14
      Models/UniApiEntity/xxDiMaxes_Order.cs
  27. 20
      SCP/Common/ReportHelper.cs
  28. 60
      SCP/SCP.csproj
  29. 2
      SCP/Views/BasicData/Part.aspx
  30. 19
      SCP/Views/BasicData/Part.aspx.cs
  31. 15
      SCP/Views/BasicData/Part.aspx.designer.cs
  32. 62
      SCP/Views/BasicData/SCP_ToleranceProportion.aspx
  33. 137
      SCP/Views/BasicData/SCP_ToleranceProportion.aspx.cs
  34. 116
      SCP/Views/BasicData/SCP_ToleranceProportion.aspx.designer.cs
  35. 74
      SCP/Views/PlanData/SCP_MPO_DETAIL.aspx
  36. 169
      SCP/Views/PlanData/SCP_MPO_DETAIL.aspx.cs
  37. 98
      SCP/Views/PlanData/SCP_MPO_DETAIL.aspx.designer.cs
  38. 132
      SCP/Views/PlanData/SCP_PO_MATERIAL.aspx
  39. 272
      SCP/Views/PlanData/SCP_PO_MATERIAL.aspx.cs
  40. 215
      SCP/Views/PlanData/SCP_PO_MATERIAL.aspx.designer.cs
  41. 46
      SCP/Views/SupplierData/SCP_ASN_CREATE.aspx.cs
  42. 2
      SCP/Views/SupplierData/SCP_ASN_DETAIL.aspx.cs
  43. 30
      SCP/Views/SupplierData/SCP_ASN_MANYCREATE.aspx.cs
  44. 77
      SCP/Views/SupplierData/SCP_MPO_DETAIL.aspx
  45. 170
      SCP/Views/SupplierData/SCP_MPO_DETAIL.aspx.cs
  46. 116
      SCP/Views/SupplierData/SCP_MPO_DETAIL.aspx.designer.cs
  47. 126
      SCP/Views/SupplierData/SCP_PO_MATERIAL.aspx
  48. 265
      SCP/Views/SupplierData/SCP_PO_MATERIAL.aspx.cs
  49. 206
      SCP/Views/SupplierData/SCP_PO_MATERIAL.aspx.designer.cs
  50. 75
      SCP/Views/富维冲压件/SCP_MPO_DETAIL.aspx
  51. 175
      SCP/Views/富维冲压件/SCP_MPO_DETAIL.aspx.cs
  52. 116
      SCP/Views/富维冲压件/SCP_MPO_DETAIL.aspx.designer.cs
  53. 119
      SCP/Views/富维冲压件/SCP_PO_MATERIAL.aspx
  54. 249
      SCP/Views/富维冲压件/SCP_PO_MATERIAL.aspx.cs
  55. 188
      SCP/Views/富维冲压件/SCP_PO_MATERIAL.aspx.designer.cs
  56. 4
      SCP/Views/富维冲压件/SCP_PO_MAX.aspx
  57. 14
      SCP/Views/富维冲压件/SCP_PO_MAX.aspx.cs
  58. 18
      SCP/Views/富维冲压件/SCP_PO_MAX.aspx.designer.cs
  59. 88
      SCP/Views/富维冲压件/SCP_PO_MAX_DETAIL.aspx
  60. 58
      SCP/Views/富维冲压件/SCP_PO_MAX_DETAIL.aspx.cs
  61. 26
      SCP/Views/富维冲压件/SCP_PO_MAX_DETAIL.aspx.designer.cs
  62. 11
      UniApiGroup/App.config
  63. 1
      UniApiGroup/Config/DurationConfig.cs
  64. 1
      UniApiGroup/Config/UniApiConfig.cs
  65. 48
      UniApiGroup/Controller/MailController.cs
  66. 382
      UniApiGroup/Controller/OdbcApiQadController.cs
  67. 6
      UniApiGroup/Controller/OdbcApiScpController.cs
  68. 6
      UniApiGroup/Controller/OdbcApiWmsController.cs
  69. 107
      UniApiGroup/Controller/PoBillNumcontroller.cs
  70. 2
      UniApiGroup/Controller/Vendercontroller.cs
  71. 163
      UniApiGroup/FormMain.Designer.cs
  72. 10
      UniApiGroup/FormMain.cs
  73. 38
      UniApiGroup/FormMain.resx
  74. 1
      UniApiGroup/IApi.cs
  75. 42
      UniApiGroup/QadOdbcApi.cs

1
Common/CK.SCP.Common.csproj

@ -94,6 +94,7 @@
<Compile Include="CktTextBox.Designer.cs">
<DependentUpon>CktTextBox.cs</DependentUpon>
</Compile>
<Compile Include="MailManager.cs" />
<Compile Include="SettingHelper.cs" />
<Compile Include="MyExcel.cs" />
<Compile Include="MyWebSmtpMail.cs" />

42
Common/MailManager.cs

@ -0,0 +1,42 @@
using CK.SCP.Utils;
using MailKit.Security;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CK.SCP.Common
{
public class MailManager
{
/// <summary>
/// 发送邮件
/// </summary>
/// <param name="mails"></param>
/// <param name="mailbody"></param>
/// <param name="p_MailTitle"></param>
public static void SendMailOrders(string mails = "", string mailbody = "", string p_MailTitle = "")
{
try
{
List<EmailAddress> toList = new List<EmailAddress>();
EmailAddress add = new EmailAddress(mails, mails);
toList.Add(add);
var smtpMailSender = new MailKitMailSender(SecureSocketOptions.StartTls);
smtpMailSender.BuildOrderMessage(
toList,
p_MailTitle,
mailbody,
"BBC"
);
smtpMailSender.SendOrder();
}
catch (Exception e)
{
LogHelper.Writlog(LogHelper.LogType.Error, typeof(MailManager), "MailManager", e.Message + e.InnerException?.Message);
throw e;
}
}
}
}

102
Common/MyWebSmtpMail.cs

@ -87,6 +87,59 @@ namespace CK.SCP.Common
}
}
}
/// <summary>
/// 材料邮件
/// </summary>
/// <param name="To"></param>
/// <param name="Body"></param>
/// <param name="Title"></param>
public void SendOrdersEmail(string To, string Body, string Title)
{
mailMessage = new MailMessage();
mailMessage.To.Add(To);
mailMessage.From = new MailAddress("faway_cyjdd@163.com");
mailMessage.Subject = Title;
mailMessage.Body = Body;
mailMessage.IsBodyHtml = true;
mailMessage.BodyEncoding = Encoding.UTF8;
mailMessage.Priority = MailPriority.Normal;
if (mailMessage != null)
{
smtpClient = new SmtpClient();
if (!credentials)
{
smtpClient.Credentials = new System.Net.NetworkCredential("faway_cyjdd@163.com", "XOVCAHAWSHYUNWWT");
}
smtpClient.DeliveryMethod = SmtpDeliveryMethod.Network;
smtpClient.Host = "smtp.163.com";
smtpClient.Port = 25;
smtpClient.EnableSsl = false;
//smtpClient.Send(mailMessage);
//smtpClient.SendAsync(mailMessage, null);
//如果服务器支持安全连接,则将安全连接设为true
//smtpClient.EnableSsl = true;
try
{
//是否使用默认凭据,若为false,则使用自定义的证书,就是下面的networkCredential实例对象
smtpClient.UseDefaultCredentials = false;
//指定邮箱账号和密码,需要注意的是,这个密码是你在QQ邮箱设置里开启服务的时候给你的那个授权码
System.Net.NetworkCredential networkCredential = new System.Net.NetworkCredential("faway_cyjdd@163.com", "XOVCAHAWSHYUNWWT");
smtpClient.Credentials = networkCredential;
//发送邮件
smtpClient.Send(mailMessage);
}
catch (Exception ex)
{
throw ex;
}
}
}
}
public class EmailAddress
@ -170,6 +223,55 @@ namespace CK.SCP.Common
}
}
/// <summary>
/// 材料
/// </summary>
/// <param name="toAddressList"></param>
/// <param name="subject"></param>
/// <param name="body"></param>
/// <param name="model"></param>
public void BuildOrderMessage(List<EmailAddress> toAddressList, string subject, string body, string model)
{
_message = new MimeMessage();
_message.Sender = new MailboxAddress("faway_cyjdd@163.com", "faway_cyjdd@163.com");
_message.From.Add(new MailboxAddress("faway_cyjdd@163.com", "faway_cyjdd@163.com"));
_message.Subject = subject;
_message.Body = new TextPart(TextFormat.Html) { Text = body };
foreach (var emailAddress in toAddressList)
{
if (model == "BCC")//抄送模式(抄送模式只发送一个邮件,避免大量发重复邮件)
{
_message.Bcc.Add(new MailboxAddress(emailAddress.Name, emailAddress.Address));
}
else
{
_message.To.Add(new MailboxAddress(emailAddress.Name, emailAddress.Address));
}
}
}
/// <summary>
/// 材料
/// </summary>
public void SendOrder()
{
try
{
_client.Connect("smtp.163.com", 25, _secureSocketOptions);
_client.Authenticate("faway_cyjdd@163.com", "XOVCAHAWSHYUNWWT");
_client.Send(_message);
_client.Disconnect(true);
Console.WriteLine("MailKit Send Success:" + _message.To.Mailboxes.First());
}
catch (SmtpException ex)
{
Console.WriteLine(ex.Message);
Console.WriteLine();
throw ex;
}
}
public async Task SendAsync()

2
Controller/CK.SCP.Controller.csproj

@ -77,9 +77,11 @@
<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" />
<Compile Include="SCP_MPO_CONTROLLER.cs" />
<Compile Include="SCP_QUALITY_CONTROLLER.cs" />
<Compile Include="SCP_REPORT_CONTROLLER.cs" />
<Compile Include="SCP_TB_PRICE_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)
{

2
Controller/SCP_ASN_CONTROLLER.cs

@ -3036,7 +3036,7 @@ namespace CK.SCP.Controller
{
p_entitys.ForEach(p =>
{
var _maxpolist = db.TB_MAXPO_DETAIL.Where(t => t.PartCode == p.PartCode && t.VendId == p.Extend1&&t.AsnQty>0).ToList().OrderBy(t=>t.ContractMonth);
var _maxpolist = db.TB_MAXPO_DETAIL.Where(t => t.PartCode == p.PartCode && t.VendId == p.Extend1&&t.AsnQty>0 && !t.IsDeleted).ToList().OrderBy(t=>t.ContractMonth);
decimal sum = 0;
if (_maxpolist.Count() > 0)
{

622
Controller/SCP_MPO_CONTROLLER.cs

@ -0,0 +1,622 @@
using System;
using System.Collections.Generic;
using System.Data.Entity.Migrations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CK.SCP.Models;
using CK.SCP.Models.Enums;
using CK.SCP.Models.ScpEntity;
using CK.SCP.Models.ScpEntity.ExcelImportEntity;
using CK.SCP.Utils;
using System.Data.Entity.Core;
using CK.SCP.Models.ScpEntity.ExcelExportEnttity;
using System.Text.RegularExpressions;
using System.Threading;
using System.Data;
using Newtonsoft.Json;
using CK.SCP.Models.UniApiEntity;
using CK.SCP.Models.AppBoxEntity;
namespace CK.SCP.Controller
{
public class SCP_MPO_CONTROLLER
{
/// <summary>
/// 获取一般材料订单
/// </summary>
/// <param name="p_entity"></param>
/// <param name="p_action"></param>
public static void Get_V_TB_MPO_List(V_TB_MPO p_entity, Action<ResultObject<IQueryable<V_TB_MPO>>> p_action)
{
ResultObject<IQueryable<V_TB_MPO>> _ret = new ResultObject<IQueryable<V_TB_MPO>>();
try
{
using (ScpEntities db = EntitiesFactory.CreateScpInstance())
{
IQueryable<V_TB_MPO> q = db.V_TB_MPO;
if (p_entity.DocDateBegin != DateTime.MinValue)
{
q = q.Where(p => p.DocDate >= p_entity.DocDateBegin);
}
if (p_entity.DocDateEnd != DateTime.MinValue)
{
q = q.Where(p => p.DocDate <= p_entity.DocDateEnd);
}
if (!string.IsNullOrWhiteSpace(p_entity.PurdocNO))
{
q = q.Where(p => p.PurdocNO == p_entity.PurdocNO.Trim());
}
if (p_entity.UserInVendIds != null && p_entity.UserInVendIds.Count > 0)
{
q = q.Where(p => p_entity.UserInVendIds.Contains(p.VendorNO));
}
if (!string.IsNullOrWhiteSpace(p_entity.VendorNO))
{
q = q.Where(p => p.VendorNO.Contains(p_entity.VendorNO));
}
if (!string.IsNullOrWhiteSpace(p_entity.VendorDesc))
{
q = q.Where(p => p.VendorDesc.Contains(p_entity.VendorDesc));
}
if (!string.IsNullOrWhiteSpace(p_entity.CreatedBy))
{
q = q.Where(p => p.CreatedBy.Contains(p_entity.CreatedBy));
}
if (!string.IsNullOrWhiteSpace(p_entity.AcceptStatusSelect))
{
var acceptStatus = int.Parse(p_entity.AcceptStatusSelect);
q = q.Where(p => p.AcceptStatus == acceptStatus);
}
_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_PO_CONTROLLER), "Get_V_TB_MPO_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_PO_CONTROLLER), "Get_V_TB_MPO_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_PO_CONTROLLER), "Get_V_TB_MPO_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_PO_CONTROLLER), "Get_V_TB_MPO_List", e.Message);
throw e;
}
}
/// <summary>
/// 获取一般材料订单明细
/// </summary>
/// <param name="p_entity"></param>
/// <param name="p_action"></param>
public static void Get_V_TB_MPO_DETAIL_List(V_TB_MPO_DETAIL p_entity, Action<ResultObject<IQueryable<V_TB_MPO_DETAIL>>> p_action)
{
ResultObject<IQueryable<V_TB_MPO_DETAIL>> _ret = new ResultObject<IQueryable<V_TB_MPO_DETAIL>>();
try
{
using (ScpEntities db = EntitiesFactory.CreateScpInstance())
{
IQueryable<V_TB_MPO_DETAIL> q = db.V_TB_MPO_DETAIL;
if (!string.IsNullOrWhiteSpace(p_entity.Ctype))
{
q = q.Where(p => p.Ctype == p_entity.Ctype);
}
if (p_entity.purdocnolist != null && p_entity.purdocnolist.Count > 0)
{
q = q.Where(p => p_entity.purdocnolist.Contains(p.PurdocNO));
}
_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_PO_CONTROLLER), "Get_V_TB_MPO_DETAIL_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_PO_CONTROLLER), "Get_V_TB_MPO_DETAIL_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_PO_CONTROLLER), "Get_V_TB_MPO_DETAIL_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_PO_CONTROLLER), "Get_V_TB_MPO_DETAIL_List", e.Message);
throw e;
}
}
/// <summary>
/// 一般材料订单明细列表
/// </summary>
/// <param name="p_lst">PurdocNOlist</param>
/// <returns></returns>
public static List<V_TB_MPO_DETAIL> GetMPODetailList(List<String> p_lst)
{
using (ScpEntities db = EntitiesFactory.CreateScpInstance())
{
return db.V_TB_MPO_DETAIL.Where(p => p_lst.Contains(p.PurdocNO)).ToList();
}
}
/// <summary>
/// 作废传接口
/// </summary>
/// <param name="ls"></param>
/// <returns></returns>
public static ResultObject<bool> Save_ts_uni_api(List<string> ls)
{
ResultObject<bool> _ret = new ResultObject<bool>();
try
{
using (ScpEntities db = EntitiesFactory.CreateScpInstance())
{
{
List<string> lineError = new List<string>();
List<string> ErrorList = new List<string>();
foreach (var po in ls)
{
var po1 = db.TB_MATERIALORDERS.FirstOrDefault(t => t.PurdocNO == po && t.Ctype != "D");
po1.AcceptStatus = (int)GeneralMaterialOrderState.Finish;
db.TB_MATERIALORDERS.AddOrUpdate(po1);
var po2 = db.TB_MATERIALORDERS_DETAIL.Where(t => t.PurdocNO == po && t.Ctype != "D").ToList();
foreach (var po3 in po2)
{
po3.AcceptStatus = (int)GeneralMaterialOrderState.Finish;
db.TB_MATERIALORDERS_DETAIL.AddOrUpdate(po3);
}
var lx = db.TS_UNI_API.Where(t => t.BillNum == po && t.Receiver == "I").ToList();
foreach (var po4 in lx)
{
po4.State = 1;
po4.Receiver = "D";
db.TS_UNI_API.AddOrUpdate(po4);
}
}
}
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_PO_CONTROLLER), "Save_PO_TO_ASK", 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_PO_CONTROLLER), "Save_PO_TO_ASK", 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_PO_CONTROLLER), "Save_PO_TO_ASK", 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_PO_CONTROLLER), "Save_PO_TO_ASK", e.Message);
_ret.Result = false;
_ret.ErrorList.Add(e);
throw e;
}
return _ret;
}
/// <summary>
/// 保存状态
/// </summary>
/// <param name="p_list"></param>
/// <param name="p_state"></param>
/// <returns></returns>
public static ResultObject<bool> Save_MPO_STATE(List<string> p_list, GeneralMaterialOrderState p_state)
{
ResultObject<bool> _ret = new ResultObject<bool>();
try
{
using (ScpEntities db = EntitiesFactory.CreateScpInstance())
{
switch (p_state)
{
case GeneralMaterialOrderState.Finish:
var orblist = db.TB_MATERIALORDERS.Where(q => p_list.Contains(q.PurdocNO)).ToList();
var ctylist = orblist.Select(q => q.Ctype).ToList();
if (ctylist.Contains("D"))
{
_ret.State = ReturnStatus.Failed;
_ret.Result = false;
_ret.Message = "存在已经作废的数据,请重新选择!";
_ret.MessageList.Add(_ret.Message);
return _ret;
}
var acclist = orblist.Select(q => q.AcceptStatus).ToList();
if (acclist.Contains((int)GeneralMaterialOrderState.Finish))
{
_ret.State = ReturnStatus.Failed;
_ret.Result = false;
_ret.Message = "存在已经确认的数据,请重新选择!";
_ret.MessageList.Add(_ret.Message);
return _ret;
}
foreach (var item in p_list)
{
var tbMater = db.TB_MATERIALORDERS.FirstOrDefault(q => q.PurdocNO == item);
tbMater.AcceptStatus = (int)GeneralMaterialOrderState.Finish;
var tbMaterList = db.TB_MATERIALORDERS_DETAIL.Where(q => q.PurdocNO == item).ToList();
tbMaterList.ForEach(q =>
{
q.AcceptStatus = (int)GeneralMaterialOrderState.Finish;
});
db.TB_MATERIALORDERS.AddOrUpdate(itm1 => itm1.UID, tbMater);
db.TB_MATERIALORDERS_DETAIL.AddOrUpdate(itm => itm.UID, tbMaterList.ToArray());
}
break;
case GeneralMaterialOrderState.New:
var MAblist = db.TB_MATERIALORDERS.Where(q => p_list.Contains(q.PurdocNO)).ToList();
var ctypelist = MAblist.Select(q => q.Ctype).ToList();
if (ctypelist.Contains("D"))
{
_ret.State = ReturnStatus.Failed;
_ret.Result = false;
_ret.Message = "存在已经作废的数据,请重新选择!";
_ret.MessageList.Add(_ret.Message);
return _ret;
}
var acceplist = MAblist.Select(q => q.AcceptStatus).ToList();
if (acceplist.Contains((int)GeneralMaterialOrderState.New))
{
_ret.State = ReturnStatus.Failed;
_ret.Result = false;
_ret.Message = "存在已经待确认的数据,请重新选择!";
_ret.MessageList.Add(_ret.Message);
return _ret;
}
foreach (var item in p_list)
{
var tbMater = db.TB_MATERIALORDERS.FirstOrDefault(q => q.PurdocNO == item);
tbMater.AcceptStatus = (int)GeneralMaterialOrderState.New;
var tbMaterList = db.TB_MATERIALORDERS_DETAIL.Where(q => q.PurdocNO == item).ToList();
tbMaterList.ForEach(q =>
{
q.AcceptStatus = (int)GeneralMaterialOrderState.New;
q.UpdateTime = DateTime.Now.ToString();
});
db.TB_MATERIALORDERS.AddOrUpdate(itm1 => itm1.UID, tbMater);
db.TB_MATERIALORDERS_DETAIL.AddOrUpdate(itm => itm.UID, tbMaterList.ToArray());
}
break;
}
if (db.SaveChanges() != -1)
{
_ret.State = ReturnStatus.Succeed;
_ret.Result = true;
return _ret;
}
else
{
_ret.State = ReturnStatus.Failed;
_ret.Result = false;
_ret.Message = "数据更新失败!";
_ret.MessageList.Add(_ret.Message);
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_MPO_CONTROLLER), "Save_MPO_STATE", sb.ToString());
throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString());
}
catch (OptimisticConcurrencyException ex)//并发冲突异常
{
_ret.State = ReturnStatus.Failed;
_ret.Result = false;
_ret.ErrorList.Add(ex);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_MPO_CONTROLLER), "Save_MPO_STATE", ex.ToString());
throw new ScpException(ResultCode.Exception, "9999", ex.ToString());
}
catch (ScpException ex)
{
_ret.State = ReturnStatus.Failed;
_ret.Result = false;
_ret.ErrorList.Add(ex);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_MPO_CONTROLLER), "Save_MPO_STATE", ex.ToString());
if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException))
{
var inner = (UpdateException)ex.InnerException;
throw new ScpException(ResultCode.Exception, "0000", ex.ToString());
}
else
{
if (ex.InnerException != null) throw ex.InnerException;
}
}
catch (Exception e)
{
_ret.State = ReturnStatus.Failed;
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_MPO_CONTROLLER), "Save_MPO_STATE", e.Message);
_ret.Result = false;
_ret.ErrorList.Add(e);
}
return _ret;
}
/// <summary>
/// 获取材料订单主表数据
/// </summary>
/// <param name="PurdocNO"></param>
/// <returns></returns>
public static TB_MATERIALORDERS GetTbMaterialorders(string PurdocNO)
{
TB_MATERIALORDERS MATERIALORDERS = new TB_MATERIALORDERS();
using (ScpEntities db = EntitiesFactory.CreateScpInstance())
{
MATERIALORDERS = db.TB_MATERIALORDERS.FirstOrDefault(q => q.PurdocNO == PurdocNO);
}
return MATERIALORDERS;
}
/// <summary>
/// 获取材料订单明细表数据
/// </summary>
/// <param name="PurdocNO"></param>
/// <returns></returns>
public static List<TB_MATERIALORDERS_DETAIL> GetTbMaterialordersDetailList(string PurdocNO)
{
List<TB_MATERIALORDERS_DETAIL> MATERIALORDERS = new List<TB_MATERIALORDERS_DETAIL>();
using (ScpEntities db = EntitiesFactory.CreateScpInstance())
{
MATERIALORDERS = db.TB_MATERIALORDERS_DETAIL.Where(q => q.PurdocNO == PurdocNO).ToList();
}
if (MATERIALORDERS.Count() > 0)
{
MATERIALORDERS.ForEach(q =>
{
if (q.Ctype == "D")
{
q.CType_DESC = "是";
}
else
{
q.CType_DESC = "否";
}
});
}
return MATERIALORDERS;
}
/// <summary>
/// 打印数据
/// </summary>
/// <param name="p_AsnBillNum"></param>
/// <returns></returns>
public static DataSet MPO_REPORT(string PurdocNO)
{
DataSet ds = new DataSet();
TB_MATERIALORDERS order = GetTbMaterialorders(PurdocNO);
V_MPO_PRINT print = new V_MPO_PRINT();
print.PURDOCNO = order.PurdocNO;
print.DOCDATE = order.DocDate.ToString("yyyy-MM-dd");
print.PHONE = order.PHONE;
print.FAXNUM = order.FAXNUM;
print.PURGRPDESC = order.PurgrpDesc;
print.VendorNO = order.VendorNO;
print.FIRSTTELNO = order.FIRSTTELNO;
print.STAGEDESC = order.STAGEDESC;
TA_VENDER vender = GET_TA_VENDER(order.VendorNO);
if (vender != null)
{
print.CAAIFax = vender.VendName;
print.CurrentUserAdress = vender.Address;
print.RESPONSIBLESALESPERSON = vender.Contacter;
print.SupplierFax = vender.Fax;
}
List<TB_MATERIALORDERS_DETAIL> detailList = GetTbMaterialordersDetailList(PurdocNO);
List<V_MPO_PRINT_DETAIL> lsDetail = new List<V_MPO_PRINT_DETAIL>();
decimal SUM = 0.00M;
detailList.ForEach(p =>
{
V_MPO_PRINT_DETAIL _detail = new V_MPO_PRINT_DETAIL();
_detail.PURCHASEREQNO = p.PurchaseReqNO;
_detail.PROPOSERDESC = p.ProposerDesc;
_detail.MTLNO = p.MtlNO;
_detail.SHORTTEXT = p.Shorttext;
_detail.SIZECOL = p.SizeCol;
_detail.UNITDES = p.Unitdes;
_detail.QUANTITY = p.Quantity.ToString("#.####");
_detail.PRICE = p.PRICE.ToString("#.######");
_detail.NETVALUE = p.NetValue.ToString("#.######");
_detail.PURINFORECORD = p.PurinfoReCord;
_detail.ITEMDELIVERYDATE = p.ItemDeliveryDate.ToString("yyyy-MM-dd");
_detail.GLACCTNODES = p.Glaccnum;
_detail.COSTCENTERDES = p.CostCenterDes;
_detail.PURDOCITEMNO = p.PURDOCITEMNO;
_detail.CType_DESC = p.CType_DESC;
lsDetail.Add(_detail);
if (p.Ctype != "D")
{
SUM += p.NetValue;
}
});
print.Total = SUM.ToString("F6");
var detail = detailList.FirstOrDefault(q => !string.IsNullOrEmpty(q.Remake));
if (detail != null)
{
print.Remake = detail.Remake;
}
var dt = ConvertHelper.ToDataTable(new List<V_MPO_PRINT> { print });
ds.Tables.Add(dt);
var dt1 = ConvertHelper.ToDataTable(lsDetail);
ds.Tables.Add(dt1);
return ds;
}
/// <summary>
/// 获取打印相关的供应商信息
/// </summary>
/// <param name="VENDID"></param>
/// <returns></returns>
public static TA_VENDER GET_TA_VENDER (string VENDID)
{
TA_VENDER _VENDER = new TA_VENDER();
using (ScpEntities db = EntitiesFactory.CreateScpInstance())
{
_VENDER = db.TA_VENDER.FirstOrDefault(q => q.VendId == VENDID);
}
return _VENDER;
}
}
}

752
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;
}
}
}

12
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,13 @@
<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" />
<Compile Include="ScpEntity\TB_MATERIALORDERS.cs" />
<Compile Include="ScpEntity\TA_PinFan.cs" />
<Compile Include="ScpEntity\TA_ProductionLine.cs" />
<Compile Include="ScpEntity\TA_PurchasGroup.cs" />
@ -410,6 +418,7 @@
<Compile Include="ScpEntity\TB_PALLET_DETAIL.cs" />
<Compile Include="ScpEntity\TB_SUPPLIER_MAIL.cs" />
<Compile Include="ScpEntity\TM_CYJ_BOM.cs" />
<Compile Include="ScpEntity\TS_Email.cs" />
<Compile Include="ScpEntity\TS_BARCODE_CUSTOM.cs" />
<Compile Include="ScpEntity\TS_BARCODE_RULE_CUSTOM.cs" />
<Compile Include="ScpEntity\TS_BARCODE_RULE_SMALL.cs" />
@ -425,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" />
@ -475,6 +483,7 @@
<Compile Include="ScpEntity\V_TB_INVOICE_RED.cs" />
<Compile Include="ScpEntity\V_TB_INVOICE.cs" />
<Compile Include="ScpEntity\V_TB_INVOICE_DETAIL_RED.cs" />
<Compile Include="ScpEntity\V_TB_MPO.cs" />
<Compile Include="ScpEntity\V_TB_PO.cs" />
<Compile Include="ScpEntity\V_TB_PO_DETAIL.cs" />
<Compile Include="ScpEntity\V_TB_PO_PLAN.cs" />
@ -494,6 +503,7 @@
<Compile Include="ScpEntity\V_TS_BARCODE.cs" />
<Compile Include="UniApiEntity\PURReplenishQty.cs" />
<Compile Include="UniApiEntity\xxDiMaxes.cs" />
<Compile Include="UniApiEntity\xxDiMaxes_Order.cs" />
<Compile Include="UniApiEntity\xxDiMaxes_Po.cs" />
<Compile Include="UniApiEntity\xxerp_MaxbatchNO.cs" />
<Compile Include="UniApiEntity\xxscm_maxpo_det.cs" />

7
Models/Enums/DataState.cs

@ -26,4 +26,11 @@ namespace CK.SCP.Models.Enums
Process = 1,
Finish = 2,
}
public enum GeneralMaterialOrderState
{
Cancel = -1,
New = 0,
Finish = 1,
}
}

24
Models/ScpEntities.cs

@ -169,6 +169,13 @@ namespace CK.SCP.Models
public virtual DbSet<V_TB_ASK_RECEIVE> V_TB_ASK_RECEIVE { get; set; }
public virtual DbSet<TB_ASK_RECEIVE> TB_ASK_RECEIVE { get; set; }
public virtual DbSet<TB_UNCOMPLETE_TEMPASK> TB_UNCOMPLETE_TEMPASK { get; set; }
public virtual DbSet<TB_MATERIALORDERS> TB_MATERIALORDERS { get; set; }
public virtual DbSet<TB_MATERIALORDERS_DETAIL> TB_MATERIALORDERS_DETAIL { 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<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>()
@ -288,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);
@ -340,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; }
}
}

52
Models/ScpEntity/TB_MATERIALORDERS.cs

@ -0,0 +1,52 @@
using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace CK.SCP.Models.ScpEntity
{
public partial class TB_MATERIALORDERS
{
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public long UID { get; set; }
[DisplayName("采购凭证号")]
public string PurdocNO { get; set; }
[DisplayName("采购凭证类型描述")]
public string BuyListStrdes { get; set; }
[DisplayName("凭证日期(订货日期)")]
public DateTime DocDate { get; set; }
[DisplayName("供应商代码")]
public string VendorNO { get; set; }
[DisplayName("供应商描述")]
public string VendorDesc { get; set; }
[DisplayName("采购组描述(收货人)")]
public string PurgrpDesc { get; set; }
[DisplayName("审批状态 4=审批通过")]
public string ApprovalStatus { get; set; }
[DisplayName("供应商状态")]
public int AcceptStatus { get; set; }
[DisplayName("交货日程日期")]
public DateTime ItemdeliveryDate { get; set; }
[DisplayName("创建人描述")]
public string CreatedByDesc{ get; set; }
[DisplayName("创建人")]
public string CreatedBy { get; set; }
[DisplayName("状态")]
public string Ctype { get; set; }
[DisplayName("供应商的联系电话")]
public string FIRSTTELNO { get; set; }
[DisplayName("电话")]
public string PHONE { get; set; }
[DisplayName("购组传真")]
public string FAXNUM { get; set; }
[DisplayName("付款条件描述")]
public string STAGEDESC { get; set; }
}
}

67
Models/ScpEntity/TB_MATERIALORDERS_DETAIL.cs

@ -0,0 +1,67 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace CK.SCP.Models.ScpEntity
{
public partial class TB_MATERIALORDERS_DETAIL
{
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public long UID { get; set; }
[DisplayName("采购凭证号")]
public string PurdocNO { get; set; }
[DisplayName("申请单号")]
public string PurchaseReqNO { get; set; }
[DisplayName("申请人")]
public string ProposerDesc { get; set; }
[DisplayName("物料号")]
public string MtlNO { get; set; }
[DisplayName("审批状态 4=审批通过")]
public string ApprovalStatus { get; set; }
[DisplayName("供应商状态")]
public int AcceptStatus { get; set; }
[DisplayName("物料描述")]
public string Shorttext { get; set; }
[DisplayName("型号规格")]
public string SizeCol { get; set; }
[DisplayName("材料牌号")]
public string Matbrand { get; set; }
[DisplayName("单位")]
public string Unitdes { get; set; }
[DisplayName("数量")]
public decimal Quantity { get; set; }
[DisplayName("价格")]
public decimal PRICE { get; set; }
[DisplayName("金额")]
public decimal NetValue { get; set; }
[DisplayName("采购信息")]
public string PurinfoReCord { get; set; }
[DisplayName("要求到货日期")]
public DateTime ItemDeliveryDate { get; set; }
[DisplayName("科目")]
public string Glaccnum { get; set; }
[DisplayName("状态")]
public string Ctype { get; set; }
[DisplayName("成本中心")]
public string CostCenterDes { get; set; }
[DisplayName("存储地点")]
public string StoreLocation { get; set; }
[DisplayName("更新时间")]
public string UpdateTime { get; set; }
[NotMapped]
public string CType_DESC { get; set; }
[DisplayName("订单行号")]
public string PURDOCITEMNO { get; set; }
[DisplayName("备注")]
public string Remake { 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;
}
}

27
Models/ScpEntity/TS_Email.cs

@ -0,0 +1,27 @@
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace CK.SCP.Models.ScpEntity
{
public partial class TS_Email
{
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public long UID { get; set; }
[DisplayName("发送的人")]
[StringLength(50)]
public string EmailToUser { get; set; }
[DisplayName("发送的地址")]
public string EmailAddress { get; set; }
[DisplayName("发送内容")]
public string EmailString { get; set; }
[DisplayName("发送状态 0待发送 1发送成功 2发送失败")]
public int EmailSendState { get; set; }
[DisplayName("失败原因")]
public string EmailSendFailReason { get; set; }
[DisplayName("发送时间")]
public string UpdateTime { get; set; }
}
}

41
Models/ScpEntity/V_MPO_PRINT.cs

@ -0,0 +1,41 @@
namespace CK.SCP.Models.ScpEntity
{
public class V_MPO_PRINT
{
public string PURDOCNO { get; set; }
public string DOCDATE { get; set; }
public string PHONE { get; set; }
public string FAXNUM { get; set; }
public string VendorNO { get; set; }
public string PURGRPDESC { get; set; }
public string CAAIFax { get; set; }
public string CurrentUserAdress { get; set; }
public string RESPONSIBLESALESPERSON { get; set; }
public string SupplierFax { get; set; }
public string FIRSTTELNO { get; set; }
public string STAGEDESC { get; set; }
public string Total { get; set; }
public string Remake { get; set; }
}
public class V_MPO_PRINT_DETAIL
{
public string PURCHASEREQNO { get; set; }
public string PROPOSERDESC { get; set; }
public string MTLNO { get; set; }
public string SHORTTEXT { get; set; }
public string SIZECOL { get; set; }
public string UNITDES { get; set; }
public string QUANTITY { get; set; }
public string PRICE { get; set; }
public string NETVALUE { get; set; }
public string PURINFORECORD { get; set; }
public string ITEMDELIVERYDATE { get; set; }
public string GLACCTNODES { get; set; }
public string COSTCENTERDES { get; set; }
public string CType_DESC { get; set; }
public string PURDOCITEMNO { get; set; }
}
}

22
Models/ScpEntity/V_TA_ToleranceProportion.cs

@ -0,0 +1,22 @@
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; }
[DisplayName("零件类型")]
public string PartGroup { 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; }
}
}

63
Models/ScpEntity/V_TB_MPO.cs

@ -0,0 +1,63 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace CK.SCP.Models.ScpEntity
{
public partial class V_TB_MPO
{
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public long UID { get; set; }
[DisplayName("订单号")]
public string PurdocNO { get; set; }
[DisplayName("采购凭证类型描述")]
public string BuyListStrdes { get; set; }
[DisplayName("凭证日期(订货日期)")]
public DateTime DocDate { get; set; }
[DisplayName("供应商代码")]
public string VendorNO { get; set; }
[DisplayName("供应商描述")]
public string VendorDesc { get; set; }
[DisplayName("采购组描述(收货人)")]
public string PurgrpDesc { get; set; }
public string ApprovalStatus { get; set; }
[DisplayName("当前确认状态")]
public int AcceptStatus { get; set; }
[DisplayName("OA审批状态")]
public string OASTATUS { get; set; }
[DisplayName("交货日程日期")]
public DateTime ItemdeliveryDate { get; set; }
[DisplayName("创建人描述")]
public string CreatedByDesc { get; set; }
[DisplayName("创建人")]
public string CreatedBy { get; set; }
[DisplayName("创建人电话")]
public string CreatedByPhone { get; set; }
[DisplayName("状态")]
public string Ctype { get; set; }
[DisplayName("供应商的联系电话")]
public string FIRSTTELNO { get; set; }
[DisplayName("当前状态")]
public string State_DESC { get; set; }
[DisplayName("单据类型")]
public string CType_DESC { get; set; }
[NotMapped]
public DateTime DocDateBegin { get; set; }
[NotMapped]
public DateTime DocDateEnd { get; set; }
[NotMapped]
public List<string> UserInVendIds { get; set; }
[NotMapped]
public string AcceptStatusSelect { get; set; }
}
}

67
Models/ScpEntity/V_TB_MPO_DETAIL.cs

@ -0,0 +1,67 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace CK.SCP.Models.ScpEntity
{
public partial class V_TB_MPO_DETAIL
{
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public long UID { get; set; }
[DisplayName("订单号")]
public string PurdocNO { get; set; }
[DisplayName("申请单号")]
public string PurchaseReqNO { get; set; }
[DisplayName("申请人")]
public string ProposerDesc { get; set; }
[DisplayName("物料号")]
public string MtlNO { get; set; }
public string ApprovalStatus { get; set; }
[DisplayName("当前确认状态")]
public int AcceptStatus { get; set; }
[DisplayName("OA审批状态")]
public string OASTATUS { get; set; }
[DisplayName("物料描述")]
public string Shorttext { get; set; }
[DisplayName("型号规格")]
public string SizeCol { get; set; }
[DisplayName("材料牌号")]
public string Matbrand { get; set; }
[DisplayName("单位")]
public string Unitdes { get; set; }
[DisplayName("数量")]
public decimal Quantity { get; set; }
[DisplayName("价格")]
public decimal PRICE { get; set; }
[DisplayName("金额")]
public decimal NetValue { get; set; }
[DisplayName("采购信息")]
public string PurinfoReCord { get; set; }
[DisplayName("要求到货日期")]
public DateTime ItemDeliveryDate { get; set; }
[DisplayName("科目")]
public string Glaccnum { get; set; }
[DisplayName("状态")]
public string Ctype { get; set; }
[DisplayName("成本中心")]
public string CostCenterDes { get; set; }
[DisplayName("存储地点")]
public string StoreLocation { get; set; }
public string State_DESC { get; set; }
public string CType_DESC { get; set; }
[NotMapped]
public List<string> purdocnolist { get; set; }
public string PURDOCITEMNO { get; set; }
public string Remake { get; set; }
}
}

1
Models/UniApiEntity/UniApiEntities.cs

@ -55,6 +55,7 @@ namespace CK.SCP.Models.UniApiEntity
public virtual DbSet<PURReplenishQties> PURReplenishQty { get; set; }
public virtual DbSet<xxwms_review_det> xxwms_review_det { get; set; }
public virtual DbSet<PURSubcontractors> PURSubcontractors { get; set; }
public virtual DbSet<xxDiMaxes_Order> xxDiMaxes_Order { get; set; }
protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
modelBuilder.Entity<xxmes_ctrl>()

14
Models/UniApiEntity/xxDiMaxes_Order.cs

@ -0,0 +1,14 @@
using System;
using System.ComponentModel.DataAnnotations;
namespace CK.SCP.Models.UniApiEntity
{
public partial class xxDiMaxes_Order
{
[Key]
public long UID { get; set; }
public string PURDOCNO { get; set; }
public int DI_BATCHNO { get; set; }
public string PURDOCITEMNO { get; set; }
public DateTime CREATEDDATE { get; set; }
}
}

20
SCP/Common/ReportHelper.cs

@ -25,6 +25,7 @@ namespace SCP.Common
ASN_PALLET =107,
PALLET=105,
SmallBARCODE = 106,
PO_MATERIAL = 131,
}
public class TextProvider
{
@ -72,6 +73,9 @@ namespace SCP.Common
case (int)PrintType.SmallBARCODE:
ds = GET_TS_BAR_Small(p_request);
break;
case (int)PrintType.PO_MATERIAL:
ds = GET_PO_MATERIAL(p_request);
break;
}
return ds;
}
@ -290,6 +294,22 @@ namespace SCP.Common
}
return ds;
}
/// <summary>
/// 获取材料订单打印
/// </summary>
/// <param name="p_request"></param>
/// <returns></returns>
private static DataSet GET_PO_MATERIAL(HttpRequest p_request)
{
DataSet ds = new DataSet();
if (!string.IsNullOrEmpty(p_request["PurdocNO"]))
{
var PurdocNO = p_request["PurdocNO"].ToString();
ds = SCP_MPO_CONTROLLER.MPO_REPORT(PurdocNO);
}
return ds;
}
private static DataSet GET_CUSTOM_PAGE(HttpRequest p_request)
{
DataSet ds = new DataSet();

60
SCP/SCP.csproj

@ -67,6 +67,9 @@
<Reference Include="ICSharpCode.SharpZipLib, Version=0.86.0.518, Culture=neutral, PublicKeyToken=1b03e6acf1164f73, processorArchitecture=MSIL">
<HintPath>..\packages\SharpZipLib.0.86.0\lib\20\ICSharpCode.SharpZipLib.dll</HintPath>
</Reference>
<Reference Include="MailKit, Version=3.1.0.0, Culture=neutral, PublicKeyToken=4e064fe7c44a8f1b, processorArchitecture=MSIL">
<HintPath>..\packages\MailKit.3.1.0\lib\net452\MailKit.dll</HintPath>
</Reference>
<Reference Include="Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.3\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll</HintPath>
</Reference>
@ -92,6 +95,7 @@
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.Security" />
<Reference Include="System.ServiceModel" />
@ -262,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" />
@ -2954,11 +2959,13 @@
<Content Include="Views\PlanData\SCP_FORECAST.aspx" />
<Content Include="Views\PlanData\SCP_INVOICE.aspx" />
<Content Include="Views\PlanData\SCP_INVOICE_EDIT.aspx" />
<Content Include="Views\PlanData\SCP_MPO_DETAIL.aspx" />
<Content Include="Views\PlanData\SCP_PART_LIFE.aspx" />
<Content Include="Views\PlanData\SCP_PART_LIFE_DETAIL.aspx" />
<Content Include="Views\PlanData\SCP_INCOMPLETE_ASK.aspx" />
<Content Include="Views\PlanData\SCP_ASK_DETAIL.aspx" />
<Content Include="Views\PlanData\SCP_ASN_DETAIL_View.aspx" />
<Content Include="Views\PlanData\SCP_PO_MATERIAL.aspx" />
<Content Include="Views\PlanData\SCP_PO_PLAN_EXTEND.aspx" />
<Content Include="Views\PlanData\SCP_PO_EXTEND.aspx" />
<Content Include="Views\PlanData\SCP_PO_DETAIL_OUT.aspx" />
@ -2982,6 +2989,8 @@
<Content Include="Views\SupplierData\SCP_ASN_MANYCREATE.aspx" />
<Content Include="Views\SupplierData\SCP_ASN_ORINUMBER.aspx" />
<Content Include="Views\SupplierData\SCP_FORECAST.aspx" />
<Content Include="Views\SupplierData\SCP_MPO_DETAIL.aspx" />
<Content Include="Views\SupplierData\SCP_PO_MATERIAL.aspx" />
<Content Include="Views\SupplierData\SCP_PO_PLAN_EXTEND_VIEW.aspx" />
<Content Include="Views\SupplierData\SCP_PO_PLAN_VIEW.aspx" />
<Content Include="Views\PlanData\SCP_PO_PLAN_EXTEND_DETAIL.aspx" />
@ -4572,6 +4581,8 @@
<Content Include="Views\WarehouseData\SCP_RECEIVE_DETAIL.aspx" />
<Content Include="Views\富维冲压件\SCP_MAXPO_INCOMPLETE.aspx" />
<Content Include="Views\富维冲压件\SCP_MAXPO_INCOMPLETE_DETAIL.aspx" />
<Content Include="Views\富维冲压件\SCP_MPO_DETAIL.aspx" />
<Content Include="Views\富维冲压件\SCP_PO_MATERIAL.aspx" />
<Content Include="Views\富维冲压件\SCP_PO.aspx" />
<Content Include="Views\富维冲压件\SCP_PO_EXTEND.aspx" />
<Content Include="Views\富维冲压件\SCP_PO_MAX.aspx" />
@ -5023,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>
@ -5357,6 +5375,13 @@
<Compile Include="Views\PlanData\SCP_INVOICE_EDIT.aspx.designer.cs">
<DependentUpon>SCP_INVOICE_EDIT.aspx</DependentUpon>
</Compile>
<Compile Include="Views\PlanData\SCP_MPO_DETAIL.aspx.cs">
<DependentUpon>SCP_MPO_DETAIL.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Views\PlanData\SCP_MPO_DETAIL.aspx.designer.cs">
<DependentUpon>SCP_MPO_DETAIL.aspx</DependentUpon>
</Compile>
<Compile Include="Views\PlanData\SCP_PART_LIFE.aspx.cs">
<DependentUpon>SCP_PART_LIFE.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
@ -5392,6 +5417,13 @@
<Compile Include="Views\PlanData\SCP_ASN_DETAIL_View.aspx.designer.cs">
<DependentUpon>SCP_ASN_DETAIL_View.aspx</DependentUpon>
</Compile>
<Compile Include="Views\PlanData\SCP_PO_MATERIAL.aspx.cs">
<DependentUpon>SCP_PO_MATERIAL.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Views\PlanData\SCP_PO_MATERIAL.aspx.designer.cs">
<DependentUpon>SCP_PO_MATERIAL.aspx</DependentUpon>
</Compile>
<Compile Include="Views\PlanData\SCP_PO_PLAN_EXTEND.aspx.cs">
<DependentUpon>SCP_PO_PLAN_EXTEND.aspx</DependentUpon>
</Compile>
@ -5552,6 +5584,20 @@
<Compile Include="Views\SupplierData\SCP_FORECAST.aspx.designer.cs">
<DependentUpon>SCP_FORECAST.aspx</DependentUpon>
</Compile>
<Compile Include="Views\SupplierData\SCP_MPO_DETAIL.aspx.cs">
<DependentUpon>SCP_MPO_DETAIL.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Views\SupplierData\SCP_MPO_DETAIL.aspx.designer.cs">
<DependentUpon>SCP_MPO_DETAIL.aspx</DependentUpon>
</Compile>
<Compile Include="Views\SupplierData\SCP_PO_MATERIAL.aspx.cs">
<DependentUpon>SCP_PO_MATERIAL.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Views\SupplierData\SCP_PO_MATERIAL.aspx.designer.cs">
<DependentUpon>SCP_PO_MATERIAL.aspx</DependentUpon>
</Compile>
<Compile Include="Views\SupplierData\SCP_PO_PLAN_EXTEND_VIEW.aspx.cs">
<DependentUpon>SCP_PO_PLAN_EXTEND_VIEW.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
@ -6034,6 +6080,20 @@
<Compile Include="Views\富维冲压件\SCP_MAXPO_INCOMPLETE_DETAIL.aspx.designer.cs">
<DependentUpon>SCP_MAXPO_INCOMPLETE_DETAIL.aspx</DependentUpon>
</Compile>
<Compile Include="Views\富维冲压件\SCP_MPO_DETAIL.aspx.cs">
<DependentUpon>SCP_MPO_DETAIL.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Views\富维冲压件\SCP_MPO_DETAIL.aspx.designer.cs">
<DependentUpon>SCP_MPO_DETAIL.aspx</DependentUpon>
</Compile>
<Compile Include="Views\富维冲压件\SCP_PO_MATERIAL.aspx.cs">
<DependentUpon>SCP_PO_MATERIAL.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Views\富维冲压件\SCP_PO_MATERIAL.aspx.designer.cs">
<DependentUpon>SCP_PO_MATERIAL.aspx</DependentUpon>
</Compile>
<Compile Include="Views\富维冲压件\SCP_PO.aspx.cs">
<DependentUpon>SCP_PO.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(), "零件容差模板");
}
}
}

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

62
SCP/Views/BasicData/SCP_ToleranceProportion.aspx

@ -0,0 +1,62 @@
<%@ 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 ID="Button1" runat="server" Text="导出" Icon="PageExcel" OnClick="BtnOutPut_OnClick" />
</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 runat="server" SortField="PartCode" DataField="PartCode" HeaderText="零件号" Width="200px" />
<f:BoundField runat="server" SortField="PartName" DataField="PartName" HeaderText="零件名称" Width="200px" />
<f:BoundField runat="server" SortField="VToleranceProportion" DataField="VToleranceProportion" HeaderText="容差" Width="100px" />
<f:BoundField runat="server" HeaderText="零件类型" ColumnID="" DataField="PartGroup" Width="200px" />
</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>

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

@ -0,0 +1,137 @@
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)
{
TA_ToleranceProportion _entity = new TA_ToleranceProportion();
_entity.PartCode = txtPartCode.Text;
SCP_ToleranceProportion_Controller.Get_TA_ToleranceProportion_List(_entity, (_ret) =>
{
if (_ret.State == ReturnStatus.Succeed)
{
Dictionary<string, string> cellheader = new Dictionary<string, string> {
{ "PartCode", "零件号" },
{ "PartName", "零件名称" },
{ "VToleranceProportion", "容差" },
{ "PartGroup", "零件类型" },
};
string url = EntityListToExcel2003(cellheader, _ret.Result.ToList(), "零件容差控制导出");
}
});
}
//查询
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();
}
}
}
}

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

@ -0,0 +1,116 @@
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </自动生成>
//------------------------------------------------------------------------------
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>
/// Button1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button Button1;
/// <summary>
/// Grid1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Grid Grid1;
}
}

74
SCP/Views/PlanData/SCP_MPO_DETAIL.aspx

@ -0,0 +1,74 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SCP_MPO_DETAIL.aspx.cs" Inherits="SCP.Views.PlanData.SCP_MPO_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" />
<title></title>
</head>
<body>
<form id="form1" runat="server">
<f:PageManager runat="server" AutoSizePanelID="Panel1" />
<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_REFRESH" runat="server" EnablePostBack="True" Text="刷新" Icon="box">
</f:Button>
</Items>
</f:Toolbar>
</Toolbars>
<Items>
<f:HiddenField ID="HF_GRID_INDEX" runat="server"></f:HiddenField>
<f:Grid ID="Grid_V_TB_MPO_DETAIL" EnableCollapse="true" ShowBorder="true" EnableMultiSelect="true" ShowHeader="false" runat="server" EnableCheckBoxSelect="true"
DataKeyNames="UID,PurdocNO,PurchaseReqNO,AcceptStatus,Ctype"
SortField="PurdocNO" AllowSorting="true" BoxFlex="1" SortDirection="ASC"
AllowPaging="True"
IsDatabasePaging="true" PageSize="10" OnPageIndexChange="Grid_V_TB_PO_DETAIL_PageIndexChange">
<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"
runat="server">
<f:ListItem Text="10" Value="10" />
<f:ListItem Text="40" Value="40" />
<f:ListItem Text="80" Value="80" />
<f:ListItem Text="100" Value="100" />
<f:ListItem Text="200" Value="200" />
</f:DropDownList>
</PageItems>
<Columns>
<f:BoundField Width="70px" DataField="CType_DESC" DataFormatString="{0}" HeaderText="是否作废" />
<f:BoundField Width="100px" DataField="PurdocNO" HeaderText="订单号" DataFormatString="{0}"/>
<f:BoundField Width="100px" DataField="PURDOCITEMNO" HeaderText="行号" DataFormatString="{0}"/>
<f:BoundField Width="100px" DataField="PurchaseReqNO" HeaderText="申请单号" DataFormatString="{0}"/>
<f:BoundField Width="100px" DataField="State_DESC" HeaderText="状态" DataFormatString="{0}"/>
<f:BoundField Width="80px" DataField="ProposerDesc" HeaderText="申请人" DataFormatString="{0}"/>
<f:BoundField Width="100px" DataField="MtlNO" HeaderText="物料号" DataFormatString="{0}"/>
<f:BoundField Width="150px" DataField="Shorttext" DataFormatString="{0}" HeaderText="物料描述" />
<f:BoundField Width="80px" DataField="SizeCol" DataFormatString="{0}" HeaderText="型号规格" />
<f:BoundField Width="80px" DataField="Unitdes" DataFormatString="{0}" HeaderText="单位" />
<f:BoundField Width="100px" DataField="Quantity" DataFormatString="{0:F6}" HeaderText="数量" />
<f:BoundField Width="80px" DataField="PRICE" DataFormatString="{0:F8}" HeaderText="价格" />
<f:BoundField Width="80px" DataField="NetValue" DataFormatString="{0:F8}" HeaderText="金额" />
<f:BoundField Width="100px" DataField="PurinfoReCord" DataFormatString="{0}" HeaderText="采购信息" />
<f:BoundField Width="100px" DataField="ItemDeliveryDate" DataFormatString="{0:yyyy-MM-dd}" HeaderText="要求到货日期" />
<f:BoundField Width="80px" DataField="Glaccnum" DataFormatString="{0}" HeaderText="科目" />
<f:BoundField Width="80px" DataField="CostCenterDes" DataFormatString="{0}" HeaderText="成本中心" />
<f:BoundField Width="80px" DataField="StoreLocation" DataFormatString="{0}" HeaderText="存储地点" />
<f:BoundField Width="80px" DataField="StoreLocation" DataFormatString="{0}" HeaderText="存储地点" />
<f:BoundField Width="80px" DataField="Remake" DataFormatString="{0}" HeaderText="备注" />
<f:BoundField Width="80px" DataField="AcceptStatus" DataFormatString="{0}" Hidden="true" />
</Columns>
</f:Grid>
</Items>
</f:Panel>
</form>
</body>
</html>

169
SCP/Views/PlanData/SCP_MPO_DETAIL.aspx.cs

@ -0,0 +1,169 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.UI.WebControls;
using CK.SCP.Models.ScpEntity;
using CK.SCP.Controller;
using FineUI;
using CK.SCP.Models.Enums;
namespace SCP.Views.PlanData
{
public partial class SCP_MPO_DETAIL : PageBase
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
if (!string.IsNullOrEmpty(Request["PurdocNO"]))
{
BindDetail();
}
else
{
Alert.Show("请选择数据后再查看明细!");
return;
}
}
}
public void SearchV_TB_PO_DETAIL(Action<IQueryable<V_TB_MPO_DETAIL>> p_action)
{
V_TB_MPO_DETAIL _entity = new V_TB_MPO_DETAIL();
string purdocnolist =Request["PurdocNO"];
_entity.purdocnolist = purdocnolist.Split(',').ToList();
SCP_MPO_CONTROLLER.Get_V_TB_MPO_DETAIL_List(_entity,(_ret)=> {
if (_ret.State == ReturnStatus.Succeed)
{
p_action(_ret.Result);
}
});
}
public void BindDetail()
{
SearchV_TB_PO_DETAIL((ret)=>{
this.Grid_V_TB_MPO_DETAIL.RecordCount = ret.Count();
var list = SortAndPage<V_TB_MPO_DETAIL>(ret, Grid_V_TB_MPO_DETAIL);
Grid_V_TB_MPO_DETAIL.DataSource = list.ToList();
Grid_V_TB_MPO_DETAIL.DataBind();
});
}
protected void Grid_V_TB_PO_DETAIL_PageIndexChange(object sender, GridPageEventArgs e)
{
BindDetail();
}
protected void ddlGridPageSize_SelectedIndexChanged(object sender, EventArgs e)
{
Grid_V_TB_MPO_DETAIL.PageSize = Convert.ToInt32(ddlGridPageSize.SelectedValue);
BindDetail();
}
///// <summary>
///// 审批通过
///// </summary>
///// <param name="sender"></param>
///// <param name="e"></param>
//protected void btnAccept_Click(object sender, EventArgs e)
//{
// int[] selections = Grid_V_TB_MPO_DETAIL.SelectedRowIndexArray;
// List<string> NOList = new List<string>();
// //List<string> ctylist = new List<string>();
// List<int> AcceptStatusList = new List<int>();
// if (selections.Count() ==0 )
// {
// Alert.Show("您未选择数据进行审批");
// return;
// }
// else
// {
// foreach (int rowIndex in selections)
// {
// NOList.Add(Grid_V_TB_MPO_DETAIL.DataKeys[rowIndex][1] as string);
// //ctylist.Add(Grid_V_TB_MPO_DETAIL.DataKeys[rowIndex][4] as string);
// var app = Grid_V_TB_MPO_DETAIL.DataKeys[rowIndex][3].ToString();
// AcceptStatusList.Add(int.Parse(app));
// }
// NOList = NOList.Distinct().ToList();
// //if (ctylist.Contains("D"))
// //{
// // Alert.Show("选择的数据包含已经作废的数据");
// // return;
// //}
// if (AcceptStatusList.Contains((int)GeneralMaterialOrderState.Finish))
// {
// Alert.Show("选择的数据包含已确认的数据");
// return;
// }
// var ret = SCP_MPO_CONTROLLER.Save_MPO_STATE(NOList, GeneralMaterialOrderState.Finish);
// if (ret.State == ReturnStatus.Succeed)
// {
// Alert.Show("确认成功");
// BindDetail();
// }
// else
// {
// Alert.Show(string.Join("<br>", ret.MessageList));
// return;
// }
// }
//}
///// <summary>
///// 取消审批
///// </summary>
///// <param name="sender"></param>
///// <param name="e"></param>
//protected void btnCancel_Click(object sender, EventArgs e)
//{
// int[] selections = Grid_V_TB_MPO_DETAIL.SelectedRowIndexArray;
// List<string> NOList = new List<string>();
// List<string> ctylist = new List<string>();
// List<int> AcceptStatusList = new List<int>();
// if (selections.Count() == 0)
// {
// Alert.Show("您未选择数据进行取消审批");
// return;
// }
// else
// {
// foreach (int rowIndex in selections)
// {
// NOList.Add(Grid_V_TB_MPO_DETAIL.DataKeys[rowIndex][1] as string);
// ctylist.Add(Grid_V_TB_MPO_DETAIL.DataKeys[rowIndex][4] as string);
// AcceptStatusList.Add(int.Parse(Grid_V_TB_MPO_DETAIL.DataKeys[rowIndex][3].ToString()));
// }
// NOList = NOList.Distinct().ToList();
// if (ctylist.Contains("D"))
// {
// Alert.Show("选择的数据包含已经作废的数据");
// return;
// }
// if (AcceptStatusList.Contains((int)GeneralMaterialOrderState.New))
// {
// Alert.Show("选择的数据包含新建的数据");
// return;
// }
// var ret = SCP_MPO_CONTROLLER.Save_MPO_STATE(NOList, GeneralMaterialOrderState.New);
// if (ret.State == ReturnStatus.Succeed)
// {
// Alert.Show("取消成功");
// BindDetail();
// }
// else
// {
// Alert.Show(string.Join("<br>", ret.MessageList));
// return;
// }
// }
//}
}
}

98
SCP/Views/PlanData/SCP_MPO_DETAIL.aspx.designer.cs

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

132
SCP/Views/PlanData/SCP_PO_MATERIAL.aspx

@ -0,0 +1,132 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SCP_PO_MATERIAL.aspx.cs" Inherits="SCP.Views.PlanData.SCP_PO_MATERIAL" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
</head>
<body>
<form id="form1" runat="server">
<f:PageManager runat="server" AutoSizePanelID="Panel1" />
<f:Panel ID="Panel1" runat="server" Title="" Layout="VBox" BoxConfigAlign="Stretch" BoxConfigPosition="Start">
<Items>
<f:Form runat="server">
<Toolbars>
<f:Toolbar ID="Toolbar2" runat="server">
<Items>
<f:ToolbarSeparator runat="server" />
<f:Button ID="Button3" runat="server" EnablePostBack="false" Text="刷新" Icon="Reload" OnClientClick="location.reload();">
</f:Button>
<f:ToolbarSeparator runat="server" />
<f:Button ID="btnOutput" runat="server" Text="导出" Icon="PageExcel" OnClick="btnOutput_Click">
</f:Button>
<f:Button ID="btnDetail" runat="server" Text="明细" Icon="Zoom" OnClick="btnDetail_Click">
</f:Button>
<f:ToolbarSeparator runat="server" />
<f:Button ID="btnShow" runat="server" Text="显示查询面板" OnClick="btnShow_Click">
</f:Button>
<f:ToolbarSeparator runat="server" />
</Items>
</f:Toolbar>
</Toolbars>
</f:Form>
<f:GroupPanel runat="server" ID="gp1" Hidden="true" Layout="HBox">
<Items>
<f:Form runat="server">
<Rows>
<f:FormRow runat="server" ColumnWidths="25% 25% 25% 25%">
<Items>
<f:TextBox runat="server" Label="订单号" EmptyText="" ID="TXT_PurdocNO" />
<f:DatePicker runat="server" Required="true" DateFormatString="yyyy-MM-dd" Label="订货日期" EmptyText="请选择日期" ID="DP_StartDate" />
<f:DatePicker runat="server" Required="true" DateFormatString="yyyy-MM-dd" Label="至" EmptyText="请选择日期" ID="DP_EndDate" />
<f:DropDownList runat="server" ID="DDL_State" Label="状态">
<f:ListItem Text="请选择状态" Value="" />
<f:ListItem Text="待确认" Value="0" />
<f:ListItem Text="供应商已确认" Value="1" />
<f:ListItem Text="作废" Value="-1" />
</f:DropDownList>
</Items>
</f:FormRow>
<f:FormRow runat="server" ColumnWidths="25% 25% 25% 25%">
<Items>
<f:TextBox runat="server" Label="创建人" EmptyText="" ID="TXT_CreatedByDesc" />
<f:TextBox runat="server" Label="供应商编码" EmptyText="" ID="TXT_VendorNO" />
<f:TextBox runat="server" Label="供应商描述" EmptyText="" ID="TXT_VendorDesc" />
</Items>
</f:FormRow>
<f:FormRow runat="server">
<Items>
<f:Button runat="server" Text="关闭" ID="BtnClose" OnClick="BtnClose_Click"></f:Button>
<f:Button ID="BtnSearch" runat="server" OnClick="BtnSearch_Click" Text="快速查找订单">
</f:Button>
</Items>
</f:FormRow>
</Rows>
</f:Form>
</Items>
</f:GroupPanel>
<f:Grid ID="Grid_V_TB_MPO" EnableCollapse="true" ShowBorder="true" ShowHeader="true" runat="server" EnableCheckBoxSelect="true" EnableTextSelection="true"
DataKeyNames="UID,PurdocNO,BuyListStrdes,DocDate,VendorNO,VendorDesc,PurgrpDesc,AcceptStatus,ItemdeliveryDate,CreatedByDesc,CreatedBy,CreatedByPhone,Ctype,FIRSTTELNO"
CssClass="maingrid" EnableRowDoubleClickEvent="True" SortField="ApprovalStatus"
IsDatabasePaging="True" AllowPaging="True" OnRowDoubleClick="Grid_V_TB_MPO_RowDoubleClick" BoxFlex="1"
AutoScroll="True" PageSize="50" SortDirection="DESC" OnPageIndexChange="Grid_V_TB_MPO_PageIndexChange">
<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"
runat="server">
<f:ListItem Text="10" Value="10" />
<f:ListItem Text="100" Value="100" />
<f:ListItem Text="500" Value="500" />
<f:ListItem Text="1000" Value="1000" />
<f:ListItem Text="5000" Value="5000" />
<f:ListItem Text="10000" Value="10000" />
</f:DropDownList>
</PageItems>
<Columns>
<f:BoundField Width="90px" DataField="State_DESC" DataFormatString="{0}" HeaderText="状态" />
<f:BoundField Width="80px" DataField="OASTATUS" DataFormatString="{0}" HeaderText="OA状态" />
<f:BoundField Width="100px" DataField="PurdocNO" DataFormatString="{0}" HeaderText="订单号" />
<f:BoundField Width="100px" DataField="BuyListStrdes" DataFormatString="{0}" HeaderText="凭证类型" />
<f:BoundField Width="100px" SortField="DocDate" DataField="DocDate" DataFormatString="{0:yyyy-MM-dd}" HeaderText="订货日期" />
<f:BoundField Width="100px" DataField="VendorNO" DataFormatString="{0}" HeaderText="供应商编码" />
<f:BoundField Width="100px" DataField="VendorDesc" HeaderText="供应商描述" />
<f:BoundField Width="100px" DataField="PurgrpDesc" DataFormatString="{0}" HeaderText="收货人" />
<f:BoundField Width="100px" DataField="ItemdeliveryDate" DataFormatString="{0:yyyy-MM-dd}" HeaderText="交货日程日期" />
<f:BoundField Width="100px" DataField="CreatedByDesc" DataFormatString="{0}" HeaderText="创建人" />
<f:BoundField Width="100px" DataField="CreatedByPhone" DataFormatString="{0}" HeaderText="创建人电话" />
<f:BoundField Width="100px" DataField="FIRSTTELNO" DataFormatString="{0}" HeaderText="供应商联系电话" />
<f:BoundField Width="100px" DataField="CType_DESC" DataFormatString="{0}" HeaderText="是否已作废" />
</Columns>
</f:Grid>
</Items>
</f:Panel>
<f:Window runat="server" ID="Window1" Hidden="True" Height="600px" Width="1000px" AutoScroll="True" OnClose="Window1_Close" CloseAction="HidePostBack"
WindowPosition="Center" IsModal="true" Title="明细详情" Target="Parent" EnableIFrame="true"
IFrameUrl="about:blank" />
</form>
</body>
</html>

272
SCP/Views/PlanData/SCP_PO_MATERIAL.aspx.cs

@ -0,0 +1,272 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.UI.WebControls;
using CK.SCP.Models.ScpEntity;
using CK.SCP.Controller;
using FineUI;
using System.Text;
using CK.SCP.Models.Enums;
using Microsoft.Ajax.Utilities;
namespace SCP.Views.PlanData
{
public partial class SCP_PO_MATERIAL : PageBase
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
LoadData();
}
}
public void LoadData()
{
if (CurrentUser.FactoryList == null || CurrentUser.FactoryList.Count == 0)
{
Alert.Show("当前用户未选择地点");
return;
}
BindOrder();
}
public void BindOrder()
{
SearchV_TB_MPO((result) =>
{
Grid_V_TB_MPO.RecordCount = result.Count();
var list = SortAndPage<V_TB_MPO>(result, Grid_V_TB_MPO);
Grid_V_TB_MPO.DataSource = list;
Grid_V_TB_MPO.DataBind();
});
}
public void SearchV_TB_MPO(Action<IQueryable<V_TB_MPO>> p_action)
{
V_TB_MPO _entity = new V_TB_MPO();
if (this.DP_StartDate.SelectedDate != null)
{
_entity.DocDateBegin = Convert.ToDateTime(DP_StartDate.SelectedDate);
}
if (DP_EndDate.SelectedDate != null)
{
_entity.DocDateEnd = Convert.ToDateTime(DP_EndDate.SelectedDate);
}
if (!string.IsNullOrWhiteSpace(TXT_CreatedByDesc.Text))
{
_entity.CreatedBy = TXT_CreatedByDesc.Text.Trim();
}
if (!string.IsNullOrWhiteSpace(TXT_VendorNO.Text))
{
_entity.VendorNO = TXT_VendorNO.Text.Trim();
}
if (!string.IsNullOrWhiteSpace(TXT_VendorNO.Text))
{
_entity.VendorNO = TXT_VendorNO.Text.Trim();
}
if (!string.IsNullOrWhiteSpace(TXT_VendorDesc.Text))
{
_entity.VendorDesc = TXT_VendorDesc.Text.Trim();
}
if (!string.IsNullOrWhiteSpace(TXT_PurdocNO.Text))
{
_entity.PurdocNO = TXT_PurdocNO.Text.Trim();
}
if (!string.IsNullOrEmpty( DDL_State.SelectedValue))
{
_entity.AcceptStatusSelect = DDL_State.SelectedValue;
}
_entity.UserInVendIds = CurrentUser.VenderList;
SCP_MPO_CONTROLLER.Get_V_TB_MPO_List(_entity, (_ret) =>
{
if (_ret.State == ReturnStatus.Succeed)
{
p_action(_ret.Result);
}
});
}
protected void Grid_V_TB_MPO_RowDoubleClick(object sender, FineUI.GridRowClickEventArgs e)
{
int[] selections = Grid_V_TB_MPO.SelectedRowIndexArray;
List<string> NOList = new List<string>();
if (selections.Count() > 0)
{
foreach (int rowIndex in selections)
{
NOList.Add(Grid_V_TB_MPO.DataKeys[rowIndex][1] as string);
}
string BillNum = String.Join(",", NOList);
string url = string.Format("../PlanData/SCP_MPO_DETAIL.aspx?PurdocNO={0}", BillNum);
PageContext.RegisterStartupScript(Window1.GetShowReference(url));
}
else
{
Alert.Show("请选择数据后再进行查看明细");
return;
}
}
protected void Grid_V_TB_MPO_PageIndexChange(object sender, FineUI.GridPageEventArgs e)
{
BindOrder();
}
/// <summary>
/// 导出
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnOutput_Click(object sender, EventArgs e)
{
int[] selections = Grid_V_TB_MPO.SelectedRowIndexArray;
List<string> NOList = new List<string>();
if (selections.Count() > 0)
{
foreach (int rowIndex in selections)
{
var ctypesta = Grid_V_TB_MPO.DataKeys[rowIndex][13] as string;
if (ctypesta == "D")
{
PageContext.RegisterStartupScript(Alert.GetShowInTopReference("选中的数据包含作废信息,请重新选择!"));
return;
}
NOList.Add(Grid_V_TB_MPO.DataKeys[rowIndex][1] as string);
}
}
else
{
PageContext.RegisterStartupScript(Alert.GetShowInTopReference("没有选择数据!"));
return;
}
NOList = NOList.Distinct().ToList();
var ret = SCP_MPO_CONTROLLER.GetMPODetailList(NOList);
Dictionary<string, string> cellheader = new Dictionary<string, string>
{
{ "PurdocNO", "订单号" },
{"PURDOCITEMNO","行号" },
{ "PurchaseReqNO", "申请单号" },
{ "ProposerDesc", "申请人" },
{"State_DESC","状态" },
{ "OASTATUS", "OA审批状态" },
{ "MtlNO", "物料号" },
{ "Shorttext", "物料描述" },
{ "SizeCol", "型号规格" },
{ "Matbrand", "材料牌号" },
{ "Unitdes", "单位" },
{ "Quantity", "数量" },
{ "PRICE", "价格" },
{ "NetValue", "金额" },
{ "PurinfoReCord", "采购信息" },
{ "ItemDeliveryDate", "要求到货日期" },
{ "Glaccnum", "科目" },
{ "CostCenterDes", "成本中心" },
{ "StoreLocation", "存储地点" },
{ "CType_DESC","是否已作废"},
};
string url = EntityListToExcel2003(cellheader, ret.ToList(), "一般材料采购订单明细");
}
protected void btnDetail_Click(object sender, EventArgs e)
{
int[] selections = Grid_V_TB_MPO.SelectedRowIndexArray;
List<string> NOList = new List<string>();
if (selections.Count() > 0)
{
foreach (int rowIndex in selections)
{
NOList.Add(Grid_V_TB_MPO.DataKeys[rowIndex][1] as string);
}
string BillNum = String.Join(",", NOList);
string url = string.Format("../PlanData/SCP_MPO_DETAIL.aspx?PurdocNO={0}", BillNum);
PageContext.RegisterStartupScript(Window1.GetShowReference(url));
}
else
{
Alert.Show("请选择数据后再进行查看明细");
return;
}
}
protected void btnShow_Click(object sender, EventArgs e)
{
gp1.Hidden = false;
}
protected void BtnClose_Click(object sender, EventArgs e)
{
gp1.Hidden = true;
}
protected void BtnSearch_Click(object sender, EventArgs e)
{
BindOrder();
}
protected void ddlGridPageSize_SelectedIndexChanged(object sender, EventArgs e)
{
Grid_V_TB_MPO.PageSize = Convert.ToInt32(ddlGridPageSize.SelectedValue);
BindOrder();
}
protected void Window1_Close(object sender, WindowCloseEventArgs e)
{
BindOrder();
}
///// <summary>
///// 打印
///// </summary>
///// <param name="sender"></param>
///// <param name="e"></param>
//protected void btnPrinter_Click(object sender, EventArgs e)
//{
// int[] selections = Grid_V_TB_MPO.SelectedRowIndexArray;
// string PurdocNO = "";
// int acc = 0;
// string status = "";
// if (selections.Count() == 0)
// {
// Alert.Show("请选择要打印的数据");
// return;
// }
// else if (selections.Count() > 1)
// {
// Alert.Show("只能选择一条数据进行打印");
// return;
// }
// else
// {
// foreach (int rowIndex in selections)
// {
// PurdocNO = Grid_V_TB_MPO.DataKeys[rowIndex][1] as string;
// acc = int.Parse(Grid_V_TB_MPO.DataKeys[rowIndex][7].ToString());
// status = Grid_V_TB_MPO.DataKeys[rowIndex][12] as string;
// if (status =="D")
// {
// Alert.Show("已作废的数据不可以进行打印");
// return;
// }
// }
// if (acc == (int)GeneralMaterialOrderState.New)
// {
// Alert.Show("供应商确认过的数据才可以打印");
// return;
// }
// var str = string.Format("window.open(\"../../Handlers/GenerateReport.ashx?report=GeneralMaterialOrder&data=131&type=pdf&filename=标签.pdf&PurdocNO={0}&open=\")", PurdocNO);
// PageContext.RegisterStartupScript(str);
// }
//}
}
}

215
SCP/Views/PlanData/SCP_PO_MATERIAL.aspx.designer.cs

@ -0,0 +1,215 @@
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </自动生成>
//------------------------------------------------------------------------------
namespace SCP.Views.PlanData
{
public partial class SCP_PO_MATERIAL
{
/// <summary>
/// form1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// Panel1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Panel Panel1;
/// <summary>
/// Toolbar2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Toolbar Toolbar2;
/// <summary>
/// Button3 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button Button3;
/// <summary>
/// btnOutput 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnOutput;
/// <summary>
/// btnDetail 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnDetail;
/// <summary>
/// btnShow 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnShow;
/// <summary>
/// gp1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.GroupPanel gp1;
/// <summary>
/// TXT_PurdocNO 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TXT_PurdocNO;
/// <summary>
/// DP_StartDate 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.DatePicker DP_StartDate;
/// <summary>
/// DP_EndDate 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.DatePicker DP_EndDate;
/// <summary>
/// DDL_State 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.DropDownList DDL_State;
/// <summary>
/// TXT_CreatedByDesc 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TXT_CreatedByDesc;
/// <summary>
/// TXT_VendorNO 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TXT_VendorNO;
/// <summary>
/// TXT_VendorDesc 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TXT_VendorDesc;
/// <summary>
/// BtnClose 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button BtnClose;
/// <summary>
/// BtnSearch 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button BtnSearch;
/// <summary>
/// Grid_V_TB_MPO 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Grid Grid_V_TB_MPO;
/// <summary>
/// ToolbarSeparator1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.ToolbarSeparator ToolbarSeparator1;
/// <summary>
/// ToolbarText1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.ToolbarText ToolbarText1;
/// <summary>
/// ddlGridPageSize 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.DropDownList ddlGridPageSize;
/// <summary>
/// Window1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Window Window1;
}
}

46
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();
_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,9 +98,10 @@ 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();
var list = SortAndPage<V_TB_ASK_DETAIL>(ret, Grid_V_TB_ASK_DETAIL);
var _ls = SCP_ASK_CONTROLLER.Get_CAN_SHIPQTY(list.ToList());
@ -165,14 +167,14 @@ 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)
{
@ -243,18 +245,19 @@ namespace SCP.SupplierData
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 _Sheets = modifyValue.Keys.Contains("Sheets") ? modifyValue["Sheets"] : _entity.ReceivedQty;
var _ProduceDate = modifyValue.Keys.Contains("Time") ? modifyValue["Time"].ToString() :"33";
var _ProduceDate = modifyValue.Keys.Contains("Time") ? modifyValue["Time"].ToString() : "33";
if (_ProduceDate=="33"&& ConvertHelper.To<decimal>(_Qty1) > 0)
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;
}
@ -266,7 +269,7 @@ namespace SCP.SupplierData
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;
@ -422,34 +425,31 @@ 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)
{
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");
@ -474,7 +474,7 @@ 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 =>
{
@ -492,7 +492,7 @@ namespace SCP.SupplierData
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("生成发货单成功!");

2
SCP/Views/SupplierData/SCP_ASN_DETAIL.aspx.cs

@ -381,7 +381,7 @@ namespace SCP.SupplierData
{
foreach (var con in conasn)
{
var maxdetail = SCPDB.TB_MAXPO_DETAIL.FirstOrDefault(p => p.PoBillNum == con.PoBillNum && p.PartCode == con.PartCode);
var maxdetail = SCPDB.TB_MAXPO_DETAIL.FirstOrDefault(p => p.PoBillNum == con.PoBillNum && p.PartCode == con.PartCode && !p.IsDeleted);
maxdetail.AsnQty = maxdetail.AsnQty +con.PoQty;
SCPDB.TB_MAXPO_DETAIL.AddOrUpdate(maxdetail);
SCPDB.TB_MAXPO_CONSUME.Remove(con);

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

77
SCP/Views/SupplierData/SCP_MPO_DETAIL.aspx

@ -0,0 +1,77 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SCP_MPO_DETAIL.aspx.cs" Inherits="SCP.Views.SupplierData.SCP_MPO_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" />
<title></title>
</head>
<body>
<form id="form1" runat="server">
<f:PageManager runat="server" AutoSizePanelID="Panel1" />
<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_REFRESH" runat="server" EnablePostBack="True" Text="刷新" Icon="box">
</f:Button>
<f:Button ID="btnAccept" runat="server" Text="确认订单" Icon="Accept" OnClick="btnAccept_Click" >
</f:Button>
<f:Button ID="btnCancel" runat="server" Text="取消订单" Icon="Cancel" OnClick="btnCancel_Click" >
</f:Button>
</Items>
</f:Toolbar>
</Toolbars>
<Items>
<f:HiddenField ID="HF_GRID_INDEX" runat="server"></f:HiddenField>
<f:Grid ID="Grid_V_TB_MPO_DETAIL" EnableCollapse="true" ShowBorder="true" EnableMultiSelect="true" ShowHeader="false" runat="server" EnableCheckBoxSelect="true"
DataKeyNames="UID,PurdocNO,PurchaseReqNO,AcceptStatus,Ctype"
SortField="PurdocNO" AllowSorting="true" BoxFlex="1" SortDirection="ASC"
AllowPaging="True"
IsDatabasePaging="true" PageSize="10" OnPageIndexChange="Grid_V_TB_PO_DETAIL_PageIndexChange">
<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"
runat="server">
<f:ListItem Text="10" Value="10" />
<f:ListItem Text="40" Value="40" />
<f:ListItem Text="80" Value="80" />
<f:ListItem Text="100" Value="100" />
<f:ListItem Text="200" Value="200" />
</f:DropDownList>
</PageItems>
<Columns>
<f:BoundField Width="70px" DataField="CType_DESC" DataFormatString="{0}" HeaderText="是否作废" />
<f:BoundField Width="100px" DataField="PurdocNO" HeaderText="订单号" DataFormatString="{0}"/>
<f:BoundField Width="100px" DataField="PURDOCITEMNO" HeaderText="行号" DataFormatString="{0}"/>
<f:BoundField Width="100px" DataField="PurchaseReqNO" HeaderText="申请单号" DataFormatString="{0}"/>
<f:BoundField Width="100px" DataField="State_DESC" HeaderText="状态" DataFormatString="{0}"/>
<f:BoundField Width="80px" DataField="ProposerDesc" HeaderText="申请人" DataFormatString="{0}"/>
<f:BoundField Width="100px" DataField="MtlNO" HeaderText="物料号" DataFormatString="{0}"/>
<f:BoundField Width="150px" DataField="Shorttext" DataFormatString="{0}" HeaderText="物料描述" />
<f:BoundField Width="80px" DataField="SizeCol" DataFormatString="{0}" HeaderText="型号规格" />
<f:BoundField Width="80px" DataField="Unitdes" DataFormatString="{0}" HeaderText="单位" />
<f:BoundField Width="100px" DataField="Quantity" DataFormatString="{0:F6}" HeaderText="数量" />
<f:BoundField Width="80px" DataField="PRICE" DataFormatString="{0:F8}" HeaderText="价格" />
<f:BoundField Width="80px" DataField="NetValue" DataFormatString="{0:F8}" HeaderText="金额" />
<f:BoundField Width="100px" DataField="PurinfoReCord" DataFormatString="{0}" HeaderText="采购信息" />
<f:BoundField Width="100px" DataField="ItemDeliveryDate" DataFormatString="{0:yyyy-MM-dd}" HeaderText="要求到货日期" />
<f:BoundField Width="80px" DataField="Glaccnum" DataFormatString="{0}" HeaderText="科目" />
<f:BoundField Width="80px" DataField="CostCenterDes" DataFormatString="{0}" HeaderText="成本中心" />
<f:BoundField Width="80px" DataField="StoreLocation" DataFormatString="{0}" HeaderText="存储地点" />
<f:BoundField Width="80px" DataField="Remake" DataFormatString="{0}" HeaderText="备注" />
<f:BoundField Width="80px" DataField="AcceptStatus" DataFormatString="{0}" Hidden="true" />
</Columns>
</f:Grid>
</Items>
</f:Panel>
</form>
</body>
</html>

170
SCP/Views/SupplierData/SCP_MPO_DETAIL.aspx.cs

@ -0,0 +1,170 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.UI.WebControls;
using CK.SCP.Models.ScpEntity;
using CK.SCP.Controller;
using FineUI;
using CK.SCP.Models.Enums;
namespace SCP.Views.SupplierData
{
public partial class SCP_MPO_DETAIL : PageBase
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
if (!string.IsNullOrEmpty(Request["PurdocNO"]))
{
BindDetail();
}
else
{
Alert.Show("请选择数据后再查看明细!");
return;
}
}
}
public void SearchV_TB_PO_DETAIL(Action<IQueryable<V_TB_MPO_DETAIL>> p_action)
{
V_TB_MPO_DETAIL _entity = new V_TB_MPO_DETAIL();
string purdocnolist =Request["PurdocNO"];
_entity.purdocnolist = purdocnolist.Split(',').ToList();
_entity.Ctype = "N";
SCP_MPO_CONTROLLER.Get_V_TB_MPO_DETAIL_List(_entity,(_ret)=> {
if (_ret.State == ReturnStatus.Succeed)
{
p_action(_ret.Result);
}
});
}
public void BindDetail()
{
SearchV_TB_PO_DETAIL((ret)=>{
this.Grid_V_TB_MPO_DETAIL.RecordCount = ret.Count();
var list = SortAndPage<V_TB_MPO_DETAIL>(ret, Grid_V_TB_MPO_DETAIL);
Grid_V_TB_MPO_DETAIL.DataSource = list.ToList();
Grid_V_TB_MPO_DETAIL.DataBind();
});
}
protected void Grid_V_TB_PO_DETAIL_PageIndexChange(object sender, GridPageEventArgs e)
{
BindDetail();
}
protected void ddlGridPageSize_SelectedIndexChanged(object sender, EventArgs e)
{
Grid_V_TB_MPO_DETAIL.PageSize = Convert.ToInt32(ddlGridPageSize.SelectedValue);
BindDetail();
}
/// <summary>
/// 审批通过
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnAccept_Click(object sender, EventArgs e)
{
int[] selections = Grid_V_TB_MPO_DETAIL.SelectedRowIndexArray;
List<string> NOList = new List<string>();
//List<string> ctylist = new List<string>();
List<int> AcceptStatusList = new List<int>();
if (selections.Count() ==0 )
{
Alert.Show("您未选择数据进行审批");
return;
}
else
{
foreach (int rowIndex in selections)
{
NOList.Add(Grid_V_TB_MPO_DETAIL.DataKeys[rowIndex][1] as string);
//ctylist.Add(Grid_V_TB_MPO_DETAIL.DataKeys[rowIndex][4] as string);
var app = Grid_V_TB_MPO_DETAIL.DataKeys[rowIndex][3].ToString();
AcceptStatusList.Add(int.Parse(app));
}
NOList = NOList.Distinct().ToList();
//if (ctylist.Contains("D"))
//{
// Alert.Show("选择的数据包含已经作废的数据");
// return;
//}
if (AcceptStatusList.Contains((int)GeneralMaterialOrderState.Finish))
{
Alert.Show("选择的数据包含已确认的数据");
return;
}
var ret = SCP_MPO_CONTROLLER.Save_MPO_STATE(NOList, GeneralMaterialOrderState.Finish);
if (ret.State == ReturnStatus.Succeed)
{
Alert.Show("确认成功");
BindDetail();
}
else
{
Alert.Show(string.Join("<br>", ret.MessageList));
return;
}
}
}
/// <summary>
/// 取消审批
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnCancel_Click(object sender, EventArgs e)
{
int[] selections = Grid_V_TB_MPO_DETAIL.SelectedRowIndexArray;
List<string> NOList = new List<string>();
List<string> ctylist = new List<string>();
List<int> AcceptStatusList = new List<int>();
if (selections.Count() == 0)
{
Alert.Show("您未选择数据进行取消审批");
return;
}
else
{
foreach (int rowIndex in selections)
{
NOList.Add(Grid_V_TB_MPO_DETAIL.DataKeys[rowIndex][1] as string);
ctylist.Add(Grid_V_TB_MPO_DETAIL.DataKeys[rowIndex][4] as string);
AcceptStatusList.Add(int.Parse(Grid_V_TB_MPO_DETAIL.DataKeys[rowIndex][3].ToString()));
}
NOList = NOList.Distinct().ToList();
//if (ctylist.Contains("D"))
//{
// Alert.Show("选择的数据包含已经作废的数据");
// return;
//}
if (AcceptStatusList.Contains((int)GeneralMaterialOrderState.New))
{
Alert.Show("选择的数据包含新建的数据");
return;
}
var ret = SCP_MPO_CONTROLLER.Save_MPO_STATE(NOList, GeneralMaterialOrderState.New);
if (ret.State == ReturnStatus.Succeed)
{
Alert.Show("取消成功");
BindDetail();
}
else
{
Alert.Show(string.Join("<br>", ret.MessageList));
return;
}
}
}
}
}

116
SCP/Views/SupplierData/SCP_MPO_DETAIL.aspx.designer.cs

@ -0,0 +1,116 @@
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </自动生成>
//------------------------------------------------------------------------------
namespace SCP.Views.SupplierData
{
public partial class SCP_MPO_DETAIL
{
/// <summary>
/// form1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// Panel1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Panel Panel1;
/// <summary>
/// Toolbar2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Toolbar Toolbar2;
/// <summary>
/// BTN_REFRESH 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button BTN_REFRESH;
/// <summary>
/// btnAccept 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnAccept;
/// <summary>
/// btnCancel 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnCancel;
/// <summary>
/// HF_GRID_INDEX 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.HiddenField HF_GRID_INDEX;
/// <summary>
/// Grid_V_TB_MPO_DETAIL 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Grid Grid_V_TB_MPO_DETAIL;
/// <summary>
/// ToolbarSeparator1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.ToolbarSeparator ToolbarSeparator1;
/// <summary>
/// ToolbarText1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.ToolbarText ToolbarText1;
/// <summary>
/// ddlGridPageSize 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.DropDownList ddlGridPageSize;
}
}

126
SCP/Views/SupplierData/SCP_PO_MATERIAL.aspx

@ -0,0 +1,126 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SCP_PO_MATERIAL.aspx.cs" Inherits="SCP.Views.SupplierData.SCP_PO_MATERIAL" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
</head>
<body>
<form id="form1" runat="server">
<f:PageManager runat="server" AutoSizePanelID="Panel1" />
<f:Panel ID="Panel1" runat="server" Title="" Layout="VBox" BoxConfigAlign="Stretch" BoxConfigPosition="Start">
<Items>
<f:Form runat="server">
<Toolbars>
<f:Toolbar ID="Toolbar2" runat="server">
<Items>
<f:ToolbarSeparator runat="server" />
<f:Button ID="Button3" runat="server" EnablePostBack="false" Text="刷新" Icon="Reload" OnClientClick="location.reload();">
</f:Button>
<f:ToolbarSeparator runat="server" />
<f:Button ID="btnOutput" runat="server" Text="导出" Icon="PageExcel" OnClick="btnOutput_Click">
</f:Button>
<f:Button ID="btnDetail" runat="server" Text="明细" Icon="Zoom" OnClick="btnDetail_Click">
</f:Button>
<f:ToolbarSeparator runat="server" />
<f:Button ID="btnShow" runat="server" Text="显示查询面板" OnClick="btnShow_Click">
</f:Button>
<f:ToolbarSeparator runat="server" />
<f:Button ID="btnPrinter" runat="server" Text="打印" Icon="Printer" OnClick="btnPrinter_Click"></f:Button>
</Items>
</f:Toolbar>
</Toolbars>
</f:Form>
<f:GroupPanel runat="server" ID="gp1" Hidden="true" Layout="HBox">
<Items>
<f:Form runat="server">
<Rows>
<f:FormRow runat="server" ColumnWidths="20% 20% 20% 20% 20%">
<Items>
<f:TextBox runat="server" Label="订单号" EmptyText="" ID="TXT_PurdocNO" />
<f:DatePicker runat="server" Required="true" DateFormatString="yyyy-MM-dd" Label="订货日期" EmptyText="请选择日期" ID="DP_StartDate" />
<f:DatePicker runat="server" Required="true" DateFormatString="yyyy-MM-dd" Label="至" EmptyText="请选择日期" ID="DP_EndDate" />
<f:TextBox runat="server" Label="创建人" EmptyText="" ID="TXT_CreatedByDesc" />
<f:DropDownList runat="server" ID="DDL_State" Label="状态">
<f:ListItem Text="请选择状态" Value="" />
<f:ListItem Text="待确认" Value="0" />
<f:ListItem Text="供应商已确认" Value="1" />
<f:ListItem Text="作废" Value="-1" />
</f:DropDownList>
</Items>
</f:FormRow>
<f:FormRow runat="server">
<Items>
<f:Button runat="server" Text="关闭" ID="BtnClose" OnClick="BtnClose_Click"></f:Button>
<f:Button ID="BtnSearch" runat="server" OnClick="BtnSearch_Click" Text="快速查找订单">
</f:Button>
</Items>
</f:FormRow>
</Rows>
</f:Form>
</Items>
</f:GroupPanel>
<f:Grid ID="Grid_V_TB_MPO" EnableCollapse="true" ShowBorder="true" ShowHeader="true" runat="server" EnableCheckBoxSelect="true" EnableTextSelection="true"
DataKeyNames="UID,PurdocNO,BuyListStrdes,DocDate,VendorNO,VendorDesc,PurgrpDesc,AcceptStatus,ItemdeliveryDate,CreatedByDesc,CreatedBy,CreatedByPhone,Ctype,FIRSTTELNO"
CssClass="maingrid" EnableRowDoubleClickEvent="True" SortField="ApprovalStatus"
IsDatabasePaging="True" AllowPaging="True" OnRowDoubleClick="Grid_V_TB_MPO_RowDoubleClick" BoxFlex="1"
AutoScroll="True" PageSize="50" SortDirection="DESC" OnPageIndexChange="Grid_V_TB_MPO_PageIndexChange">
<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"
runat="server">
<f:ListItem Text="10" Value="10" />
<f:ListItem Text="100" Value="100" />
<f:ListItem Text="500" Value="500" />
<f:ListItem Text="1000" Value="1000" />
<f:ListItem Text="5000" Value="5000" />
<f:ListItem Text="10000" Value="10000" />
</f:DropDownList>
</PageItems>
<Columns>
<f:BoundField Width="90px" DataField="State_DESC" DataFormatString="{0}" HeaderText="状态" />
<f:BoundField Width="80px" DataField="OASTATUS" DataFormatString="{0}" HeaderText="OA状态" />
<f:BoundField Width="100px" DataField="PurdocNO" DataFormatString="{0}" HeaderText="订单号" />
<f:BoundField Width="100px" DataField="BuyListStrdes" DataFormatString="{0}" HeaderText="凭证类型" />
<f:BoundField Width="100px" SortField="DocDate" DataField="DocDate" DataFormatString="{0:yyyy-MM-dd}" HeaderText="订货日期" />
<f:BoundField Width="100px" DataField="VendorNO" DataFormatString="{0}" HeaderText="供应商编码" />
<f:BoundField Width="100px" DataField="VendorDesc" HeaderText="供应商描述" />
<f:BoundField Width="100px" DataField="PurgrpDesc" DataFormatString="{0}" HeaderText="收货人" />
<f:BoundField Width="100px" DataField="ItemdeliveryDate" DataFormatString="{0:yyyy-MM-dd}" HeaderText="交货日程日期" />
<f:BoundField Width="100px" DataField="CreatedByDesc" DataFormatString="{0}" HeaderText="创建人" />
<f:BoundField Width="100px" DataField="CreatedByPhone" DataFormatString="{0}" HeaderText="创建人电话" />
<f:BoundField Width="100px" DataField="FIRSTTELNO" DataFormatString="{0}" HeaderText="供应商联系电话" />
<f:BoundField Width="100px" DataField="CType_DESC" DataFormatString="{0}" HeaderText="是否已作废" />
</Columns>
</f:Grid>
</Items>
</f:Panel>
<f:Window runat="server" ID="Window1" Hidden="True" Height="600px" Width="1000px" AutoScroll="True" OnClose="Window1_Close" CloseAction="HidePostBack"
WindowPosition="Center" IsModal="true" Title="明细详情" Target="Parent" EnableIFrame="true"
IFrameUrl="about:blank" />
</form>
</body>
</html>

265
SCP/Views/SupplierData/SCP_PO_MATERIAL.aspx.cs

@ -0,0 +1,265 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.UI.WebControls;
using CK.SCP.Models.ScpEntity;
using CK.SCP.Controller;
using FineUI;
using System.Text;
using CK.SCP.Models.Enums;
namespace SCP.Views.SupplierData
{
public partial class SCP_PO_MATERIAL : PageBase
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
LoadData();
}
}
public void LoadData()
{
if (CurrentUser.FactoryList == null || CurrentUser.FactoryList.Count == 0)
{
Alert.Show("当前用户未选择地点");
return;
}
BindOrder();
}
public void BindOrder()
{
SearchV_TB_MPO((result) =>
{
Grid_V_TB_MPO.RecordCount = result.Count();
var list = SortAndPage<V_TB_MPO>(result, Grid_V_TB_MPO);
Grid_V_TB_MPO.DataSource = list;
Grid_V_TB_MPO.DataBind();
});
}
public void SearchV_TB_MPO(Action<IQueryable<V_TB_MPO>> p_action)
{
V_TB_MPO _entity = new V_TB_MPO();
if (this.DP_StartDate.SelectedDate != null)
{
_entity.DocDateBegin = Convert.ToDateTime(DP_StartDate.SelectedDate);
}
if (DP_EndDate.SelectedDate != null)
{
_entity.DocDateEnd = Convert.ToDateTime(DP_EndDate.SelectedDate);
}
if (!string.IsNullOrWhiteSpace(TXT_CreatedByDesc.Text))
{
_entity.CreatedBy = TXT_CreatedByDesc.Text.Trim();
}
if (!string.IsNullOrEmpty(DDL_State.SelectedValue))
{
_entity.AcceptStatusSelect = DDL_State.SelectedValue;
}
if (!string.IsNullOrWhiteSpace(TXT_PurdocNO.Text))
{
_entity.PurdocNO = TXT_PurdocNO.Text.Trim();
}
_entity.UserInVendIds = CurrentUser.VenderList;
SCP_MPO_CONTROLLER.Get_V_TB_MPO_List(_entity, (_ret) =>
{
if (_ret.State == ReturnStatus.Succeed)
{
p_action(_ret.Result);
}
});
}
protected void Grid_V_TB_MPO_RowDoubleClick(object sender, FineUI.GridRowClickEventArgs e)
{
int[] selections = Grid_V_TB_MPO.SelectedRowIndexArray;
List<string> NOList = new List<string>();
if (selections.Count() > 0)
{
foreach (int rowIndex in selections)
{
NOList.Add(Grid_V_TB_MPO.DataKeys[rowIndex][1] as string);
}
string BillNum = String.Join(",", NOList);
string url = string.Format("../SupplierData/SCP_MPO_DETAIL.aspx?PurdocNO={0}", BillNum);
PageContext.RegisterStartupScript(Window1.GetShowReference(url));
}
else
{
Alert.Show("请选择数据后再进行查看明细");
return;
}
}
protected void Grid_V_TB_MPO_PageIndexChange(object sender, FineUI.GridPageEventArgs e)
{
BindOrder();
}
/// <summary>
/// 导出
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnOutput_Click(object sender, EventArgs e)
{
int[] selections = Grid_V_TB_MPO.SelectedRowIndexArray;
List<string> NOList = new List<string>();
if (selections.Count() > 0)
{
foreach (int rowIndex in selections)
{
var ctypesta = Grid_V_TB_MPO.DataKeys[rowIndex][13] as string;
if (ctypesta == "D")
{
PageContext.RegisterStartupScript(Alert.GetShowInTopReference("选中的数据包含作废信息,请重新选择!"));
return;
}
NOList.Add(Grid_V_TB_MPO.DataKeys[rowIndex][1] as string);
}
}
else
{
PageContext.RegisterStartupScript(Alert.GetShowInTopReference("没有选择数据!"));
return;
}
NOList = NOList.Distinct().ToList();
var ret = SCP_MPO_CONTROLLER.GetMPODetailList(NOList);
Dictionary<string, string> cellheader = new Dictionary<string, string>
{
{ "PurdocNO", "订单号" },
{ "PurchaseReqNO", "申请单号" },
{ "ProposerDesc", "申请人" },
{"State_DESC","状态" },
{ "OASTATUS", "OA审批状态" },
{ "MtlNO", "物料号" },
{ "Shorttext", "物料描述" },
{ "SizeCol", "型号规格" },
{ "Matbrand", "材料牌号" },
{ "Unitdes", "单位" },
{ "Quantity", "数量" },
{ "PRICE", "价格" },
{ "NetValue", "金额" },
{ "PurinfoReCord", "采购信息" },
{ "ItemDeliveryDate", "要求到货日期" },
{ "Glaccnum", "科目" },
{ "CostCenterDes", "成本中心" },
{ "StoreLocation", "存储地点" },
{ "CType_DESC","是否已作废"},
};
string url = EntityListToExcel2003(cellheader, ret.ToList(), "一般材料采购订单明细");
}
protected void btnDetail_Click(object sender, EventArgs e)
{
int[] selections = Grid_V_TB_MPO.SelectedRowIndexArray;
List<string> NOList = new List<string>();
List<string> order = new List<string>();
if (selections.Count() > 0)
{
foreach (int rowIndex in selections)
{
NOList.Add(Grid_V_TB_MPO.DataKeys[rowIndex][1] as string);
order.Add(Grid_V_TB_MPO.DataKeys[rowIndex][12] as string);
}
if (order.Contains("D"))
{
Alert.Show("请选择未被作废的数据进行查看明细");
return;
}
string BillNum = String.Join(",", NOList);
string url = string.Format("../SupplierData/SCP_MPO_DETAIL.aspx?PurdocNO={0}", BillNum);
PageContext.RegisterStartupScript(Window1.GetShowReference(url));
}
else
{
Alert.Show("请选择数据后再进行查看明细");
return;
}
}
protected void btnShow_Click(object sender, EventArgs e)
{
gp1.Hidden = false;
}
protected void BtnClose_Click(object sender, EventArgs e)
{
gp1.Hidden = true;
}
protected void BtnSearch_Click(object sender, EventArgs e)
{
BindOrder();
}
protected void ddlGridPageSize_SelectedIndexChanged(object sender, EventArgs e)
{
Grid_V_TB_MPO.PageSize = Convert.ToInt32(ddlGridPageSize.SelectedValue);
BindOrder();
}
protected void Window1_Close(object sender, WindowCloseEventArgs e)
{
BindOrder();
}
/// <summary>
/// 打印
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnPrinter_Click(object sender, EventArgs e)
{
int[] selections = Grid_V_TB_MPO.SelectedRowIndexArray;
string PurdocNO = "";
int acc = 0;
string status = "";
if (selections.Count() == 0)
{
Alert.Show("请选择要打印的数据");
return;
}
else if (selections.Count() > 1)
{
Alert.Show("只能选择一条数据进行打印");
return;
}
else
{
foreach (int rowIndex in selections)
{
PurdocNO = Grid_V_TB_MPO.DataKeys[rowIndex][1] as string;
acc = int.Parse(Grid_V_TB_MPO.DataKeys[rowIndex][7].ToString());
status = Grid_V_TB_MPO.DataKeys[rowIndex][12] as string;
if (status =="D")
{
Alert.Show("已作废的数据不可以进行打印");
return;
}
}
if (acc == (int)GeneralMaterialOrderState.New)
{
Alert.Show("供应商确认过的数据才可以打印");
return;
}
var str = string.Format("window.open(\"../../Handlers/GenerateReport.ashx?report=GeneralMaterialOrder&data=131&type=pdf&filename=标签.pdf&PurdocNO={0}&open=\")", PurdocNO);
PageContext.RegisterStartupScript(str);
}
}
}
}

206
SCP/Views/SupplierData/SCP_PO_MATERIAL.aspx.designer.cs

@ -0,0 +1,206 @@
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </自动生成>
//------------------------------------------------------------------------------
namespace SCP.Views.SupplierData
{
public partial class SCP_PO_MATERIAL
{
/// <summary>
/// form1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// Panel1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Panel Panel1;
/// <summary>
/// Toolbar2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Toolbar Toolbar2;
/// <summary>
/// Button3 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button Button3;
/// <summary>
/// btnOutput 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnOutput;
/// <summary>
/// btnDetail 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnDetail;
/// <summary>
/// btnShow 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnShow;
/// <summary>
/// btnPrinter 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnPrinter;
/// <summary>
/// gp1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.GroupPanel gp1;
/// <summary>
/// TXT_PurdocNO 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TXT_PurdocNO;
/// <summary>
/// DP_StartDate 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.DatePicker DP_StartDate;
/// <summary>
/// DP_EndDate 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.DatePicker DP_EndDate;
/// <summary>
/// TXT_CreatedByDesc 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TXT_CreatedByDesc;
/// <summary>
/// DDL_State 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.DropDownList DDL_State;
/// <summary>
/// BtnClose 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button BtnClose;
/// <summary>
/// BtnSearch 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button BtnSearch;
/// <summary>
/// Grid_V_TB_MPO 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Grid Grid_V_TB_MPO;
/// <summary>
/// ToolbarSeparator1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.ToolbarSeparator ToolbarSeparator1;
/// <summary>
/// ToolbarText1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.ToolbarText ToolbarText1;
/// <summary>
/// ddlGridPageSize 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.DropDownList ddlGridPageSize;
/// <summary>
/// Window1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Window Window1;
}
}

75
SCP/Views/富维冲压件/SCP_MPO_DETAIL.aspx

@ -0,0 +1,75 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SCP_MPO_DETAIL.aspx.cs" Inherits="SCP.Views.富维冲压件.SCP_MPO_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" />
<title></title>
</head>
<body>
<form id="form1" runat="server">
<f:PageManager runat="server" AutoSizePanelID="Panel1" />
<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_REFRESH" runat="server" EnablePostBack="True" Text="刷新" Icon="box">
</f:Button>
<f:Button ID="btnAccept" runat="server" Text="确认订单" Icon="Accept" OnClick="btnAccept_Click" Hidden="true">
</f:Button>
<f:Button ID="btnCancel" runat="server" Text="取消订单" Icon="Cancel" OnClick="btnCancel_Click" Hidden="true">
</f:Button>
</Items>
</f:Toolbar>
</Toolbars>
<Items>
<f:HiddenField ID="HF_GRID_INDEX" runat="server"></f:HiddenField>
<f:Grid ID="Grid_V_TB_MPO_DETAIL" EnableCollapse="true" ShowBorder="true" EnableMultiSelect="true" ShowHeader="false" runat="server" EnableCheckBoxSelect="true"
DataKeyNames="UID,PurdocNO,PurchaseReqNO,AcceptStatus,Ctype"
SortField="PurdocNO" AllowSorting="true" BoxFlex="1" SortDirection="ASC"
AllowPaging="True"
IsDatabasePaging="true" PageSize="10" OnPageIndexChange="Grid_V_TB_PO_DETAIL_PageIndexChange">
<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"
runat="server">
<f:ListItem Text="10" Value="10" />
<f:ListItem Text="40" Value="40" />
<f:ListItem Text="80" Value="80" />
<f:ListItem Text="100" Value="100" />
<f:ListItem Text="200" Value="200" />
</f:DropDownList>
</PageItems>
<Columns>
<f:BoundField Width="70px" DataField="CType_DESC" DataFormatString="{0}" HeaderText="是否作废" />
<f:BoundField Width="100px" DataField="PurdocNO" HeaderText="订单号" DataFormatString="{0}"/>
<f:BoundField Width="100px" DataField="PurchaseReqNO" HeaderText="申请单号" DataFormatString="{0}"/>
<f:BoundField Width="100px" DataField="State_DESC" HeaderText="状态" DataFormatString="{0}"/>
<f:BoundField Width="80px" DataField="ProposerDesc" HeaderText="申请人" DataFormatString="{0}"/>
<f:BoundField Width="100px" DataField="MtlNO" HeaderText="物料号" DataFormatString="{0}"/>
<f:BoundField Width="150px" DataField="Shorttext" DataFormatString="{0}" HeaderText="物料描述" />
<f:BoundField Width="80px" DataField="SizeCol" DataFormatString="{0}" HeaderText="型号规格" />
<f:BoundField Width="80px" DataField="Unitdes" DataFormatString="{0}" HeaderText="单位" />
<f:BoundField Width="100px" DataField="Quantity" DataFormatString="{0:F6}" HeaderText="数量" />
<f:BoundField Width="80px" DataField="PRICE" DataFormatString="{0:F8}" HeaderText="价格" />
<f:BoundField Width="80px" DataField="NetValue" DataFormatString="{0:F8}" HeaderText="金额" />
<f:BoundField Width="100px" DataField="PurinfoReCord" DataFormatString="{0}" HeaderText="采购信息" />
<f:BoundField Width="100px" DataField="ItemDeliveryDate" DataFormatString="{0:yyyy-MM-dd}" HeaderText="要求到货日期" />
<f:BoundField Width="80px" DataField="Glaccnum" DataFormatString="{0}" HeaderText="科目" />
<f:BoundField Width="80px" DataField="CostCenterDes" DataFormatString="{0}" HeaderText="成本中心" />
<f:BoundField Width="80px" DataField="StoreLocation" DataFormatString="{0}" HeaderText="存储地点" />
<f:BoundField Width="80px" DataField="AcceptStatus" DataFormatString="{0}" Hidden="true" />
</Columns>
</f:Grid>
</Items>
</f:Panel>
</form>
</body>
</html>

175
SCP/Views/富维冲压件/SCP_MPO_DETAIL.aspx.cs

@ -0,0 +1,175 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.UI.WebControls;
using CK.SCP.Models.ScpEntity;
using CK.SCP.Controller;
using FineUI;
using CK.SCP.Models.Enums;
namespace SCP.Views.
{
public partial class SCP_MPO_DETAIL : PageBase
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
if (!string.IsNullOrEmpty(Request["PurdocNO"]))
{
BindDetail();
}
else
{
Alert.Show("请选择数据后再查看明细!");
return;
}
}
}
public void SearchV_TB_PO_DETAIL(Action<IQueryable<V_TB_MPO_DETAIL>> p_action)
{
V_TB_MPO_DETAIL _entity = new V_TB_MPO_DETAIL();
string purdocnolist =Request["PurdocNO"];
_entity.purdocnolist = purdocnolist.Split(',').ToList();
SCP_MPO_CONTROLLER.Get_V_TB_MPO_DETAIL_List(_entity,(_ret)=> {
if (_ret.State == ReturnStatus.Succeed)
{
p_action(_ret.Result);
}
});
}
public void BindDetail()
{
if (CurrentUser.RoleList.Contains("供应商"))
{
//确认订单
btnAccept.Hidden = false;
btnCancel.Hidden = false;
}
SearchV_TB_PO_DETAIL((ret)=>{
this.Grid_V_TB_MPO_DETAIL.RecordCount = ret.Count();
var list = SortAndPage<V_TB_MPO_DETAIL>(ret, Grid_V_TB_MPO_DETAIL);
Grid_V_TB_MPO_DETAIL.DataSource = list.ToList();
Grid_V_TB_MPO_DETAIL.DataBind();
});
}
protected void Grid_V_TB_PO_DETAIL_PageIndexChange(object sender, GridPageEventArgs e)
{
BindDetail();
}
protected void ddlGridPageSize_SelectedIndexChanged(object sender, EventArgs e)
{
Grid_V_TB_MPO_DETAIL.PageSize = Convert.ToInt32(ddlGridPageSize.SelectedValue);
BindDetail();
}
/// <summary>
/// 审批通过
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnAccept_Click(object sender, EventArgs e)
{
int[] selections = Grid_V_TB_MPO_DETAIL.SelectedRowIndexArray;
List<string> NOList = new List<string>();
//List<string> ctylist = new List<string>();
List<int> AcceptStatusList = new List<int>();
if (selections.Count() ==0 )
{
Alert.Show("您未选择数据进行审批");
return;
}
else
{
foreach (int rowIndex in selections)
{
NOList.Add(Grid_V_TB_MPO_DETAIL.DataKeys[rowIndex][1] as string);
//ctylist.Add(Grid_V_TB_MPO_DETAIL.DataKeys[rowIndex][4] as string);
var app = Grid_V_TB_MPO_DETAIL.DataKeys[rowIndex][3].ToString();
AcceptStatusList.Add(int.Parse(app));
}
NOList = NOList.Distinct().ToList();
//if (ctylist.Contains("D"))
//{
// Alert.Show("选择的数据包含已经作废的数据");
// return;
//}
if (AcceptStatusList.Contains((int)GeneralMaterialOrderState.Finish))
{
Alert.Show("选择的数据包含已确认的数据");
return;
}
var ret = SCP_MPO_CONTROLLER.Save_MPO_STATE(NOList, GeneralMaterialOrderState.Finish);
if (ret.State == ReturnStatus.Succeed)
{
Alert.Show("确认成功");
BindDetail();
}
else
{
Alert.Show(string.Join("<br>", ret.MessageList));
return;
}
}
}
/// <summary>
/// 取消审批
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnCancel_Click(object sender, EventArgs e)
{
int[] selections = Grid_V_TB_MPO_DETAIL.SelectedRowIndexArray;
List<string> NOList = new List<string>();
List<string> ctylist = new List<string>();
List<int> AcceptStatusList = new List<int>();
if (selections.Count() == 0)
{
Alert.Show("您未选择数据进行取消审批");
return;
}
else
{
foreach (int rowIndex in selections)
{
NOList.Add(Grid_V_TB_MPO_DETAIL.DataKeys[rowIndex][1] as string);
ctylist.Add(Grid_V_TB_MPO_DETAIL.DataKeys[rowIndex][4] as string);
AcceptStatusList.Add(int.Parse(Grid_V_TB_MPO_DETAIL.DataKeys[rowIndex][3].ToString()));
}
NOList = NOList.Distinct().ToList();
if (ctylist.Contains("D"))
{
Alert.Show("选择的数据包含已经作废的数据");
return;
}
if (AcceptStatusList.Contains((int)GeneralMaterialOrderState.New))
{
Alert.Show("选择的数据包含新建的数据");
return;
}
var ret = SCP_MPO_CONTROLLER.Save_MPO_STATE(NOList, GeneralMaterialOrderState.New);
if (ret.State == ReturnStatus.Succeed)
{
Alert.Show("取消成功");
BindDetail();
}
else
{
Alert.Show(string.Join("<br>", ret.MessageList));
return;
}
}
}
}
}

116
SCP/Views/富维冲压件/SCP_MPO_DETAIL.aspx.designer.cs

@ -0,0 +1,116 @@
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </自动生成>
//------------------------------------------------------------------------------
namespace SCP.Views.
{
public partial class SCP_MPO_DETAIL
{
/// <summary>
/// form1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// Panel1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Panel Panel1;
/// <summary>
/// Toolbar2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Toolbar Toolbar2;
/// <summary>
/// BTN_REFRESH 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button BTN_REFRESH;
/// <summary>
/// btnAccept 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnAccept;
/// <summary>
/// btnCancel 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnCancel;
/// <summary>
/// HF_GRID_INDEX 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.HiddenField HF_GRID_INDEX;
/// <summary>
/// Grid_V_TB_MPO_DETAIL 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Grid Grid_V_TB_MPO_DETAIL;
/// <summary>
/// ToolbarSeparator1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.ToolbarSeparator ToolbarSeparator1;
/// <summary>
/// ToolbarText1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.ToolbarText ToolbarText1;
/// <summary>
/// ddlGridPageSize 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.DropDownList ddlGridPageSize;
}
}

119
SCP/Views/富维冲压件/SCP_PO_MATERIAL.aspx

@ -0,0 +1,119 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SCP_PO_MATERIAL.aspx.cs" Inherits="SCP.Views.富维冲压件.SCP_PO_MATERIAL" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
</head>
<body>
<form id="form1" runat="server">
<f:PageManager runat="server" AutoSizePanelID="Panel1" />
<f:Panel ID="Panel1" runat="server" Title="" Layout="VBox" BoxConfigAlign="Stretch" BoxConfigPosition="Start">
<Items>
<f:Form runat="server">
<Toolbars>
<f:Toolbar ID="Toolbar2" runat="server">
<Items>
<f:ToolbarSeparator runat="server" />
<f:Button ID="Button3" runat="server" EnablePostBack="false" Text="刷新" Icon="Reload" OnClientClick="location.reload();">
</f:Button>
<f:ToolbarSeparator runat="server" />
<f:Button ID="btnOutput" runat="server" Text="导出" Icon="PageExcel" OnClick="btnOutput_Click">
</f:Button>
<f:Button ID="btnDetail" runat="server" Text="明细" Icon="Zoom" OnClick="btnDetail_Click">
</f:Button>
<f:ToolbarSeparator runat="server" />
<f:Button ID="btnShow" runat="server" Text="显示查询面板" OnClick="btnShow_Click">
</f:Button>
<f:ToolbarSeparator runat="server" />
<f:Button ID="btnPrinter" runat="server" Text="打印" Icon="Printer" OnClick="btnPrinter_Click" Hidden="true"></f:Button>
</Items>
</f:Toolbar>
</Toolbars>
</f:Form>
<f:GroupPanel runat="server" ID="gp1" Hidden="true" Layout="HBox">
<Items>
<f:Form runat="server">
<Rows>
<f:FormRow runat="server" ColumnWidths="25% 25% 25% 25%">
<Items>
<f:TextBox runat="server" Label="订单号" EmptyText="" ID="TXT_PurdocNO" />
<f:DatePicker runat="server" Required="true" DateFormatString="yyyy-MM-dd" Label="订货日期" EmptyText="请选择日期" ID="DP_StartDate" />
<f:DatePicker runat="server" Required="true" DateFormatString="yyyy-MM-dd" Label="至" EmptyText="请选择日期" ID="DP_EndDate" />
</Items>
</f:FormRow>
<f:FormRow runat="server">
<Items>
<f:Button runat="server" Text="关闭" ID="BtnClose" OnClick="BtnClose_Click"></f:Button>
<f:Button ID="BtnSearch" runat="server" OnClick="BtnSearch_Click" Text="快速查找订单">
</f:Button>
</Items>
</f:FormRow>
</Rows>
</f:Form>
</Items>
</f:GroupPanel>
<f:Grid ID="Grid_V_TB_MPO" EnableCollapse="true" ShowBorder="true" ShowHeader="true" runat="server" EnableCheckBoxSelect="true" EnableTextSelection="true"
DataKeyNames="UID,PurdocNO,BuyListStrdes,DocDate,VendorNO,VendorDesc,PurgrpDesc,AcceptStatus,ItemdeliveryDate,CreatedByDesc,CreatedBy,CreatedByPhone,Ctype,FIRSTTELNO"
CssClass="maingrid" EnableRowDoubleClickEvent="True" SortField="ApprovalStatus"
IsDatabasePaging="True" AllowPaging="True" OnRowDoubleClick="Grid_V_TB_MPO_RowDoubleClick" BoxFlex="1"
AutoScroll="True" PageSize="50" SortDirection="DESC" OnPageIndexChange="Grid_V_TB_MPO_PageIndexChange">
<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"
runat="server">
<f:ListItem Text="10" Value="10" />
<f:ListItem Text="100" Value="100" />
<f:ListItem Text="500" Value="500" />
<f:ListItem Text="1000" Value="1000" />
<f:ListItem Text="5000" Value="5000" />
<f:ListItem Text="10000" Value="10000" />
</f:DropDownList>
</PageItems>
<Columns>
<f:BoundField Width="90px" DataField="State_DESC" DataFormatString="{0}" HeaderText="状态" />
<f:BoundField Width="80px" DataField="OASTATUS" DataFormatString="{0}" HeaderText="OA状态" />
<f:BoundField Width="100px" DataField="PurdocNO" DataFormatString="{0}" HeaderText="订单号" />
<f:BoundField Width="100px" DataField="BuyListStrdes" DataFormatString="{0}" HeaderText="凭证类型" />
<f:BoundField Width="100px" SortField="DocDate" DataField="DocDate" DataFormatString="{0:yyyy-MM-dd}" HeaderText="订货日期" />
<f:BoundField Width="100px" DataField="VendorNO" DataFormatString="{0}" HeaderText="供应商编码" />
<f:BoundField Width="100px" DataField="VendorDesc" HeaderText="供应商描述" />
<f:BoundField Width="100px" DataField="PurgrpDesc" DataFormatString="{0}" HeaderText="收货人" />
<f:BoundField Width="100px" DataField="ItemdeliveryDate" DataFormatString="{0:yyyy-MM-dd}" HeaderText="交货日程日期" />
<f:BoundField Width="100px" DataField="CreatedByDesc" DataFormatString="{0}" HeaderText="创建人" />
<f:BoundField Width="100px" DataField="CreatedByPhone" DataFormatString="{0}" HeaderText="创建人电话" />
<f:BoundField Width="100px" DataField="FIRSTTELNO" DataFormatString="{0}" HeaderText="供应商联系电话" />
<f:BoundField Width="100px" DataField="CType_DESC" DataFormatString="{0}" HeaderText="是否已作废" />
</Columns>
</f:Grid>
</Items>
</f:Panel>
<f:Window runat="server" ID="Window1" Hidden="True" Height="600px" Width="1000px" AutoScroll="True" OnClose="Window1_Close" CloseAction="HidePostBack"
WindowPosition="Center" IsModal="true" Title="明细详情" Target="Parent" EnableIFrame="true"
IFrameUrl="about:blank" />
</form>
</body>
</html>

249
SCP/Views/富维冲压件/SCP_PO_MATERIAL.aspx.cs

@ -0,0 +1,249 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.UI.WebControls;
using CK.SCP.Models.ScpEntity;
using CK.SCP.Controller;
using FineUI;
using System.Text;
using CK.SCP.Models.Enums;
namespace SCP.Views.
{
public partial class SCP_PO_MATERIAL : PageBase
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
LoadData();
}
}
public void LoadData()
{
if (CurrentUser.RoleList.Contains("供应商"))
{
btnPrinter.Hidden = false;
}
if (CurrentUser.FactoryList == null || CurrentUser.FactoryList.Count == 0)
{
Alert.Show("当前用户未选择地点");
return;
}
BindOrder();
}
public void BindOrder()
{
SearchV_TB_MPO((result) =>
{
Grid_V_TB_MPO.RecordCount = result.Count();
var list = SortAndPage<V_TB_MPO>(result, Grid_V_TB_MPO);
Grid_V_TB_MPO.DataSource = list;
Grid_V_TB_MPO.DataBind();
});
}
public void SearchV_TB_MPO(Action<IQueryable<V_TB_MPO>> p_action)
{
V_TB_MPO _entity = new V_TB_MPO();
if (this.DP_StartDate.SelectedDate != null)
{
_entity.DocDateBegin = Convert.ToDateTime(DP_StartDate.SelectedDate);
}
if (DP_EndDate.SelectedDate != null)
{
_entity.DocDateEnd = Convert.ToDateTime(DP_EndDate.SelectedDate);
}
_entity.PurdocNO = TXT_PurdocNO.Text;
_entity.UserInVendIds = CurrentUser.VenderList;
SCP_MPO_CONTROLLER.Get_V_TB_MPO_List(_entity, (_ret) =>
{
if (_ret.State == ReturnStatus.Succeed)
{
p_action(_ret.Result);
}
});
}
protected void Grid_V_TB_MPO_RowDoubleClick(object sender, FineUI.GridRowClickEventArgs e)
{
int[] selections = Grid_V_TB_MPO.SelectedRowIndexArray;
List<string> NOList = new List<string>();
if (selections.Count() > 0)
{
foreach (int rowIndex in selections)
{
NOList.Add(Grid_V_TB_MPO.DataKeys[rowIndex][1] as string);
}
string BillNum = String.Join(",", NOList);
string url = string.Format("../富维冲压件/SCP_MPO_DETAIL.aspx?PurdocNO={0}", BillNum);
PageContext.RegisterStartupScript(Window1.GetShowReference(url));
}
else
{
Alert.Show("请选择数据后再进行查看明细");
return;
}
}
protected void Grid_V_TB_MPO_PageIndexChange(object sender, FineUI.GridPageEventArgs e)
{
BindOrder();
}
/// <summary>
/// 导出
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnOutput_Click(object sender, EventArgs e)
{
int[] selections = Grid_V_TB_MPO.SelectedRowIndexArray;
List<string> NOList = new List<string>();
if (selections.Count() > 0)
{
foreach (int rowIndex in selections)
{
var ctypesta = Grid_V_TB_MPO.DataKeys[rowIndex][13] as string;
if (ctypesta == "D")
{
PageContext.RegisterStartupScript(Alert.GetShowInTopReference("选中的数据包含作废信息,请重新选择!"));
return;
}
NOList.Add(Grid_V_TB_MPO.DataKeys[rowIndex][1] as string);
}
}
else
{
PageContext.RegisterStartupScript(Alert.GetShowInTopReference("没有选择数据!"));
return;
}
NOList = NOList.Distinct().ToList();
var ret = SCP_MPO_CONTROLLER.GetMPODetailList(NOList);
Dictionary<string, string> cellheader = new Dictionary<string, string>
{
{ "PurdocNO", "订单号" },
{ "PurchaseReqNO", "申请单号" },
{ "ProposerDesc", "申请人" },
{ "OASTATUS", "OA审批状态" },
{ "MtlNO", "物料号" },
{ "Shorttext", "物料描述" },
{ "SizeCol", "型号规格" },
{ "Matbrand", "材料牌号" },
{ "Unitdes", "单位" },
{ "Quantity", "数量" },
{ "PRICE", "价格" },
{ "NetValue", "金额" },
{ "PurinfoReCord", "采购信息" },
{ "ItemDeliveryDate", "要求到货日期" },
{ "Glaccnum", "科目" },
{ "CostCenterDes", "成本中心" },
{ "StoreLocation", "存储地点" },
};
string url = EntityListToExcel2003(cellheader, ret.ToList(), "一般材料采购订单明细");
}
protected void btnDetail_Click(object sender, EventArgs e)
{
int[] selections = Grid_V_TB_MPO.SelectedRowIndexArray;
List<string> NOList = new List<string>();
if (selections.Count() > 0)
{
foreach (int rowIndex in selections)
{
NOList.Add(Grid_V_TB_MPO.DataKeys[rowIndex][1] as string);
}
string BillNum = String.Join(",", NOList);
string url = string.Format("../富维冲压件/SCP_MPO_DETAIL.aspx?PurdocNO={0}", BillNum);
PageContext.RegisterStartupScript(Window1.GetShowReference(url));
}
else
{
Alert.Show("请选择数据后再进行查看明细");
return;
}
}
protected void btnShow_Click(object sender, EventArgs e)
{
gp1.Hidden = false;
}
protected void BtnClose_Click(object sender, EventArgs e)
{
gp1.Hidden = true;
}
protected void BtnSearch_Click(object sender, EventArgs e)
{
BindOrder();
}
protected void ddlGridPageSize_SelectedIndexChanged(object sender, EventArgs e)
{
Grid_V_TB_MPO.PageSize = Convert.ToInt32(ddlGridPageSize.SelectedValue);
BindOrder();
}
protected void Window1_Close(object sender, WindowCloseEventArgs e)
{
BindOrder();
}
/// <summary>
/// 打印
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnPrinter_Click(object sender, EventArgs e)
{
int[] selections = Grid_V_TB_MPO.SelectedRowIndexArray;
string PurdocNO = "";
int acc = 0;
string status = "";
if (selections.Count() == 0)
{
Alert.Show("请选择要打印的数据");
return;
}
else if (selections.Count() > 1)
{
Alert.Show("只能选择一条数据进行打印");
return;
}
else
{
foreach (int rowIndex in selections)
{
PurdocNO = Grid_V_TB_MPO.DataKeys[rowIndex][1] as string;
acc = int.Parse(Grid_V_TB_MPO.DataKeys[rowIndex][7].ToString());
status = Grid_V_TB_MPO.DataKeys[rowIndex][12] as string;
if (status =="D")
{
Alert.Show("已作废的数据不可以进行打印");
return;
}
}
if (acc == (int)GeneralMaterialOrderState.New)
{
Alert.Show("供应商确认过的数据才可以打印");
return;
}
var str = string.Format("window.open(\"../../Handlers/GenerateReport.ashx?report=GeneralMaterialOrder&data=131&type=pdf&filename=标签.pdf&PurdocNO={0}&open=\")", PurdocNO);
PageContext.RegisterStartupScript(str);
}
}
}
}

188
SCP/Views/富维冲压件/SCP_PO_MATERIAL.aspx.designer.cs

@ -0,0 +1,188 @@
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </自动生成>
//------------------------------------------------------------------------------
namespace SCP.Views.
{
public partial class SCP_PO_MATERIAL
{
/// <summary>
/// form1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// Panel1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Panel Panel1;
/// <summary>
/// Toolbar2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Toolbar Toolbar2;
/// <summary>
/// Button3 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button Button3;
/// <summary>
/// btnOutput 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnOutput;
/// <summary>
/// btnDetail 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnDetail;
/// <summary>
/// btnShow 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnShow;
/// <summary>
/// btnPrinter 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnPrinter;
/// <summary>
/// gp1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.GroupPanel gp1;
/// <summary>
/// TXT_PurdocNO 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TXT_PurdocNO;
/// <summary>
/// DP_StartDate 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.DatePicker DP_StartDate;
/// <summary>
/// DP_EndDate 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.DatePicker DP_EndDate;
/// <summary>
/// BtnClose 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button BtnClose;
/// <summary>
/// BtnSearch 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button BtnSearch;
/// <summary>
/// Grid_V_TB_MPO 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Grid Grid_V_TB_MPO;
/// <summary>
/// ToolbarSeparator1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.ToolbarSeparator ToolbarSeparator1;
/// <summary>
/// ToolbarText1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.ToolbarText ToolbarText1;
/// <summary>
/// ddlGridPageSize 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.DropDownList ddlGridPageSize;
/// <summary>
/// Window1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Window Window1;
}
}

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>

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

@ -1,62 +1,71 @@
<%@ 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 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 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"
>
<f:Grid ID="Grid_V_TB_PO_SUBDETAIL" Title="大订单明细" BoxFlex="1" ShowBorder="True" ShowHeader="True" AllowCellEditing="True" ClicksToEdit="1" EnableCheckBoxSelect="true"
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="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="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="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: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"/>
<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>
@ -64,7 +73,7 @@
</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" />
@ -73,13 +82,6 @@
</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>
</form>

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

@ -20,7 +20,7 @@ namespace SCP.Views.富维冲压件
{
if (CurrentUser.RoleList.Contains("期货合同"))
{
Btn_Save.Hidden = false;
//Btn_Save.Hidden = false;
Button1.Hidden = false;
}
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))
{
@ -85,7 +86,6 @@ namespace SCP.Views.富维冲压件
}
}
Grid_V_TB_PO_SUBDETAIL.DataSource = _ls;
Grid_V_TB_PO_SUBDETAIL.DataBind();
@ -131,7 +131,6 @@ namespace SCP.Views.富维冲压件
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>

11
UniApiGroup/App.config

@ -5,11 +5,12 @@
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --></configSections>
<appSettings>
<add key="MailSender" value="scp@jinhengairbag.com" />
<add key="MailServer" value="smtp.qiye.aliyun.com" />
<add key="MailUserName" value="scp@jinhengairbag.com" />
<add key="MailPassword" value="SCPscp2020" />
<add key="MailPort" value="25" />
<add key="MailSender" value="scp_1@jinhengsafety.com"/>
<add key="MailServer" value="smtp.qiye.aliyun.com"/>
<add key="MailUserName" value="scp_1@jinhengsafety.com"/>
<add key="MailPassword" value="Jh@123789"/>
<add key="MailPort" value="25"/>
<add key="ResetPassWord" value="61.161.175.186:55556" />
</appSettings>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />

1
UniApiGroup/Config/DurationConfig.cs

@ -12,5 +12,6 @@
public int CqBmptMES接口 { get; set; } = 300;
public int CqBmptEdiPut接口 { get; set; } = 600;
public int CqBmptEdiGet接口 { get; set; } = 600;
public int { get; set; } = 1800;
}
}

1
UniApiGroup/Config/UniApiConfig.cs

@ -24,5 +24,6 @@
public bool Wms库存质量 { get; set; } = true;
public bool Wms评审单 { get; set; } = true;
public bool Qad材料订单 { get; set; } = true;
}
}

48
UniApiGroup/Controller/MailController.cs

@ -5,6 +5,7 @@ using CK.SCP.Models.AppBoxEntity;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Entity.Migrations;
using System.Linq;
using System.Reflection;
using System.Text;
@ -175,5 +176,52 @@ namespace CK.SCP.UniApi.Controller
sb.Append("</body></html>");
return sb.ToString();
}
/// <summary>
/// 发送材料订单邮件
/// </summary>
public static void SendOrderMail()
{
ScpEntities SDB = EntitiesFactory.CreateScpInstance();
var emailList = SDB.TS_Email.Where(q => q.EmailSendState == 0).ToList();
try
{
foreach (var item in emailList)
{
try
{
MailManager.SendMailOrders(item.EmailAddress, item.EmailString, "材料订单提醒");
Console.WriteLine($"发送邮件:供应商为{ item.EmailToUser}");
item.EmailSendState = 1;
item.UpdateTime = DateTime.Now.ToString();
}
catch (Exception ex)
{
item.EmailSendState = 2;
item.EmailSendFailReason = ex.Message;
continue;
}
}
SDB.TS_Email.AddOrUpdate(q => q.UID, emailList.ToArray());
SDB.SaveChanges();
}
catch(Exception ex)
{
//emailList.ForEach(q =>
//{
// q.EmailSendState = 2;
// q.EmailSendFailReason = ex.Message;
//});
Console.WriteLine(ex.Message);
if (ex.InnerException != null)
{
Console.WriteLine(ex.InnerException.Message);
}
//SDB.TS_Email.AddOrUpdate(q => q.UID, emailList.ToArray());
//SDB.SaveChanges();
}
}
}
}

382
UniApiGroup/Controller/OdbcApiQadController.cs

@ -28,6 +28,11 @@ using static CK.SCP.UniApi.Controller.Vendercontroller;
using static CK.SCP.UniApi.Controller.vendidpartcontroller;
using static CK.SCP.UniApi.Controller.PoBillNumcontroller;
using static CK.SCP.UniApi.Controller.NetPriceController;
using System.Xml.Linq;
using System.Security.Principal;
using System.Diagnostics;
using Z.BulkOperations.Internal.InformationSchema;
using System.Collections;
namespace CK.SCP.GrupUniApi.Controller
{
@ -142,6 +147,15 @@ namespace CK.SCP.GrupUniApi.Controller
else
continue;
break;
case "GeneralMaterialOrder": //材料订单
if (GlobalVar.ApiConfig.Qad材料订单)
{
GeneralMaterialOrder(idb, wdb, qadCtrl, authdb);
EntitiesFactory.SaveDb(wdb);
}
else
continue;
break;
}
@ -790,20 +804,25 @@ namespace CK.SCP.GrupUniApi.Controller
var FATCTORY = wdb.TB_FACTORY.FirstOrDefault();
DataTable b = PoBillNumcontroller.GetInvBatchStock(a, FATCTORY.FactoryId);
List<PURStockBill> list = ChangKeTec.Utils.ListHelper.DataTableToList<PURStockBill>(b);
if (list.Count() == 0)
{
Console.WriteLine("更新 ERP采购订单 数据:" + "无数据");
return;
}
var wmsPoList = new List<TB_PO>();
var wmsPoDetailList = new List<TB_PO_DETAIL>();
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 _li = Dlist.GroupBy(p => p.purDocNO);
foreach (var _lii in _li)
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)
{
var _liii = _lii.ToList();
var _entity = _liii.First();
//var _liii = _lii.ToList();
//var _entity = _liii.First();
// 根据 零件号作废
var askdetaill = wdb.TB_ASK_DETAIL.Where(p => p.PoBillNum == _entity.purDocNO && p.PartCode == _entity.mtlNO).ToList();
var askdetaill = wdb.TB_ASK_DETAIL.Where(p => p.PoBillNum == _lii.purDocNO && p.PartCode == _lii.mtlNO).ToList();
askdetaill.ForEach(p =>
{
p.State = -1;
@ -916,7 +935,6 @@ namespace CK.SCP.GrupUniApi.Controller
var maxlist1 = new xxDiMaxes_Po
{
Di_Batchno = qadPoNbr.DI_BATCHNO,
};
xxMaxbath.Add(maxlist1);
@ -1437,8 +1455,10 @@ namespace CK.SCP.GrupUniApi.Controller
wmsData.VendType = qadData.providerType.ToUpper().ToString();
wmsData.Country = qadData.country;
wmsData.Phone = qadData.firstTelNO;
wmsData.Fax = qadData.FAXNUMBER;
wmsData.Fax = qadData.FAXNUMBER;//传真
wmsData.Site = ScpCache.Config.QAD域;
wmsData.Address = qadData.COMMUADDRESS;// 地址
wmsData.Contacter = qadData.RESPONSIBLESALESPERSON;//联系人
wmsDataList.Add(wmsData);
item.Remark = ((int)UniApiState.).ToString();
// item.MaxdibatchNO = Convert.ToInt32(qadData.DI_BATCHNO);
@ -1568,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)
@ -1600,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)
@ -1611,10 +1642,341 @@ 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}");
}
/// <summary>
/// 材料订单
/// </summary>
/// <param name="idb"></param>
/// <param name="sdb"></param>
/// <param name="item"></param>
/// <param name="authdb"></param>
private static void GeneralMaterialOrder(UniApiEntities idb, ScpEntities sdb, xxerp_MaxbatchNO item, AppBoxContext authdb)
{
try
{
DateTime time = DateTime.Now.AddMonths(-12);
var hisList = new List<xxDiMaxes_Order>();
hisList = idb.xxDiMaxes_Order.Where(q => q.CREATEDDATE > time).ToList();
// 读取一年内 所有审批完的一般材料订单
DataTable b = GetGeneralMaterialOrder();
List<GeneralMaterialOrder> orderlist = GetTableToList<GeneralMaterialOrder>(b);
List<xxDiMaxes_Order>maxes_Orders = GetTableToList<xxDiMaxes_Order>(b);
// 取历史表不存在的数据
var expectedList = maxes_Orders.Where(x=> !hisList.Any(e=>e.DI_BATCHNO == x.DI_BATCHNO && e.PURDOCNO == x.PURDOCNO && e.PURDOCITEMNO ==x.PURDOCITEMNO)).ToList();
if (expectedList.Count() == 0)
{
return;
}
List<GeneralMaterialOrder> list = new List<GeneralMaterialOrder>();
//取差集
foreach (var exitem in expectedList)
{
var selectList = orderlist.Where(q => q.PURDOCNO == exitem.PURDOCNO && q.DI_BATCHNO == exitem.DI_BATCHNO && q.PURDOCITEMNO == exitem.PURDOCITEMNO).ToList();
list.AddRange(selectList);
}
var PoList = new List<TB_MATERIALORDERS>();
var PoDetailList = new List<TB_MATERIALORDERS_DETAIL>();
var InPoList = new List<TB_MATERIALORDERS>();
var InPoDetailList = new List<TB_MATERIALORDERS_DETAIL>();
var xxMaxbath = new List<xxDiMaxes_Order>();
var emails = new List<TS_Email>();
var Dlist = list.Where(p => p.DI_OPERTYPE == "D").GroupBy(p => p.PURDOCNO).Distinct();// 按照订单号分组去重
var Ilist = list.Where(p => p.DI_OPERTYPE == "I").GroupBy(p => p.PURDOCNO).Distinct();// 按照订单号分组去重
string wwadres = "";
var config = sdb.TA_CONFIG.FirstOrDefault(q => q.ParamName == "接口邮件网址");
if (config != null)
{
wwadres = config.ParamValue;
}
if (Dlist.Count()>0)
{
// 作废
#region
foreach (var DeleteItem in Dlist)
{
var _list = DeleteItem.ToList();
var _entity = _list.First();
var MATERIALORDERDETAILList = sdb.TB_MATERIALORDERS_DETAIL.Where(q => q.PurdocNO == _entity.PURDOCNO).ToList();
foreach (var Ditem in _list)
{
if (MATERIALORDERDETAILList.Count() == 0)
{
continue;
}
// 根据行号 将子表数据变为作废状态
MATERIALORDERDETAILList.ForEach(p =>
{
if (p.PURDOCITEMNO == Ditem.PURDOCITEMNO)
{
p.Ctype = Ditem.DI_OPERTYPE;
p.AcceptStatus = (int)GeneralMaterialOrderState.Cancel;
PoDetailList.Add(p);
#region
// 添加发邮件数据
TS_Email email = new TS_Email();
email.EmailToUser = Ditem.VENDORDESC;
string mailbody = "";
mailbody += "尊敬的 供应商<br>";
mailbody += "你好!<br><br>";
mailbody += "一般材料订单 <b>" + Ditem.PURDOCNO + "</b>" + "<b> 行号" + p.PURDOCITEMNO + "</b> 进行了物料行作废的操作,请登录供应商协同网站进行订单查看。<br>";
mailbody += "登录账号:<b>" + Ditem.VENDORNO + "@W21" + "</b><br>";
mailbody += "登录地址:" + wwadres + "<br><br>";
mailbody += "<br><br><br><br>日期:" + DateTime.Now;
email.EmailString = mailbody;
string VENDname = Ditem.VENDORNO + "@W21";
var user = authdb.Users.FirstOrDefault(q => q.Name == VENDname);
if (user == null)
{
email.EmailSendState = 2;
email.EmailSendFailReason = "该供应商邮箱未维护";
}
else
{
email.EmailAddress = user.Email;
email.EmailSendState = 0;
}
emails.Add(email);
#endregion
}
});
var valueType = MATERIALORDERDETAILList.Select(q => q.Ctype).Distinct().ToList();
var type = valueType.FirstOrDefault();
// 子表全是d并且唯一 更新主表
if (valueType.Count() == 1 && type == "D")
{
var MATERIALORDERList = sdb.TB_MATERIALORDERS.Where(q => q.PurdocNO == Ditem.PURDOCNO).ToList();
MATERIALORDERList.ForEach(p =>
{
p.AcceptStatus = (int)GeneralMaterialOrderState.Cancel;
p.Ctype = "D";
PoList.Add(p);
});
// 主表变状态 现改成不发邮件
#region
//// 添加发邮件数据
//TS_Email email = new TS_Email();
//email.EmailToUser = Ditem.VENDORDESC;
//string mailbody = "";
//mailbody += "尊敬的 供应商<br>";
//mailbody += "你好!<br><br>";
//mailbody += "一般材料订单 <b>" + Ditem.PURDOCNO + "</b> 进行了物料行作废的操作,请登录供应商协同网站进行订单查看。<br>";
//mailbody += "登录账号:<b>" + Ditem.VENDORNO + "@W21" + "</b><br>";
//mailbody += "登录地址:" + wwadres + "<br><br>";
//mailbody += "<br><br><br><br>日期:" + DateTime.Now;
//email.EmailString = mailbody;
//var user = authdb.Users.FirstOrDefault(q => q.Name.Contains(Ditem.VENDORNO));
//if (user == null)
//{
// email.EmailSendState = 2;
// email.EmailSendFailReason = "该供应商邮箱未维护";
//}
//else
//{
// email.EmailAddress = user.Email;
// email.EmailSendState = 0;
//}
//emails.Add(email);
#endregion
}
else //否则将主表变成新建状态
{
var MATERIALORDERList = sdb.TB_MATERIALORDERS.Where(q => q.PurdocNO == Ditem.PURDOCNO).ToList();
MATERIALORDERList.ForEach(p =>
{
p.Ctype = "N";
p.AcceptStatus = (int)GeneralMaterialOrderState.New;
PoList.Add(p);
});
}
var maxlist1 = new xxDiMaxes_Order
{
DI_BATCHNO = Ditem.DI_BATCHNO,
PURDOCNO = Ditem.PURDOCNO,
PURDOCITEMNO = Ditem.PURDOCITEMNO,
CREATEDDATE = Ditem.CREATEDDATE,
};
xxMaxbath.Add(maxlist1);
}
var itemnolist = _list.Select(q => q.PURDOCITEMNO).ToList();
foreach (var Mitem in MATERIALORDERDETAILList)
{
//子表不包含的变成新建状态
if (!itemnolist.Contains(Mitem.PURDOCITEMNO))
{
Mitem.Ctype = "N";
Mitem.AcceptStatus = (int)GeneralMaterialOrderState.New;
PoDetailList.Add(Mitem);
}
}
}
#endregion
}
if (Ilist.Count()>0)
{
// 新增
#region
foreach (var InsertItem in Ilist)
{
var inlist = InsertItem.ToList();
var inentity = inlist.First();
#region 添加主子表数据
TB_MATERIALORDERS order = new TB_MATERIALORDERS();
order.PurdocNO = inentity.PURDOCNO;
order.BuyListStrdes = inentity.BUYLISTSTRDES;
order.DocDate = inentity.DOCDATE != null ? (DateTime)inentity.DOCDATE : DateTime.Now;
order.VendorNO = inentity.VENDORNO;
order.VendorDesc = inentity.VENDORDESC;
order.PurgrpDesc = inentity.PURGRPDESC;
order.ApprovalStatus = inentity.APPROVALSTATUS;
order.ItemdeliveryDate = inentity.ITEMDELIVERYDATE != null ? (DateTime)inentity.ITEMDELIVERYDATE : DateTime.Now;
order.CreatedByDesc = inentity.CREATEDBYDESC;
order.CreatedBy = inentity.CREATEDBY;
order.Ctype = "new";
order.FIRSTTELNO = inentity.FIRSTTELNO;
order.PHONE = inentity.PHONE;
order.FAXNUM = inentity.FAXNUM;
order.AcceptStatus = (int)GeneralMaterialOrderState.New;
InPoList.Add(order);
foreach (var initem in inlist)
{
TB_MATERIALORDERS_DETAIL orderdetail = new TB_MATERIALORDERS_DETAIL();
orderdetail.PurdocNO = initem.PURDOCNO;
orderdetail.AcceptStatus = (int)GeneralMaterialOrderState.New;
orderdetail.PurchaseReqNO = initem.PURCHASEREQNO;
orderdetail.ProposerDesc = initem.PROPOSERDESC;
orderdetail.MtlNO = initem.MTLNO;
orderdetail.ApprovalStatus = initem.APPROVALSTATUS;
orderdetail.Shorttext = initem.SHORTTEXT;
orderdetail.SizeCol = initem.SIZECOL;
orderdetail.Matbrand = initem.MATBRAND;
orderdetail.Unitdes = initem.UNITDES;
orderdetail.Quantity = initem.QUANTITY != null ? (decimal)initem.QUANTITY : 0.000000m;
orderdetail.PRICE = initem.PRICE != null ? (decimal)initem.PRICE : 0.00000m;
orderdetail.NetValue = initem.NETVALUE != null ? (decimal)initem.NETVALUE : 0.00000m;
orderdetail.PurinfoReCord = initem.PURINFORECORD;
orderdetail.ItemDeliveryDate = initem.ITEMDELIVERYDATE != null ? (DateTime)initem.ITEMDELIVERYDATE : DateTime.Now;
orderdetail.Glaccnum = initem.GLACCNUM;
orderdetail.Ctype = "N";
orderdetail.CostCenterDes = initem.COSTCENTERDES;
orderdetail.StoreLocation = initem.STORELOCATION;
orderdetail.PURDOCITEMNO = initem.PURDOCITEMNO;
orderdetail.Remake = initem.REMARK;
InPoDetailList.Add(orderdetail);
var maxlist1 = new xxDiMaxes_Order
{
DI_BATCHNO = initem.DI_BATCHNO,
PURDOCNO = initem.PURDOCNO,
PURDOCITEMNO = initem.PURDOCITEMNO,
CREATEDDATE = initem.CREATEDDATE,
};
xxMaxbath.Add(maxlist1);
}
#endregion
#region
// 添加发邮件数据
TS_Email email = new TS_Email();
email.EmailToUser = inentity.VENDORDESC;
string mailbody = "";
mailbody += "尊敬的 供应商<br>";
mailbody += "你好!<br><br>";
mailbody += "一般材料订单 <b>" + inentity.PURDOCNO + "</b> 已经发布,请到供应商协同网站打开查看!<br>";
mailbody += "登录账号:<b>" + inentity.VENDORNO + "@W21" + "</b><br>";
mailbody += "登录地址:" + wwadres + "<br><br>";
mailbody += "<br><br><br><br>日期:" + DateTime.Now;
email.EmailString = mailbody;
string VENDname = inentity.VENDORNO + "@W21";
var user = authdb.Users.FirstOrDefault(q => q.Name == VENDname);
if (user == null)
{
email.EmailSendState = 2;
email.EmailSendFailReason = "该供应商邮箱未维护";
}
else
{
email.EmailAddress = user.Email;
email.EmailSendState = 0;
}
emails.Add(email);
#endregion
}
#endregion
}
sdb.BulkInsert(emails);// 添加一般材料订单的邮件
sdb.BulkInsert(InPoList);// 添加插入的数据
sdb.BulkInsert(InPoDetailList);// 添加明细
idb.BulkInsert(xxMaxbath);
if (PoList.Count()>0)
{
sdb.TB_MATERIALORDERS.AddOrUpdate(q => q.UID, PoList.ToArray());
}
if (PoDetailList.Count()>0)
{
sdb.TB_MATERIALORDERS_DETAIL.AddOrUpdate(q => q.UID, PoDetailList.ToArray());
}
Console.WriteLine($"更新 一般材料订单 数据:{Dlist.Count()+Ilist.Count()}");
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
if (ex.InnerException != null)
{
Console.WriteLine(ex.InnerException.Message);
}
}
}
/// <summary>
/// 转换
/// </summary>
/// <param name="list">集合</param>
/// <returns></returns>
public static List<T> GetTableToList<T>(this DataTable dt)
{
var list = new List<T>();
var plist = new List<PropertyInfo>(typeof(T).GetProperties());
foreach (DataRow item in dt.Rows)
{
T s = Activator.CreateInstance<T>();
for (int i = 0; i < dt.Columns.Count; i++)
{
PropertyInfo info = plist.Find(p => p.Name == dt.Columns[i].ColumnName);
if (info != null)
{
try
{
if (!Convert.IsDBNull(item[i]))
{
object v = null;
if (info.PropertyType.ToString().Contains("System.Nullable"))
{
v = Convert.ChangeType(item[i], Nullable.GetUnderlyingType(info.PropertyType));
}
else
{
v = Convert.ChangeType(item[i], info.PropertyType);
}
info.SetValue(s, v, null);
}
}
catch (Exception ex)
{
throw new Exception("字段[" + info.Name + "]转换出错," + ex.Message);
}
}
}
list.Add(s);
}
return list;
}
}
}

6
UniApiGroup/Controller/OdbcApiScpController.cs

@ -47,11 +47,17 @@ namespace CK.SCP.GrupUniApi.Controller
{
var list = dataList.Where(p => p.BillNum == billNum).ToList();
if (GlobalVar.ApiConfig.Scm采购订单)
{
PutScmPo(idb, list.Where(p => p.InterfaceType == UniApiType.Pobillnum.ToString()).ToList());
}
if (GlobalVar.ApiConfig.Scm大订单)
{
PutScmMaxPo(idb, list.Where(p => p.InterfaceType == UniApiType.MaxPobillnum.ToString()).ToList());
}
if (GlobalVar.ApiConfig.Scm发货单)
{
PutScmAsn(idb, list.Where(p => p.InterfaceType == UniApiType.Receive.ToString()).ToList());
}
//if (GlobalVar.ApiConfig.Scm条码明细)
// PutScmBarcode(idb, list.Where(p => p.InterfaceType == UniApiType.BarCode.ToString()).ToList());
//if (GlobalVar.ApiConfig.Scm发票)

6
UniApiGroup/Controller/OdbcApiWmsController.cs

@ -358,7 +358,7 @@ namespace CK.SCP.GrupUniApi.Controller
string[] arrr = ar.Split('-');
string pobillnum = arrr[0];
decimal qty = decimal.Parse(arrr[1]);
var maxpodetail = wdb.TB_MAXPO_DETAIL.FirstOrDefault(p => p.PartCode == qadData.xxwms_rc_part && p.PoBillNum == pobillnum);
var maxpodetail = wdb.TB_MAXPO_DETAIL.FirstOrDefault(p => p.PartCode == qadData.xxwms_rc_part && p.PoBillNum == pobillnum && !p.IsDeleted);
if (maxpodetail != null)
{
maxpodetail.ReceQty = maxpodetail.ReceQty + qty;
@ -392,7 +392,7 @@ namespace CK.SCP.GrupUniApi.Controller
string[] arrr = ar.Split('-');
string pobillnum = arrr[0];
decimal qty = decimal.Parse(arrr[1]);
var maxpodetail = wdb.TB_MAXPO_DETAIL.FirstOrDefault(p => p.PartCode == qadData.xxwms_rc_part && p.PoBillNum == pobillnum);
var maxpodetail = wdb.TB_MAXPO_DETAIL.FirstOrDefault(p => p.PartCode == qadData.xxwms_rc_part && p.PoBillNum == pobillnum && !p.IsDeleted);
if (maxpodetail != null)
{
maxpodetail.ReturnQty = maxpodetail.ReturnQty - qty;
@ -849,7 +849,7 @@ namespace CK.SCP.GrupUniApi.Controller
string[] arrr = ar.Split('-');
string pobillnum = arrr[0];
decimal qty = decimal.Parse(arrr[1]);
var maxpodetail = wdb.TB_MAXPO_DETAIL.FirstOrDefault(p => p.PartCode == qadData.xxwms_rt_part && p.PoBillNum == pobillnum);
var maxpodetail = wdb.TB_MAXPO_DETAIL.FirstOrDefault(p => p.PartCode == qadData.xxwms_rt_part && p.PoBillNum == pobillnum && !p.IsDeleted);
if (maxpodetail != null)
{
maxpodetail.ReturnQty = maxpodetail.ReturnQty -qty;

107
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; }
@ -65,5 +66,111 @@ namespace CK.SCP.UniApi.Controller
/// </summary>
}
/// <summary>
/// 获取一般材料订单
/// </summary>
/// <param name="di_d"></param>
/// <param name="site"></param>
/// <returns></returns>
public static DataTable GetGeneralMaterialOrder()
{
string Sql = $"select * from PURStockBill";
Sql += $" Where ((ordType='CY02'AND APPROVALSTATUS = '4') OR (ordType='CY04' AND APPROVALSTATUS = '4') OR (ordType='CY05' AND APPROVALSTATUS = '4') OR ( ordType='CY08'AND APPROVALSTATUS = '4' ) OR (ordType='CY09' AND APPROVALSTATUS = '4') ) and plant='W21' and docDate > add_months(trunc(SYSDATE), -12)";
//sql server
//Sql += $" Where ((ordType='CY02'AND APPROVALSTATUS = '4') OR (ordType='CY04' AND APPROVALSTATUS = '4') OR (ordType='CY05' AND APPROVALSTATUS = '4') OR ( ordType='CY08'AND APPROVALSTATUS = '4' ) OR (ordType='CY09' AND APPROVALSTATUS = '4') ) and plant='W21' and docDate > DATEADD(YEAR,-1,GETDATE())";
var dt_Part = DBControllerByOracle.GetDataTable(Sql);
return dt_Part;
}
public class GeneralMaterialOrder
{
public int PURSTOCKBILLID { get; set; }
public DateTime CREATEDDATE { get; set; }
public decimal? NETVALUE { get; set; }
public string PURGRP { get; set; }
public string ORDTYPE { get; set; }
public string MTLNO { get; set; }
public DateTime? ITEMDELIVERYDATE { get; set; }
public string PURDOCITEMNO { get; set; }
public string CLIENT { get; set; }
public string REMARK { get; set; }
public string ORDPRICEUNIT { get; set; }
public string VENDORDESC { get; set; }
public string VENDORNO { get; set; }
public decimal? PRICE { get; set; }
public string PURDOCNO { get; set; }
public decimal? QUANTITY { get; set; }
public string DI_OPERTYPE { get; set; }
public string PURORG { get; set; }
public string PLANT { get; set; }
public string PURCHASEREQNO { get; set; }
public string ITEMNO { get; set; }
public string BUYLISTSTRDES { get; set; }
public DateTime? DOCDATE { get; set; }
public string PURGRPDESC { get; set; }
public string STORELOCATION { get; set; }
public string PROPOSERDESC { get; set; }
public string REMARK1 { get; set; }
public string CREATEDBY { get; set; }
public string PROMOTION { get; set; }
public string MATBRAND { get; set; }
public DateTime? DI_UPDATETIME { get; set; }
public string PURORGDESC { get; set; }
public int DI_BATCHNO { get; set; }
public string VOLUMEWEIGHT { get; set; }
public string CTYPE { get; set; }
public DateTime? DINDATE { get; set; }
public int? BATCHNO { get; set; }
public string SHORTTEXT { get; set; }
public string PLANTDES { get; set; }
public string SIZECOL { get; set; }
public string PHONE { get; set; }
public string STORELOCATIONDES { get; set; }
public string REQPHONE { get; set; }
public string UNITDES { get; set; }
public DateTime? DI_WRITETIME { get; set; }
public string CREATEDBYDESC { get; set; }
public string RESPONSIBLESALESPERSON { get; set; }
public string COSTCENTERDES { get; set; }
public string FAXNUM { get; set; }
public string GLACCTNODES { get; set; }
public string FAXNUMBER { get; set; }
public string PRODUCTIONCATEGORY { get; set; }
public string GLACCNUM { get; set; }
public string FIRSTTELNO { get; set; }
public string ADDRESSINFO { get; set; }
public string ISSECURITY { get; set; }
public string COSTCENTER { get; set; }
public string ORDERNUM { get; set; }
public string RETURNSITEM { get; set; }
public string BASEUNITMEASURE { get; set; }
public string PURDOCITEMCTG { get; set; }
public string APPROVALSTATUS { get; set; }
public string PMTKEYTERMS { get; set; }
public string DESCRIPTION { get; set; }
public string PURINFORECORD { get; set; }
public string STAGEDESC { get; set; }
public string CONFIRMFLAG { get; set; }
public string CONFALSEREASON { get; set; }
public string CONSUCCESSID { get; set; }
public string ESTIMATEDPRICEINDIC { get; set; }
public string PROPOSERID { get; set; }
public int? PURDOCHEADERID { get; set; }
public int PURDOCITEMID { get; set; }
public string DISPLANTLOCATION { get; set; }
public DateTime? PRICONFIDATE { get; set; }
public string ACTDELIVLOCA { get; set; }
public string STOADRESS { get; set; }
public decimal? RECEIPTQUANTITY { get; set; }
public string STATEDESC { get; set; }
public string CLOSESTATE { get; set; }
public string DI_STATUS { get; set; }
public string EXTITEMNO { get; set; }
public string EXTREQNO { get; set; }
public string STAFFNO { get; set; }
}
}
}

2
UniApiGroup/Controller/Vendercontroller.cs

@ -61,7 +61,7 @@ namespace CK.SCP.UniApi.Controller
public string providerType { get; set; }
public string FAXNUMBER { get; set; }
public string PURORG { get; set; }
public string RESPONSIBLESALESPERSON { get; set; }
}
}
}

163
UniApiGroup/FormMain.Designer.cs

@ -45,9 +45,10 @@
this.btnSetting = new DevComponents.DotNetBar.ButtonX();
this.pnlCtrl = new DevComponents.DotNetBar.PanelEx();
this.panelEx2 = new DevComponents.DotNetBar.PanelEx();
this.BtnErpPut = new CktUniApiButton();
this.BtnErpGet = new CktUniApiButton();
this.BtnErpMail = new CktUniApiButton();
this.BtnErpPut = new CK.SCP.GrupUniApi.CktUniApiButton();
this.BtnErpGet = new CK.SCP.GrupUniApi.CktUniApiButton();
this.BtnErpMail = new CK.SCP.GrupUniApi.CktUniApiButton();
this.BtnErpOrderMail = new CK.SCP.GrupUniApi.CktUniApiButton();
this.bar1 = new DevComponents.DotNetBar.Bar();
this.labelItem1 = new DevComponents.DotNetBar.LabelItem();
this.txtDomain = new DevComponents.DotNetBar.TextBoxItem();
@ -65,13 +66,13 @@
//
this.txtLog.Dock = System.Windows.Forms.DockStyle.Bottom;
this.txtLog.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.txtLog.Location = new System.Drawing.Point(0, 512);
this.txtLog.Margin = new System.Windows.Forms.Padding(2);
this.txtLog.Location = new System.Drawing.Point(0, 646);
this.txtLog.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.txtLog.Multiline = true;
this.txtLog.Name = "txtLog";
this.txtLog.ReadOnly = true;
this.txtLog.ScrollBars = System.Windows.Forms.ScrollBars.Both;
this.txtLog.Size = new System.Drawing.Size(614, 139);
this.txtLog.Size = new System.Drawing.Size(818, 173);
this.txtLog.TabIndex = 5;
//
// styleManager1
@ -83,15 +84,16 @@
//
this.layoutControl1.Location = new System.Drawing.Point(0, 0);
this.layoutControl1.Name = "layoutControl1";
this.layoutControl1.Size = new System.Drawing.Size(200, 200);
this.layoutControl1.TabIndex = 0;
//
// listLog
//
this.listLog.Dock = System.Windows.Forms.DockStyle.Fill;
this.listLog.HideSelection = false;
this.listLog.Location = new System.Drawing.Point(0, 0);
this.listLog.Margin = new System.Windows.Forms.Padding(4);
this.listLog.Name = "listLog";
this.listLog.Size = new System.Drawing.Size(614, 508);
this.listLog.Size = new System.Drawing.Size(818, 641);
this.listLog.TabIndex = 9;
this.listLog.UseCompatibleStateImageBehavior = false;
this.listLog.View = System.Windows.Forms.View.Details;
@ -128,10 +130,10 @@
this.expandableSplitter2.HotGripDarkColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder;
this.expandableSplitter2.HotGripLightColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(232)))), ((int)(((byte)(246)))));
this.expandableSplitter2.HotGripLightColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarBackground;
this.expandableSplitter2.Location = new System.Drawing.Point(0, 508);
this.expandableSplitter2.Margin = new System.Windows.Forms.Padding(2);
this.expandableSplitter2.Location = new System.Drawing.Point(0, 641);
this.expandableSplitter2.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.expandableSplitter2.Name = "expandableSplitter2";
this.expandableSplitter2.Size = new System.Drawing.Size(614, 4);
this.expandableSplitter2.Size = new System.Drawing.Size(818, 5);
this.expandableSplitter2.Style = DevComponents.DotNetBar.eSplitterStyle.Office2007;
this.expandableSplitter2.TabIndex = 59;
this.expandableSplitter2.TabStop = false;
@ -148,10 +150,10 @@
this.panelEx1.Controls.Add(this.btnSetting);
this.panelEx1.DisabledBackColor = System.Drawing.Color.Empty;
this.panelEx1.Dock = System.Windows.Forms.DockStyle.Bottom;
this.panelEx1.Location = new System.Drawing.Point(0, 495);
this.panelEx1.Margin = new System.Windows.Forms.Padding(2);
this.panelEx1.Location = new System.Drawing.Point(0, 624);
this.panelEx1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.panelEx1.Name = "panelEx1";
this.panelEx1.Size = new System.Drawing.Size(170, 156);
this.panelEx1.Size = new System.Drawing.Size(227, 195);
this.panelEx1.Style.Alignment = System.Drawing.StringAlignment.Center;
this.panelEx1.Style.BackColor1.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground;
this.panelEx1.Style.BackColor2.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground2;
@ -167,10 +169,10 @@
this.btnStart.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton;
this.btnStart.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnStart.Font = new System.Drawing.Font("微软雅黑", 16.2F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnStart.Location = new System.Drawing.Point(11, 10);
this.btnStart.Margin = new System.Windows.Forms.Padding(2);
this.btnStart.Location = new System.Drawing.Point(15, 12);
this.btnStart.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.btnStart.Name = "btnStart";
this.btnStart.Size = new System.Drawing.Size(150, 45);
this.btnStart.Size = new System.Drawing.Size(200, 56);
this.btnStart.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.btnStart.TabIndex = 0;
this.btnStart.Text = "启动";
@ -181,10 +183,10 @@
this.btnClose.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton;
this.btnClose.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnClose.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground;
this.btnClose.Location = new System.Drawing.Point(89, 132);
this.btnClose.Margin = new System.Windows.Forms.Padding(2);
this.btnClose.Location = new System.Drawing.Point(119, 165);
this.btnClose.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.btnClose.Name = "btnClose";
this.btnClose.Size = new System.Drawing.Size(72, 20);
this.btnClose.Size = new System.Drawing.Size(96, 25);
this.btnClose.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.btnClose.TabIndex = 3;
this.btnClose.Text = "退出";
@ -195,10 +197,10 @@
this.btnRefresh.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton;
this.btnRefresh.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnRefresh.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground;
this.btnRefresh.Location = new System.Drawing.Point(11, 133);
this.btnRefresh.Margin = new System.Windows.Forms.Padding(2);
this.btnRefresh.Location = new System.Drawing.Point(15, 166);
this.btnRefresh.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.btnRefresh.Name = "btnRefresh";
this.btnRefresh.Size = new System.Drawing.Size(72, 20);
this.btnRefresh.Size = new System.Drawing.Size(96, 25);
this.btnRefresh.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.btnRefresh.TabIndex = 23;
this.btnRefresh.Text = "更新数据";
@ -210,10 +212,10 @@
this.btnStop.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnStop.ColorTable = DevComponents.DotNetBar.eButtonColor.MagentaWithBackground;
this.btnStop.Font = new System.Drawing.Font("微软雅黑", 16.2F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnStop.Location = new System.Drawing.Point(11, 58);
this.btnStop.Margin = new System.Windows.Forms.Padding(2);
this.btnStop.Location = new System.Drawing.Point(15, 72);
this.btnStop.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.btnStop.Name = "btnStop";
this.btnStop.Size = new System.Drawing.Size(150, 45);
this.btnStop.Size = new System.Drawing.Size(200, 56);
this.btnStop.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.btnStop.TabIndex = 1;
this.btnStop.Text = "停止";
@ -224,10 +226,10 @@
this.btnClearLog.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton;
this.btnClearLog.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnClearLog.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground;
this.btnClearLog.Location = new System.Drawing.Point(11, 108);
this.btnClearLog.Margin = new System.Windows.Forms.Padding(2);
this.btnClearLog.Location = new System.Drawing.Point(15, 135);
this.btnClearLog.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.btnClearLog.Name = "btnClearLog";
this.btnClearLog.Size = new System.Drawing.Size(72, 20);
this.btnClearLog.Size = new System.Drawing.Size(96, 25);
this.btnClearLog.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.btnClearLog.TabIndex = 10;
this.btnClearLog.Text = "清空日志";
@ -238,10 +240,10 @@
this.btnSetting.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton;
this.btnSetting.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnSetting.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground;
this.btnSetting.Location = new System.Drawing.Point(89, 108);
this.btnSetting.Margin = new System.Windows.Forms.Padding(2);
this.btnSetting.Location = new System.Drawing.Point(119, 135);
this.btnSetting.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.btnSetting.Name = "btnSetting";
this.btnSetting.Size = new System.Drawing.Size(72, 20);
this.btnSetting.Size = new System.Drawing.Size(96, 25);
this.btnSetting.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.btnSetting.TabIndex = 2;
this.btnSetting.Text = "设置";
@ -255,10 +257,10 @@
this.pnlCtrl.Controls.Add(this.panelEx1);
this.pnlCtrl.DisabledBackColor = System.Drawing.Color.Empty;
this.pnlCtrl.Dock = System.Windows.Forms.DockStyle.Right;
this.pnlCtrl.Location = new System.Drawing.Point(614, 0);
this.pnlCtrl.Margin = new System.Windows.Forms.Padding(2);
this.pnlCtrl.Location = new System.Drawing.Point(818, 0);
this.pnlCtrl.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.pnlCtrl.Name = "pnlCtrl";
this.pnlCtrl.Size = new System.Drawing.Size(170, 651);
this.pnlCtrl.Size = new System.Drawing.Size(227, 819);
this.pnlCtrl.Style.Alignment = System.Drawing.StringAlignment.Center;
this.pnlCtrl.Style.BackColor1.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground;
this.pnlCtrl.Style.BackColor2.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground2;
@ -276,12 +278,13 @@
this.panelEx2.Controls.Add(this.BtnErpPut);
this.panelEx2.Controls.Add(this.BtnErpGet);
this.panelEx2.Controls.Add(this.BtnErpMail);
this.panelEx2.Controls.Add(this.BtnErpOrderMail);
this.panelEx2.DisabledBackColor = System.Drawing.Color.Empty;
this.panelEx2.Dock = System.Windows.Forms.DockStyle.Fill;
this.panelEx2.Location = new System.Drawing.Point(0, 0);
this.panelEx2.Margin = new System.Windows.Forms.Padding(2);
this.panelEx2.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.panelEx2.Name = "panelEx2";
this.panelEx2.Size = new System.Drawing.Size(170, 495);
this.panelEx2.Size = new System.Drawing.Size(227, 624);
this.panelEx2.Style.Alignment = System.Drawing.StringAlignment.Center;
this.panelEx2.Style.BackColor1.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground;
this.panelEx2.Style.BackColor2.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground2;
@ -291,37 +294,21 @@
this.panelEx2.Style.GradientAngle = 90;
this.panelEx2.TabIndex = 29;
//
// BtnErpMail
//
this.BtnErpMail.Count = 0;
this.BtnErpMail.Dock = System.Windows.Forms.DockStyle.Top;
this.BtnErpMail.EnableManual = true;
this.BtnErpMail.InitCount = 0;
this.BtnErpMail.Location = new System.Drawing.Point(0, 100);
this.BtnErpMail.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.BtnErpMail.Name = "BtnErpMail";
this.BtnErpMail.Padding = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.BtnErpMail.Size = new System.Drawing.Size(170, 50);
this.BtnErpMail.SwitchEnabled = false;
this.BtnErpMail.TabIndex = 40;
this.BtnErpMail.Title = "发送邮件";
this.BtnErpMail.RunOnceExecute += new CktUniApiButton.RunOnceHandler(this.BtnErpMail_RunOnceExecute);
//
// BtnErpPut
//
this.BtnErpPut.Count = 0;
this.BtnErpPut.Dock = System.Windows.Forms.DockStyle.Top;
this.BtnErpPut.EnableManual = true;
this.BtnErpPut.InitCount = 0;
this.BtnErpPut.Location = new System.Drawing.Point(0, 50);
this.BtnErpPut.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.BtnErpPut.Location = new System.Drawing.Point(0, 186);
this.BtnErpPut.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.BtnErpPut.Name = "BtnErpPut";
this.BtnErpPut.Padding = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.BtnErpPut.Size = new System.Drawing.Size(170, 50);
this.BtnErpPut.Padding = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.BtnErpPut.Size = new System.Drawing.Size(227, 62);
this.BtnErpPut.SwitchEnabled = false;
this.BtnErpPut.TabIndex = 40;
this.BtnErpPut.Title = "发送业务数据到ERP";
this.BtnErpPut.RunOnceExecute += new CktUniApiButton.RunOnceHandler(this.BtnErpPut_RunOnceExecute);
this.BtnErpPut.RunOnceExecute += new CK.SCP.GrupUniApi.CktUniApiButton.RunOnceHandler(this.BtnErpPut_RunOnceExecute);
//
// BtnErpGet
//
@ -329,15 +316,47 @@
this.BtnErpGet.Dock = System.Windows.Forms.DockStyle.Top;
this.BtnErpGet.EnableManual = true;
this.BtnErpGet.InitCount = 0;
this.BtnErpGet.Location = new System.Drawing.Point(0, 0);
this.BtnErpGet.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.BtnErpGet.Location = new System.Drawing.Point(0, 124);
this.BtnErpGet.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.BtnErpGet.Name = "BtnErpGet";
this.BtnErpGet.Padding = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.BtnErpGet.Size = new System.Drawing.Size(170, 50);
this.BtnErpGet.Padding = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.BtnErpGet.Size = new System.Drawing.Size(227, 62);
this.BtnErpGet.SwitchEnabled = false;
this.BtnErpGet.TabIndex = 39;
this.BtnErpGet.Title = "从ERP接收基础数据";
this.BtnErpGet.RunOnceExecute += new CktUniApiButton.RunOnceHandler(this.BtnErpGet_RunOnceExecute);
this.BtnErpGet.RunOnceExecute += new CK.SCP.GrupUniApi.CktUniApiButton.RunOnceHandler(this.BtnErpGet_RunOnceExecute);
//
// BtnErpMail
//
this.BtnErpMail.Count = 0;
this.BtnErpMail.Dock = System.Windows.Forms.DockStyle.Top;
this.BtnErpMail.EnableManual = true;
this.BtnErpMail.InitCount = 0;
this.BtnErpMail.Location = new System.Drawing.Point(0, 62);
this.BtnErpMail.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.BtnErpMail.Name = "BtnErpMail";
this.BtnErpMail.Padding = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.BtnErpMail.Size = new System.Drawing.Size(227, 62);
this.BtnErpMail.SwitchEnabled = false;
this.BtnErpMail.TabIndex = 40;
this.BtnErpMail.Title = "发送邮件";
this.BtnErpMail.RunOnceExecute += new CK.SCP.GrupUniApi.CktUniApiButton.RunOnceHandler(this.BtnErpMail_RunOnceExecute);
//
// BtnErpOrderMail
//
this.BtnErpOrderMail.Count = 0;
this.BtnErpOrderMail.Dock = System.Windows.Forms.DockStyle.Top;
this.BtnErpOrderMail.EnableManual = true;
this.BtnErpOrderMail.InitCount = 0;
this.BtnErpOrderMail.Location = new System.Drawing.Point(0, 0);
this.BtnErpOrderMail.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.BtnErpOrderMail.Name = "BtnErpOrderMail";
this.BtnErpOrderMail.Padding = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.BtnErpOrderMail.Size = new System.Drawing.Size(227, 62);
this.BtnErpOrderMail.SwitchEnabled = false;
this.BtnErpOrderMail.TabIndex = 88;
this.BtnErpOrderMail.Title = "发送材料订单邮件";
this.BtnErpOrderMail.RunOnceExecute += new CK.SCP.GrupUniApi.CktUniApiButton.RunOnceHandler(this.BtnErpOrderMail_RunOnceExecute);
//
// bar1
//
@ -352,10 +371,10 @@
this.txtSite,
this.labelItem4,
this.txtVersion});
this.bar1.Location = new System.Drawing.Point(0, 651);
this.bar1.Margin = new System.Windows.Forms.Padding(2);
this.bar1.Location = new System.Drawing.Point(0, 819);
this.bar1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.bar1.Name = "bar1";
this.bar1.Size = new System.Drawing.Size(784, 24);
this.bar1.Size = new System.Drawing.Size(1045, 25);
this.bar1.Stretch = true;
this.bar1.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.bar1.TabIndex = 87;
@ -371,7 +390,6 @@
//
this.txtDomain.Name = "txtDomain";
this.txtDomain.TextBoxWidth = 80;
this.txtDomain.WatermarkColor = System.Drawing.SystemColors.GrayText;
//
// labelItem2
//
@ -382,7 +400,6 @@
//
this.txtSite.Name = "txtSite";
this.txtSite.TextBoxWidth = 80;
this.txtSite.WatermarkColor = System.Drawing.SystemColors.GrayText;
//
// labelItem4
//
@ -394,13 +411,12 @@
//
this.txtVersion.Name = "txtVersion";
this.txtVersion.TextBoxWidth = 200;
this.txtVersion.WatermarkColor = System.Drawing.SystemColors.GrayText;
//
// FormMain
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(784, 675);
this.ClientSize = new System.Drawing.Size(1045, 844);
this.Controls.Add(this.listLog);
this.Controls.Add(this.expandableSplitter2);
this.Controls.Add(this.txtLog);
@ -408,8 +424,8 @@
this.Controls.Add(this.bar1);
this.DoubleBuffered = true;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Margin = new System.Windows.Forms.Padding(2);
this.MinimumSize = new System.Drawing.Size(800, 596);
this.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.MinimumSize = new System.Drawing.Size(1061, 733);
this.Name = "FormMain";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "通用接口自动处理程序";
@ -449,6 +465,7 @@
private DevComponents.DotNetBar.TextBoxItem txtSite;
private DevComponents.DotNetBar.LabelItem labelItem4;
private DevComponents.DotNetBar.TextBoxItem txtVersion;
private CktUniApiButton BtnErpOrderMail;
}
}

10
UniApiGroup/FormMain.cs

@ -64,10 +64,12 @@ namespace CK.SCP.GrupUniApi
BtnErpGet.Count = GlobalVar.DurationConfig.ERP接口接收;
BtnErpPut.Count = GlobalVar.DurationConfig.ERP接口发送;
BtnErpMail.Count = GlobalVar.DurationConfig.;
BtnErpOrderMail.Count = GlobalVar.DurationConfig.;
BtnErpGet.InitCount = GlobalVar.DurationConfig.ERP接口接收;
BtnErpPut.InitCount = GlobalVar.DurationConfig.ERP接口发送;
BtnErpMail.InitCount = GlobalVar.DurationConfig.;
BtnErpOrderMail.InitCount = GlobalVar.DurationConfig.;
_timer = new Timer { Interval = 1000 };
@ -83,6 +85,7 @@ namespace CK.SCP.GrupUniApi
{
BtnErpGet.RunOnce();
BtnErpPut.RunOnce();
BtnErpOrderMail.RunOnce();
RefreshGlobalCache();
}
@ -133,6 +136,7 @@ namespace CK.SCP.GrupUniApi
Console.WriteLine(@"系统启动");
BtnErpGet.Start();
BtnErpPut.Start();
BtnErpOrderMail.Start();
_timer.Start();
btnStart.Enabled = false;
@ -146,6 +150,7 @@ namespace CK.SCP.GrupUniApi
BtnErpPut.Stop();
_timer.Stop();
BtnErpOrderMail.Stop();
btnStart.Enabled = true;
btnStop.Enabled = false;
@ -203,5 +208,10 @@ namespace CK.SCP.GrupUniApi
{
_iApi.Mail();
}
private void BtnErpOrderMail_RunOnceExecute()
{
_iApi.OrderMail();
}
}
}

38
UniApiGroup/FormMain.resx

@ -118,10 +118,46 @@
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="styleManager1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>1603, 17</value>
</metadata>
<metadata name="layoutControl1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>156, 17</value>
<value>1769, 17</value>
</metadata>
<metadata name="expandableSplitter2.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>184, 17</value>
</metadata>
<metadata name="panelEx1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>388, 17</value>
</metadata>
<metadata name="btnStart.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>511, 17</value>
</metadata>
<metadata name="btnClose.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>628, 17</value>
</metadata>
<metadata name="btnRefresh.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>750, 17</value>
</metadata>
<metadata name="btnStop.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>887, 17</value>
</metadata>
<metadata name="btnClearLog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>1003, 17</value>
</metadata>
<metadata name="btnSetting.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>1150, 17</value>
</metadata>
<metadata name="pnlCtrl.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>1284, 17</value>
</metadata>
<metadata name="panelEx2.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>1390, 17</value>
</metadata>
<metadata name="bar1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>1513, 17</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">

1
UniApiGroup/IApi.cs

@ -6,5 +6,6 @@
void Get();
void Put();
void Mail();
void OrderMail();
}
}

42
UniApiGroup/QadOdbcApi.cs

@ -17,6 +17,7 @@ namespace CK.SCP.GrupUniApi
private readonly BackgroundWorker _bgwGet = new BackgroundWorker();
private readonly BackgroundWorker _bgwPut = new BackgroundWorker();
private readonly BackgroundWorker _bgwMail = new BackgroundWorker();
private readonly BackgroundWorker _bgwOrderMail = new BackgroundWorker();
public QadOdbcApi()
{
InitBgw();
@ -32,6 +33,10 @@ namespace CK.SCP.GrupUniApi
//发邮件
_bgwMail.DoWork += BgwMailDoWork;
_bgwMail.RunWorkerCompleted += BgwMailRunWorkerCompleted;
// 发送材料订单邮件
_bgwOrderMail.DoWork += bgwOrderMail;
_bgwOrderMail.RunWorkerCompleted += BgwOrderMailRunWorkerCompleted;
}
private void BgwPutRunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
@ -42,6 +47,13 @@ namespace CK.SCP.GrupUniApi
{
Console.WriteLine(@"邮件发送完成<<<<<<<<<<");
}
private void BgwOrderMailRunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
{
Console.WriteLine(@"材料订单邮件发送完成<<<<<<<<<<");
}
private void BgwPutDoWork(object sender, DoWorkEventArgs e)
{
var idb = EntitiesFactory.CreateUniApiInstance();
@ -111,6 +123,22 @@ namespace CK.SCP.GrupUniApi
}
}
/// <summary>
/// 材料订单发邮件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void bgwOrderMail(object sender, DoWorkEventArgs e)
{
try
{
MailController.SendOrderMail();
}
catch (Exception ex)
{
Console.WriteLine(string.Format("错误:{0}", ex.InnerException.Message));
}
}
private void BgwGetRunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
{
Console.WriteLine(@"Odbc接口数据接收完成<<<<<<<<<<");
@ -170,6 +198,20 @@ namespace CK.SCP.GrupUniApi
Console.WriteLine(ex);
}
}
public void OrderMail()
{
try
{
if (_bgwOrderMail.IsBusy) return;
Console.WriteLine(@"发送材料订单邮件>>>>>>>>>>");
_bgwOrderMail.RunWorkerAsync();
}
catch (ScpException ex)
{
Console.WriteLine(ex);
}
}
}
}
Loading…
Cancel
Save