Browse Source

冲压件要货看板发布优化

master
qian 9 months ago
parent
commit
03cad02474
  1. 13
      Common/CK.SCP.Common.csproj
  2. 110
      Common/MyWebSmtpMail.cs
  3. 8
      Common/app.config
  4. 4
      Common/packages.config
  5. 178
      Controller/SCP_ASK_CONTROLLER.cs
  6. 83
      SCP/Common/MailHelper.cs
  7. 11
      SCP/Views/PlanData/SCP_ASK_DETAIL.aspx.cs
  8. 138
      SCP/Web.config
  9. 4
      SCP/packages.config
  10. 28
      UniApiGroup/App.config

13
Common/CK.SCP.Common.csproj

@ -31,6 +31,9 @@
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="BouncyCastle.Crypto, Version=1.9.0.0, Culture=neutral, PublicKeyToken=0e99375e54769942, processorArchitecture=MSIL">
<HintPath>..\packages\Portable.BouncyCastle.1.9.0\lib\net40\BouncyCastle.Crypto.dll</HintPath>
</Reference>
<Reference Include="DevComponents.DotNetBar.Layout"> <Reference Include="DevComponents.DotNetBar.Layout">
<HintPath>..\DLL\DevComponents.DotNetBar.Layout.dll</HintPath> <HintPath>..\DLL\DevComponents.DotNetBar.Layout.dll</HintPath>
</Reference> </Reference>
@ -40,6 +43,12 @@
<Reference Include="ICSharpCode.SharpZipLib, Version=0.86.0.518, Culture=neutral, PublicKeyToken=1b03e6acf1164f73, processorArchitecture=MSIL"> <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> <HintPath>..\packages\SharpZipLib.0.86.0\lib\20\ICSharpCode.SharpZipLib.dll</HintPath>
</Reference> </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="MimeKit, Version=3.1.0.0, Culture=neutral, PublicKeyToken=bede1c8a46c66814, processorArchitecture=MSIL">
<HintPath>..\packages\MimeKit.3.1.0\lib\net452\MimeKit.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> <Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll</HintPath> <HintPath>..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference> </Reference>
@ -56,10 +65,14 @@
<HintPath>..\packages\NPOI.2.3.0\lib\net40\NPOI.OpenXmlFormats.dll</HintPath> <HintPath>..\packages\NPOI.2.3.0\lib\net40\NPOI.OpenXmlFormats.dll</HintPath>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Buffers.4.5.1\lib\netstandard1.1\System.Buffers.dll</HintPath>
</Reference>
<Reference Include="System.Configuration" /> <Reference Include="System.Configuration" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
<Reference Include="System.Data.Entity" /> <Reference Include="System.Data.Entity" />
<Reference Include="System.Drawing" /> <Reference Include="System.Drawing" />
<Reference Include="System.Security" />
<Reference Include="System.Windows.Forms" /> <Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml.Linq" /> <Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" /> <Reference Include="System.Data.DataSetExtensions" />

110
Common/MyWebSmtpMail.cs

@ -1,4 +1,7 @@
using System; using MailKit.Security;
using MimeKit;
using MimeKit.Text;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Configuration; using System.Configuration;
using System.Linq; using System.Linq;
@ -85,4 +88,109 @@ namespace CK.SCP.Common
} }
} }
} }
public class EmailAddress
{
public EmailAddress(string address, string name)
{
Address = address;
Name = name;
}
public string Name { get; set; }
public string Address { get; set; }
}
public class MailKitMailSender
{
private readonly MailKit.Net.Smtp.SmtpClient _client = new MailKit.Net.Smtp.SmtpClient();
private MimeMessage _message = new MimeMessage();
private string host;//邮箱服务器
private int port;//端口
private string from;//发送的邮箱
private string password;//密码
private bool enablessl;//是否ssl
private string username;//发送名称
private readonly SecureSocketOptions _secureSocketOptions;
private MailKitMailSender()
{
_client.ServerCertificateValidationCallback = (s, c, h, e) => true;
}
public MailKitMailSender(SecureSocketOptions secureSocketOptions) : this()
{
_secureSocketOptions = secureSocketOptions;
host = ConfigurationManager.AppSettings["MailServer"];
port = Convert.ToInt32(ConfigurationManager.AppSettings["MailPort"]);
from = ConfigurationManager.AppSettings["MailSender"];
username = ConfigurationManager.AppSettings["MailUserName"];
password = ConfigurationManager.AppSettings["MailPassword"];
enablessl = false;
}
public void BuildMessage(List<EmailAddress> toAddressList, string subject, string body, string model)
{
_message = new MimeMessage();
_message.Sender = new MailboxAddress(username, from);
_message.From.Add(new MailboxAddress(username, from));
_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));
}
}
}
public void Send()
{
try
{
_client.Connect(host, port, _secureSocketOptions);
_client.Authenticate(from, password);
_client.Send(_message);
_client.Disconnect(true);
Console.WriteLine("MailKit Send Success:" + _message.To.Mailboxes.First());
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
Console.WriteLine();
}
}
public async Task SendAsync()
{
try
{
await _client.ConnectAsync(host, port, _secureSocketOptions);
await _client.AuthenticateAsync(from, password);
await _client.SendAsync(_message);
await _client.DisconnectAsync(true);
Console.WriteLine("MailKit Send Success:" + _message.To.Mailboxes.First());
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
Console.WriteLine();
}
}
}
} }

8
Common/app.config

@ -1,11 +1,11 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<configuration> <configuration>
<runtime> <runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="EPPlus" publicKeyToken="ea159fdaa78159a1" culture="neutral"/> <assemblyIdentity name="EPPlus" publicKeyToken="ea159fdaa78159a1" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.5.2.1" newVersion="4.5.2.1"/> <bindingRedirect oldVersion="0.0.0.0-4.5.2.1" newVersion="4.5.2.1" />
</dependentAssembly> </dependentAssembly>
</assemblyBinding> </assemblyBinding>
</runtime> </runtime>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2"/></startup></configuration> <startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" /></startup></configuration>

4
Common/packages.config

@ -1,6 +1,10 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="MailKit" version="3.1.0" targetFramework="net452" />
<package id="MimeKit" version="3.1.0" targetFramework="net452" />
<package id="Newtonsoft.Json" version="10.0.3" targetFramework="net452" /> <package id="Newtonsoft.Json" version="10.0.3" targetFramework="net452" />
<package id="NPOI" version="2.3.0" targetFramework="net452" /> <package id="NPOI" version="2.3.0" targetFramework="net452" />
<package id="Portable.BouncyCastle" version="1.9.0" targetFramework="net452" />
<package id="SharpZipLib" version="0.86.0" targetFramework="net452" /> <package id="SharpZipLib" version="0.86.0" targetFramework="net452" />
<package id="System.Buffers" version="4.5.1" targetFramework="net452" />
</packages> </packages>

178
Controller/SCP_ASK_CONTROLLER.cs

@ -169,10 +169,10 @@ namespace CK.SCP.Controller
{ {
using (ScpEntities db = EntitiesFactory.CreateScpInstance()) using (ScpEntities db = EntitiesFactory.CreateScpInstance())
{ {
return db.TA_ASK_SUBPART.Where(p=>p.AskBillNum==ASK&&string.IsNullOrEmpty(p.VendBatch)).ToList(); return db.TA_ASK_SUBPART.Where(p => p.AskBillNum == ASK && string.IsNullOrEmpty(p.VendBatch)).ToList();
} }
} }
public static ResultObject<bool> Update_User_ErrorCount(string p_userName,int count ) public static ResultObject<bool> Update_User_ErrorCount(string p_userName, int count)
{ {
ResultObject<bool> _ret = new ResultObject<bool>(); ResultObject<bool> _ret = new ResultObject<bool>();
try try
@ -183,7 +183,7 @@ namespace CK.SCP.Controller
if (user != null) if (user != null)
{ {
user.ErrorCount = user.ErrorCount + 1; user.ErrorCount = user.ErrorCount + 1;
if(user.ErrorCount== count) if (user.ErrorCount == count)
{ {
user.Enabled = false; user.Enabled = false;
_ret.Message = $"密码错误超过【{count}】次,账号已锁定请联系管理员"; _ret.Message = $"密码错误超过【{count}】次,账号已锁定请联系管理员";
@ -377,7 +377,7 @@ namespace CK.SCP.Controller
var sub = db.TA_SubPartCode.Where(p => p.PartCode == ak.PartCode).ToList(); var sub = db.TA_SubPartCode.Where(p => p.PartCode == ak.PartCode).ToList();
if (sub.Count() > 0) if (sub.Count() > 0)
{ {
foreach(var su in sub) foreach (var su in sub)
{ {
TA_ASK_SUBPART subpart = new TA_ASK_SUBPART(); TA_ASK_SUBPART subpart = new TA_ASK_SUBPART();
subpart.PartCode = su.PartCode; subpart.PartCode = su.PartCode;
@ -1359,7 +1359,7 @@ namespace CK.SCP.Controller
using (ScpEntities db = EntitiesFactory.CreateScpInstance()) using (ScpEntities db = EntitiesFactory.CreateScpInstance())
{ {
var ret= db.TB_ASK.Where(p => p.AskBillNum == p_entitys.AskBillNum).FirstOrDefault(); var ret = db.TB_ASK.Where(p => p.AskBillNum == p_entitys.AskBillNum).FirstOrDefault();
ret.Extend1 = p_entitys.Extend1; ret.Extend1 = p_entitys.Extend1;
db.TB_ASK.AddOrUpdate(ret); db.TB_ASK.AddOrUpdate(ret);
@ -1685,10 +1685,10 @@ namespace CK.SCP.Controller
{ {
_tDetail.VendBatch = itm.VendBatch; _tDetail.VendBatch = itm.VendBatch;
} }
var subpart = db.TA_ASK_SUBPART.Where(p=>p.PartCode== itm.PartCode&&p.AskBillNum==itm.AskBillNum).ToList(); var subpart = db.TA_ASK_SUBPART.Where(p => p.PartCode == itm.PartCode && p.AskBillNum == itm.AskBillNum).ToList();
string str1 = ""; string str1 = "";
string str2 = ""; string str2 = "";
foreach(var sub in subpart) foreach (var sub in subpart)
{ {
string str = sub.SubPartCode + "," + sub.BOMedtiton + "," + sub.VendBatch + "#"; string str = sub.SubPartCode + "," + sub.BOMedtiton + "," + sub.VendBatch + "#";
str2 = str2 + sub.VendBatch; str2 = str2 + sub.VendBatch;
@ -1736,17 +1736,17 @@ namespace CK.SCP.Controller
uni.Batch = _tDetail.Batch; uni.Batch = _tDetail.Batch;
uni.Qty = _tDetail.Qty; uni.Qty = _tDetail.Qty;
uni.State = 2; uni.State = 2;
uni.CreateOper=_t.CreateUser; uni.CreateOper = _t.CreateUser;
uni.CreateTime = DateTime.Now; uni.CreateTime = DateTime.Now;
uni.PutTime= DateTime.Now; uni.PutTime = DateTime.Now;
uni.VendId = _t.VendId; uni.VendId = _t.VendId;
uni.PoUnit = _tDetail.PoUnit; uni.PoUnit = _tDetail.PoUnit;
uni.LocUnit = _tDetail.PoUnit; uni.LocUnit = _tDetail.PoUnit;
uni.ValidDate= DateTime.Now; uni.ValidDate = DateTime.Now;
uni.ErpBillNum = _tDetail.PoBillNum; uni.ErpBillNum = _tDetail.PoBillNum;
uni.ErpLineNum = _tDetail.PoLine; uni.ErpLineNum = _tDetail.PoLine;
uni.VendBatch = sub.VendBatch; uni.VendBatch = sub.VendBatch;
uni.PackQty= _tDetail.Qty; uni.PackQty = _tDetail.Qty;
uni.Price = _tDetail.Price; uni.Price = _tDetail.Price;
uni.UmConv = 1; uni.UmConv = 1;
uni.Buyer = _t.ShipUser; uni.Buyer = _t.ShipUser;
@ -1852,7 +1852,7 @@ namespace CK.SCP.Controller
{ {
using (ScpEntities db = EntitiesFactory.CreateScpInstance()) using (ScpEntities db = EntitiesFactory.CreateScpInstance())
{ {
var po = db.TB_PO.FirstOrDefault(p=>p.PoBillNum==p_ask.PoBillNum); var po = db.TB_PO.FirstOrDefault(p => p.PoBillNum == p_ask.PoBillNum);
TB_ASN _t = new TB_ASN(); TB_ASN _t = new TB_ASN();
_t.AsnBillNum = SCP_BILLCODE_CONTROLLER.MakeASNCode(); _t.AsnBillNum = SCP_BILLCODE_CONTROLLER.MakeASNCode();
_t.AskBillNum = p_ask.AskBillNum; _t.AskBillNum = p_ask.AskBillNum;
@ -1893,7 +1893,7 @@ namespace CK.SCP.Controller
_tDetail.PoLine = itm.PoLine; _tDetail.PoLine = itm.PoLine;
_tDetail.PoUnit = itm.PoUnit; _tDetail.PoUnit = itm.PoUnit;
_tDetail.Batch = itm.Batch; _tDetail.Batch = itm.Batch;
if (itm.VendBatch=="55") if (itm.VendBatch == "55")
{ {
_tDetail.VendBatch = ""; _tDetail.VendBatch = "";
} }
@ -1902,12 +1902,12 @@ namespace CK.SCP.Controller
_tDetail.VendBatch = itm.VendBatch; _tDetail.VendBatch = itm.VendBatch;
} }
if (_t.PoBillNum.Substring(0, 5) == "CYD03"&&_t.Site=="W21") if (_t.PoBillNum.Substring(0, 5) == "CYD03" && _t.Site == "W21")
{ {
var podetail = db.TB_PO_DETAIL.FirstOrDefault(t=>t.PoBillNum==_t.PoBillNum&&t.PartCode==itm.PartCode&&t.PoLine==itm.PoLine); var podetail = db.TB_PO_DETAIL.FirstOrDefault(t => t.PoBillNum == _t.PoBillNum && t.PartCode == itm.PartCode && t.PoLine == itm.PoLine);
_tDetail.VendBatch = podetail.SubSite + "," + podetail.Extend3 + "," + itm.VendBatch + "#"; _tDetail.VendBatch = podetail.SubSite + "," + podetail.Extend3 + "," + itm.VendBatch + "#";
} }
_tDetail.UpdateUser= itm.VendBatch; _tDetail.UpdateUser = itm.VendBatch;
_tDetail.PackQty = itm.PackQty == 0 ? 1 : itm.PackQty; _tDetail.PackQty = itm.PackQty == 0 ? 1 : itm.PackQty;
_tDetail.PartCode = itm.PartCode; _tDetail.PartCode = itm.PartCode;
_tDetail.State = (int)AsnState.New; _tDetail.State = (int)AsnState.New;
@ -1928,18 +1928,18 @@ namespace CK.SCP.Controller
_tDetail.SubSite = itm.SubSite; _tDetail.SubSite = itm.SubSite;
_tDetail.Site = itm.Site; _tDetail.Site = itm.Site;
_tDetail.Extend2 = itm.ReceivedQty.ToString(); _tDetail.Extend2 = itm.ReceivedQty.ToString();
_tDetail.Remark= itm.ReceivedQty.ToString(); _tDetail.Remark = itm.ReceivedQty.ToString();
_tDetail.UpdateInfo = itm.UpdateInfo; _tDetail.UpdateInfo = itm.UpdateInfo;
var partgroup = db.TA_PART.Where(p => p.PartCode == itm.PartCode).FirstOrDefault(); var partgroup = db.TA_PART.Where(p => p.PartCode == itm.PartCode).FirstOrDefault();
var askdetail=db.TB_ASK_DETAIL.Where(p => p.PartCode == itm.PartCode&&p.AskBillNum==itm.AskBillNum).FirstOrDefault(); var askdetail = db.TB_ASK_DETAIL.Where(p => p.PartCode == itm.PartCode && p.AskBillNum == itm.AskBillNum).FirstOrDefault();
_tDetail.Extend3 = partgroup.PartGroup; _tDetail.Extend3 = partgroup.PartGroup;
_tDetail.Extend1 =po.VendId; _tDetail.Extend1 = po.VendId;
if (itm.Site == "U32") if (itm.Site == "U32")
{ {
var _applin = db.TA_Appliance.FirstOrDefault(p=>p.PartNumber==itm.SubSite&&p.VendID==p_ask.VendId); var _applin = db.TA_Appliance.FirstOrDefault(p => p.PartNumber == itm.SubSite && p.VendID == p_ask.VendId);
if (_applin != null) if (_applin != null)
{ {
var _boxtype = db.TA_BOXTYPE.FirstOrDefault(p=>p.BoxType==_applin.BoxType&&p.Enabled==true); var _boxtype = db.TA_BOXTYPE.FirstOrDefault(p => p.BoxType == _applin.BoxType && p.Enabled == true);
if (_boxtype != null) if (_boxtype != null)
{ {
TB_ASN_PARTBOX PARTBOX = new TB_ASN_PARTBOX(); TB_ASN_PARTBOX PARTBOX = new TB_ASN_PARTBOX();
@ -1947,14 +1947,14 @@ namespace CK.SCP.Controller
PARTBOX.PartCode = itm.PartCode; PARTBOX.PartCode = itm.PartCode;
PARTBOX.BoxType = _boxtype.BoxType; PARTBOX.BoxType = _boxtype.BoxType;
PARTBOX.Box = Convert.ToInt32(_tDetail.Qty) / Convert.ToInt32(_tDetail.PackQty); PARTBOX.Box = Convert.ToInt32(_tDetail.Qty) / Convert.ToInt32(_tDetail.PackQty);
if(Convert.ToInt32(_tDetail.Qty) % Convert.ToInt32(_tDetail.PackQty) > 0) if (Convert.ToInt32(_tDetail.Qty) % Convert.ToInt32(_tDetail.PackQty) > 0)
{ {
PARTBOX.Box = PARTBOX.Box + 1; PARTBOX.Box = PARTBOX.Box + 1;
} }
PARTBOX.SumBox = PARTBOX.Box; PARTBOX.SumBox = PARTBOX.Box;
PARTBOX.PoBillNum = _t.PoBillNum; PARTBOX.PoBillNum = _t.PoBillNum;
PARTBOX.VendId = _t.VendId; PARTBOX.VendId = _t.VendId;
PARTBOX.ShipTime =DateTime.Parse(_t.ShipTime.ToString()).ToShortDateString(); PARTBOX.ShipTime = DateTime.Parse(_t.ShipTime.ToString()).ToShortDateString();
PARTBOX.Batch = _tDetail.Batch; PARTBOX.Batch = _tDetail.Batch;
PARTBOX.PoLine = _tDetail.PoLine; PARTBOX.PoLine = _tDetail.PoLine;
PARTBOX.PackQty = _tDetail.PackQty; PARTBOX.PackQty = _tDetail.PackQty;
@ -1966,7 +1966,7 @@ namespace CK.SCP.Controller
var ModelList = db.TA_CarModel.ToList(); var ModelList = db.TA_CarModel.ToList();
foreach (var model in ModelList) foreach (var model in ModelList)
{ {
if(model.Model.Length<=askdetail.Extend2.Length) if (model.Model.Length <= askdetail.Extend2.Length)
{ {
if (askdetail.Extend2.Contains(model.Model)) if (askdetail.Extend2.Contains(model.Model))
@ -2111,7 +2111,7 @@ namespace CK.SCP.Controller
return p_list; return p_list;
} }
public static List<V_TB_ASK> GET_IS_COMPLETED_SEND1(List<V_TB_ASK> p_list,string lz) public static List<V_TB_ASK> GET_IS_COMPLETED_SEND1(List<V_TB_ASK> p_list, string lz)
{ {
using (ScpEntities db = EntitiesFactory.CreateScpInstance()) using (ScpEntities db = EntitiesFactory.CreateScpInstance())
{ {
@ -2122,7 +2122,7 @@ namespace CK.SCP.Controller
_buffer.Append($" WHERE Currency like '%{lz}%'"); _buffer.Append($" WHERE Currency like '%{lz}%'");
var _str = string.Format(_buffer.ToString(), string.Join("','", _ls.ToArray())); var _str = string.Format(_buffer.ToString(), string.Join("','", _ls.ToArray()));
var _list = db.Database.SqlQuery<string>(_str).ToList(); var _list = db.Database.SqlQuery<string>(_str).ToList();
var ll= p_list.Where(p => _list.Contains(p.AskBillNum)).ToList(); var ll = p_list.Where(p => _list.Contains(p.AskBillNum)).ToList();
return ll; return ll;
} }
@ -2211,7 +2211,7 @@ namespace CK.SCP.Controller
p_list.ForEach(itm => p_list.ForEach(itm =>
{ {
var maxtime = db.TB_ASN_DETAIL.Where(p=>p.PartCode==itm.PartCode&&p.State>-1).Select(t=>t.ProduceDate).Max(); var maxtime = db.TB_ASN_DETAIL.Where(p => p.PartCode == itm.PartCode && p.State > -1).Select(t => t.ProduceDate).Max();
itm.MaxTime = maxtime.ToString(); itm.MaxTime = maxtime.ToString();
groupList.ForEach(p => groupList.ForEach(p =>
@ -2650,9 +2650,9 @@ namespace CK.SCP.Controller
{ {
using (ScpEntities db = EntitiesFactory.CreateScpInstance()) using (ScpEntities db = EntitiesFactory.CreateScpInstance())
{ {
switch (p_state)
if (p_state == AskState.Close)
{ {
case AskState.Close:
var _ls = db.TB_ASK.Where(p => p_list.Contains(p.AskBillNum)).ToList(); var _ls = db.TB_ASK.Where(p => p_list.Contains(p.AskBillNum)).ToList();
if (_ls.Count > 0) if (_ls.Count > 0)
{ {
@ -2688,14 +2688,13 @@ namespace CK.SCP.Controller
_ret.Result = false; _ret.Result = false;
_ret.Message = "选择的记录,不能关闭!"; _ret.Message = "选择的记录,不能关闭!";
} }
} break;
if (p_state == AskState.Complete) case AskState.Complete:
var _ls1 = db.TB_ASK.Where(p => p_list.Contains(p.AskBillNum)).ToList();
int count1 = _ls1.Count(p => p.State == (int)AskState.Ship);
if (count1 == _ls1.Count && _ls1.Count > 0)
{ {
var _ls = db.TB_ASK.Where(p => p_list.Contains(p.AskBillNum)).ToList(); _ls1.ForEach(p =>
int count = _ls.Count(p => p.State == (int)AskState.Ship);
if (count == _ls.Count && _ls.Count > 0)
{
_ls.ForEach(p =>
{ {
var _asnlist = db.TB_ASN.Where(x => x.AskBillNum == p.AskBillNum && x.State == (int)AsnState.New).ToList(); var _asnlist = db.TB_ASN.Where(x => x.AskBillNum == p.AskBillNum && x.State == (int)AsnState.New).ToList();
if (_asnlist.Count > 0) if (_asnlist.Count > 0)
@ -2711,7 +2710,7 @@ namespace CK.SCP.Controller
} }
} }
); );
db.TB_ASK.AddOrUpdate(p => p.AskBillNum, _ls.ToArray()); db.TB_ASK.AddOrUpdate(p => p.AskBillNum, _ls1.ToArray());
} }
else else
{ {
@ -2719,14 +2718,13 @@ namespace CK.SCP.Controller
_ret.Result = false; _ret.Result = false;
_ret.Message = "选择的记录非已发货状态,不能关闭!"; _ret.Message = "选择的记录非已发货状态,不能关闭!";
} }
} break;
if (p_state == AskState.Confirm) case AskState.Confirm:
{ var _ls2 = db.TB_ASK.Where(p => p_list.Contains(p.AskBillNum)).ToList();
var _ls = db.TB_ASK.Where(p => p_list.Contains(p.AskBillNum)).ToList(); int count2 = _ls2.Count(p => p.State == (int)AskState.Release);
int count = _ls.Count(p => p.State == (int)AskState.Release); if (count2 == _ls2.Count && _ls2.Count > 0)
if (count == _ls.Count && _ls.Count > 0)
{ {
_ls.ForEach(p => _ls2.ForEach(p =>
{ {
p.State = (int)AskState.Confirm; p.State = (int)AskState.Confirm;
var _list = db.TB_ASK_DETAIL.Where(itm => itm.AskBillNum == p.AskBillNum).ToList(); var _list = db.TB_ASK_DETAIL.Where(itm => itm.AskBillNum == p.AskBillNum).ToList();
@ -2751,7 +2749,7 @@ namespace CK.SCP.Controller
#endregion #endregion
} }
); );
db.TB_ASK.AddOrUpdate(p => p.AskBillNum, _ls.ToArray()); db.TB_ASK.AddOrUpdate(p => p.AskBillNum, _ls2.ToArray());
} }
else else
{ {
@ -2759,14 +2757,13 @@ namespace CK.SCP.Controller
_ret.Result = false; _ret.Result = false;
_ret.Message = "选择的记录,有不是发布状态记录!"; _ret.Message = "选择的记录,有不是发布状态记录!";
} }
} break;
if (p_state == AskState.New) case AskState.New:
{ var _ls3 = db.TB_ASK.Where(p => p_list.Contains(p.AskBillNum)).ToList();
var _ls = db.TB_ASK.Where(p => p_list.Contains(p.AskBillNum)).ToList(); int count3 = _ls3.Count(p => p.State == (int)AskState.Release);
int count = _ls.Count(p => p.State == (int)AskState.Release); if (count3 == _ls3.Count && _ls3.Count > 0)
if (count == _ls.Count && _ls.Count > 0)
{ {
_ls.ForEach(p => _ls3.ForEach(p =>
{ {
p.State = (int)AskState.New; p.State = (int)AskState.New;
var _list = db.TB_ASK_DETAIL.Where(itm => itm.AskBillNum == p.AskBillNum).ToList(); var _list = db.TB_ASK_DETAIL.Where(itm => itm.AskBillNum == p.AskBillNum).ToList();
@ -2774,7 +2771,7 @@ namespace CK.SCP.Controller
db.TB_ASK_DETAIL.AddOrUpdate(itm => itm.UID, _list.ToArray()); db.TB_ASK_DETAIL.AddOrUpdate(itm => itm.UID, _list.ToArray());
} }
); );
db.TB_ASK.AddOrUpdate(p => p.AskBillNum, _ls.ToArray()); db.TB_ASK.AddOrUpdate(p => p.AskBillNum, _ls3.ToArray());
} }
else else
{ {
@ -2782,11 +2779,10 @@ namespace CK.SCP.Controller
_ret.Result = false; _ret.Result = false;
_ret.Message = "选择的记录,有不是发布状态记录!"; _ret.Message = "选择的记录,有不是发布状态记录!";
} }
} break;
if (p_state == AskState.Release) case AskState.Release:
{ var _ls4 = db.TB_ASK.Where(p => p_list.Contains(p.AskBillNum)).ToList();
var _ls = db.TB_ASK.Where(p => p_list.Contains(p.AskBillNum)).ToList(); foreach (var mail in _ls4)
foreach (var mail in _ls)
{ {
TB_SUPPLIER_MAIL mall = new TB_SUPPLIER_MAIL(); TB_SUPPLIER_MAIL mall = new TB_SUPPLIER_MAIL();
mall.State = 0; mall.State = 0;
@ -2795,10 +2791,10 @@ namespace CK.SCP.Controller
mall.Email = mail.PoBillNum; mall.Email = mail.PoBillNum;
db.TB_SUPPLIER_MAIL.Add(mall); db.TB_SUPPLIER_MAIL.Add(mall);
} }
int count = _ls.Count(p => p.State == (int)AskState.New); int count4 = _ls4.Count(p => p.State == (int)AskState.New);
if (count > 0) if (count4 > 0)
{ {
_ls.ForEach(p => _ls4.ForEach(p =>
{ {
p.State = (int)AskState.Release; p.State = (int)AskState.Release;
var _list = db.TB_ASK_DETAIL.Where(itm => itm.AskBillNum == p.AskBillNum).ToList(); var _list = db.TB_ASK_DETAIL.Where(itm => itm.AskBillNum == p.AskBillNum).ToList();
@ -2811,7 +2807,7 @@ namespace CK.SCP.Controller
} }
); );
db.TB_ASK.AddOrUpdate(p => p.AskBillNum, _ls.ToArray()); db.TB_ASK.AddOrUpdate(p => p.AskBillNum, _ls4.ToArray());
} }
else else
{ {
@ -2819,14 +2815,13 @@ namespace CK.SCP.Controller
_ret.Result = false; _ret.Result = false;
_ret.Message = "选择的记录,有不是新建状态记录!"; _ret.Message = "选择的记录,有不是新建状态记录!";
} }
} break;
if (p_state == AskState.Reject) case AskState.Reject:
{ var _ls5 = db.TB_ASK.Where(p => p_list.Contains(p.AskBillNum)).ToList();
var _ls = db.TB_ASK.Where(p => p_list.Contains(p.AskBillNum)).ToList(); int count5 = _ls5.Count(p => p.State == (int)AskState.New || p.State == (int)AskState.Release);
int count = _ls.Count(p => p.State == (int)AskState.New || p.State == (int)AskState.Release); if (count5 == _ls5.Count && _ls5.Count > 0)
if (count == _ls.Count && _ls.Count > 0)
{ {
_ls.ForEach(p => _ls5.ForEach(p =>
{ {
p.State = (int)AskState.Reject; p.State = (int)AskState.Reject;
p.IsDeleted = true; p.IsDeleted = true;
@ -2844,7 +2839,7 @@ namespace CK.SCP.Controller
//#endregion //#endregion
} }
); );
db.TB_ASK.AddOrUpdate(p => p.AskBillNum, _ls.ToArray()); db.TB_ASK.AddOrUpdate(p => p.AskBillNum, _ls5.ToArray());
} }
else else
{ {
@ -2852,15 +2847,13 @@ namespace CK.SCP.Controller
_ret.Result = false; _ret.Result = false;
_ret.Message = "选择的记录,有不是新建或发布状态记录!"; _ret.Message = "选择的记录,有不是新建或发布状态记录!";
} }
break;
} case AskState.CompleteForce:
if (p_state == AskState.CompleteForce) var _ls6 = db.TB_ASK.Where(p => p_list.Contains(p.AskBillNum) && p.IsDeleted == false).ToList();
{ int count6 = _ls6.Count(p => p.State == (int)AskState.Confirm || p.State == (int)AskState.Ship);
var _ls = db.TB_ASK.Where(p => p_list.Contains(p.AskBillNum) && p.IsDeleted == false).ToList(); if (count6 == _ls6.Count && _ls6.Count > 0)
int count = _ls.Count(p => p.State == (int)AskState.Confirm || p.State == (int)AskState.Ship);
if (count == _ls.Count && _ls.Count > 0)
{ {
_ls.ForEach(p => _ls6.ForEach(p =>
{ {
if (p.State == (int)AskState.Complete) if (p.State == (int)AskState.Complete)
{ {
@ -2906,7 +2899,7 @@ namespace CK.SCP.Controller
db.TB_ASK_DETAIL.AddOrUpdate(itm => itm.UID, _list.ToArray()); db.TB_ASK_DETAIL.AddOrUpdate(itm => itm.UID, _list.ToArray());
} }
); );
db.TB_ASK.AddOrUpdate(p => p.AskBillNum, _ls.ToArray()); db.TB_ASK.AddOrUpdate(p => p.AskBillNum, _ls6.ToArray());
} }
else else
{ {
@ -2914,15 +2907,13 @@ namespace CK.SCP.Controller
_ret.Result = false; _ret.Result = false;
_ret.Message = "选择的记录,有不是【已确认】或【已发货】状态,【发布状态】请用取消发布或看板作废!"; _ret.Message = "选择的记录,有不是【已确认】或【已发货】状态,【发布状态】请用取消发布或看板作废!";
} }
break;
} case AskState.Receive:
if (p_state == AskState.Receive) var _ls7 = db.TB_ASK.Where(p => p_list.Contains(p.AskBillNum)).ToList();
{ int count7 = _ls7.Count(p => p.State == (int)AskState.New || p.State == (int)AskState.Release);
var _ls = db.TB_ASK.Where(p => p_list.Contains(p.AskBillNum)).ToList(); if (count7 > 0)
int count = _ls.Count(p => p.State == (int)AskState.New || p.State == (int)AskState.Release);
if (count > 0)
{ {
_ls.ForEach(p => _ls7.ForEach(p =>
{ {
p.State = (int)AskState.Receive; p.State = (int)AskState.Receive;
var _list = db.TB_ASK_DETAIL.Where(itm => itm.AskBillNum == p.AskBillNum).ToList(); var _list = db.TB_ASK_DETAIL.Where(itm => itm.AskBillNum == p.AskBillNum).ToList();
@ -2935,7 +2926,7 @@ namespace CK.SCP.Controller
db.TB_ASK_DETAIL.AddOrUpdate(itm => itm.UID, _list.ToArray()); db.TB_ASK_DETAIL.AddOrUpdate(itm => itm.UID, _list.ToArray());
} }
); );
db.TB_ASK.AddOrUpdate(p => p.AskBillNum, _ls.ToArray()); db.TB_ASK.AddOrUpdate(p => p.AskBillNum, _ls7.ToArray());
} }
else else
{ {
@ -2943,12 +2934,10 @@ namespace CK.SCP.Controller
_ret.Result = false; _ret.Result = false;
_ret.Message = "选择的记录,有不是新建或发布状态记录!"; _ret.Message = "选择的记录,有不是新建或发布状态记录!";
} }
break;
} case AskState.NoConfirm:
if (p_state == AskState.NoConfirm) var _ls8 = db.TB_ASN.Where(p => p_list.Contains(p.AskBillNum) && p.IsDeleted == false).ToList();
{ if (_ls8.Count == 0)
var _ls = db.TB_ASN.Where(p => p_list.Contains(p.AskBillNum) && p.IsDeleted == false).ToList();
if (_ls.Count == 0)
{ {
var _askList = db.TB_ASK.Where(p => p_list.Contains(p.AskBillNum) && p.IsDeleted == false).ToList(); var _askList = db.TB_ASK.Where(p => p_list.Contains(p.AskBillNum) && p.IsDeleted == false).ToList();
_askList.ForEach(p => _askList.ForEach(p =>
@ -2971,6 +2960,7 @@ namespace CK.SCP.Controller
_ret.Result = false; _ret.Result = false;
_ret.Message = "选择的记录已经有发货单据不能取消!"; _ret.Message = "选择的记录已经有发货单据不能取消!";
} }
break;
} }
if (string.IsNullOrEmpty(_ret.Message)) if (string.IsNullOrEmpty(_ret.Message))
{ {

83
SCP/Common/MailHelper.cs

@ -10,6 +10,7 @@ using System.Text;
using CK.SCP.Utils; using CK.SCP.Utils;
using System.Configuration; using System.Configuration;
using static CK.SCP.UniApi.Controller.MailController; using static CK.SCP.UniApi.Controller.MailController;
using MailKit.Security;
namespace SCP.Common namespace SCP.Common
{ {
@ -59,6 +60,7 @@ namespace SCP.Common
{ {
mails = mails.Substring(0, mails.Length - 1); mails = mails.Substring(0, mails.Length - 1);
} }
string mailbody = ""; string mailbody = "";
mailbody += "尊敬的供应商<br>"; mailbody += "尊敬的供应商<br>";
mailbody += "你好!<br><br>"; mailbody += "你好!<br><br>";
@ -295,5 +297,86 @@ namespace SCP.Common
} }
} }
public static void ASKSendMail(string p_VendId, string p_Content, string p_title, string p_site)
{
try
{
List<String> result = new List<String>();
using (AppBoxContext db = EntitiesFactory.CreateAppBoxInstance())
{
StringBuilder _buffer = new StringBuilder();
_buffer.Append("SELECT b.Email ");
_buffer.Append(" FROM VenderUsers AS a INNER JOIN ");
_buffer.Append(" Users AS b ON a.UserId = b.ID INNER JOIN ");
_buffer.Append(" FactoryUsers AS c ON a.UserId = c.UserID INNER JOIN ");
_buffer.Append(" TA_FACTORY AS d ON c.FACTORY_ID = d.ID INNER JOIN ");
_buffer.Append(" Users AS f ON c.UserID = f.ID INNER JOIN ");
_buffer.Append(" RoleUsers AS g ON a.UserId = g.UserID INNER JOIN ");
_buffer.Append(" Roles AS h ON g.RoleID = h.ID ");
_buffer.AppendFormat(" WHERE(h.Name = '供应商' and a.VenderId='{0}' and d.FactoryId='{1}' ) ", p_VendId, p_site);
var _userList = db.Database.SqlQuery<string>(_buffer.ToString()).ToList();
if (_userList != null && _userList.Count > 0)
{
foreach (var itm in _userList)
{
if (itm.Contains('@'))
{
using (ScpEntities dbb = EntitiesFactory.CreateScpInstance())
{
string[] arr = itm.Split('@');
string vendid = arr[0];
var vend = dbb.TA_VENDER.FirstOrDefault(p => p.VendId == vendid);
if (vend != null)
{
break;
}
}
}
string mails = "";
mails += itm + ",";
if (mails != "")
{
mails = mails.Substring(0, mails.Length - 1);
result.Add(mails);
}
}
}
}
var toMail = result;
string mailbody = "";
mailbody += "尊敬的供应商<br>";
mailbody += "你好!<br><br>";
mailbody += "<b>" + p_Content + "</b> ," + ConfigurationManager.AppSettings["ResetPassWord"] + "<br>";
mailbody += "<br><br><br><br>日期:" + DateTime.Now;
List<EmailAddress> toList = new List<EmailAddress>();
foreach (var em1 in toMail)
{
EmailAddress add = new EmailAddress(em1, em1);
toList.Add(add);
}
var smtpMailSender = new MailKitMailSender(SecureSocketOptions.StartTls);
smtpMailSender.BuildMessage(
toList,
p_title,
mailbody,
"BCC"
);
smtpMailSender.Send();
LogHelper.Writlog(LogHelper.LogType.Debug, typeof(MailManager), "ASKSendMail", "发送成功");
}
catch (Exception e)
{
LogHelper.Writlog(LogHelper.LogType.Error, typeof(MailManager), "ASKSendMail", e.Message);
throw e;
}
}
} }
} }

11
SCP/Views/PlanData/SCP_ASK_DETAIL.aspx.cs

@ -253,6 +253,8 @@ namespace SCP.PlanData
{ {
var _ask = Session["Ask"] as V_TB_ASK; var _ask = Session["Ask"] as V_TB_ASK;
var ret = SCP_ASK_CONTROLLER.Save_TB_ASK_STATE(new List<string>() { _ask.AskBillNum }, p_state); var ret = SCP_ASK_CONTROLLER.Save_TB_ASK_STATE(new List<string>() { _ask.AskBillNum }, p_state);
try
{
if (ret.State == ReturnStatus.Succeed) if (ret.State == ReturnStatus.Succeed)
{ {
switch (p_state) switch (p_state)
@ -262,8 +264,9 @@ namespace SCP.PlanData
{ {
if (CurrentUser.FactoryList != null && CurrentUser.FactoryList.Count > 0) if (CurrentUser.FactoryList != null && CurrentUser.FactoryList.Count > 0)
{ {
SCP.Common.MailManager.SendMail(_ask.VendId, string.Format("发布了新的要货看板编号{0}", _ask.AskBillNum), string.Format("新的要货单信息{0}", _ask.AskBillNum), CurrentUser.FactoryList.FirstOrDefault()); SCP.Common.MailManager.ASKSendMail(_ask.VendId, string.Format("发布了新的要货看板编号{0}", _ask.AskBillNum), string.Format("新的要货单信息{0}", _ask.AskBillNum), CurrentUser.FactoryList.FirstOrDefault());
//SCP.Common.MailManager.GetPoMailList(); //SCP.Common.MailManager.GetPoMailList();
} }
} }
Alert.Show(p_msg); Alert.Show(p_msg);
@ -309,6 +312,12 @@ namespace SCP.PlanData
Alert.Show(ret.Message); Alert.Show(ret.Message);
} }
} }
catch(Exception ex)
{
Alert.Show(ex.Message);
}
}
} }
protected void Grid_V_TB_ASK_DETAIL_PageIndexChange(object sender, GridPageEventArgs e) protected void Grid_V_TB_ASK_DETAIL_PageIndexChange(object sender, GridPageEventArgs e)

138
SCP/Web.config

@ -1,34 +1,28 @@
<?xml version="1.0"?> <?xml version="1.0" encoding="utf-8"?>
<!-- <!--
有关如何配置 ASP.NET 应用程序的详细信息,请访问 有关如何配置 ASP.NET 应用程序的详细信息,请访问
https://go.microsoft.com/fwlink/?LinkId=169433 https://go.microsoft.com/fwlink/?LinkId=169433
--> -->
<configuration> <configuration>
<configSections> <configSections>
<section name="FineUI" type="FineUI.ConfigSection, FineUI" requirePermission="false"/> <section name="FineUI" type="FineUI.ConfigSection, FineUI" requirePermission="false" />
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/> <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 --> <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
</configSections> </configSections>
<appSettings> <appSettings>
<add key="MailSender" value="wuliu@faway.com"/> <!--<add key="MailSender" value="3264161989@qq.com"/>
<add key="MailServer" value="smtp.partner.outlook.cn"/> <add key="MailServer" value="smtp.qq.com"/>
<add key="MailUserName" value="wuliu@faway.com"/> <add key="MailUserName" value="3264161989@qq.com"/>
<add key="MailPassword" value="BTL1234@12aa"/> <add key="MailPassword" value="bsvdsyyhsonjchgh"/>
<add key="MailPort" value="587"/> <add key="MailPort" value="587"/>
<add key="ResetPassWord" value="http://123.150.38.30:8091"/>
<!--<add key="MailSender" value="scp@fs-cockpit.com"/>
<add key="MailServer" value="smtp.partner.outlook.cn"/>
<add key="MailUserName" value="scp@fs-cockpit.com"/>
<add key="MailPassword" value="Law73743"/>
<add key="MailPort" value="587"/>
<add key="ResetPassWord" value="http://192.168.0.101:8081" />-->
<!--发邮件配置开始-->
<!--<add key="MailSender" value="qcjscp@fawayqcj.com"/>
<add key="MailServer" value="smtp.exmail.qq.com"/>
<add key="MailUserName" value="qcjscp@fawayqcj.com"/>
<add key="MailPassword" value="ZdmcwmoUP66MKkQ2"/>
<add key="MailPort" value="25"/>
<add key="ResetPassWord" value="localhost:5678" />--> <add key="ResetPassWord" value="localhost:5678" />-->
<!--发邮件配置开始-->
<add key="MailSender" value="qcjscp@fawayqcj.com" />
<add key="MailServer" value="smtp.exmail.qq.com" />
<add key="MailUserName" value="qcjscp@fawayqcj.com" />
<add key="MailPassword" value="ZdmcwmoUP66MKkQ2" />
<add key="MailPort" value="25" />
<add key="ResetPassWord" value="localhost:5678" />
<!--<add key="MailSender" value="scp@jinhengairbag.com" /> <!--<add key="MailSender" value="scp@jinhengairbag.com" />
<add key="MailServer" value="smtp.qiye.aliyun.com" /> <add key="MailServer" value="smtp.qiye.aliyun.com" />
<add key="MailUserName" value="scp@jinhengairbag.com" /> <add key="MailUserName" value="scp@jinhengairbag.com" />
@ -49,25 +43,25 @@
<add key="MailPort" value="25"/> <add key="MailPort" value="25"/>
<add key="ResetPassWord" value="localhost:5678" />--> <add key="ResetPassWord" value="localhost:5678" />-->
<!--发邮件配置结束--> <!--发邮件配置结束-->
<add key="AppBoxDbUser" value="sa"/> <add key="AppBoxDbUser" value="sa" />
<add key="AppBoxDbPassword" value="5E0AFEB85CA001A3371A9F19E7EC4DFF"/> <add key="AppBoxDbPassword" value="5E0AFEB85CA001A3371A9F19E7EC4DFF" />
<!--测试服务器数据库--> <!--测试服务器数据库-->
<!-- <add key="AppBoxDbServer" value="10.1.1.13" />--> <!-- <add key="AppBoxDbServer" value="10.1.1.13" />-->
<!--本机数据库--> <!--本机数据库-->
<add key="AppBoxDbServer" value="."/> <add key="AppBoxDbServer" value="." />
<add key="AppBoxDbPort" value="1433"/> <add key="AppBoxDbPort" value="1433" />
<add key="AppBoxDbName" value="SCPAppBox"/> <add key="AppBoxDbName" value="SCPAppBox" />
<add key="SCPDbUser" value="sa"/> <add key="SCPDbUser" value="sa" />
<add key="SCPDbPassword" value="5E0AFEB85CA001A3371A9F19E7EC4DFF"/> <add key="SCPDbPassword" value="5E0AFEB85CA001A3371A9F19E7EC4DFF" />
<!--测试服务器数据库--> <!--测试服务器数据库-->
<!-- <add key="MesDbServer" value="10.1.6.74" />--> <!-- <add key="MesDbServer" value="10.1.6.74" />-->
<!--本机数据库--> <!--本机数据库-->
<add key="SCPDbServer" value="."/> <add key="SCPDbServer" value="." />
<add key="SCPDbPort" value="1433"/> <add key="SCPDbPort" value="1433" />
<add key="SCPDbName" value="ChangKeTecSCP"/> <add key="SCPDbName" value="ChangKeTecSCP" />
<add key="SCP_TIME_OUT" value="120"/> <add key="SCP_TIME_OUT" value="120" />
</appSettings> </appSettings>
<FineUI DebugMode="true" Theme="Gray"/> <FineUI DebugMode="true" Theme="Gray" />
<!-- <!--
有关 web.config 更改的说明,请参见 http://go.microsoft.com/fwlink/?LinkId=235367。 有关 web.config 更改的说明,请参见 http://go.microsoft.com/fwlink/?LinkId=235367。
@ -77,35 +71,35 @@
</system.Web> </system.Web>
--> -->
<system.web> <system.web>
<sessionState mode="InProc" timeout="120"/> <sessionState mode="InProc" timeout="120" />
<httpModules> <httpModules>
<add name="FineUIScriptModule" type="FineUI.ScriptModule, FineUI"/> <add name="FineUIScriptModule" type="FineUI.ScriptModule, FineUI" />
</httpModules> </httpModules>
<httpHandlers> <httpHandlers>
<add verb="GET" path="res.axd" type="FineUI.ResourceHandler, FineUI" validate="false"/> <add verb="GET" path="res.axd" type="FineUI.ResourceHandler, FineUI" validate="false" />
</httpHandlers> </httpHandlers>
<!-- <httpRuntime maxRequestLength="102400 " />--> <!-- <httpRuntime maxRequestLength="102400 " />-->
<httpRuntime executionTimeout="120" maxRequestLength="204800" useFullyQualifiedRedirectUrl="false" minFreeThreads="8" minLocalRequestFreeThreads="4" appRequestQueueLimit="100" enableVersionHeader="false"/> <httpRuntime executionTimeout="120" maxRequestLength="204800" useFullyQualifiedRedirectUrl="false" minFreeThreads="8" minLocalRequestFreeThreads="4" appRequestQueueLimit="100" enableVersionHeader="false" />
<customErrors mode="Off"/> <customErrors mode="Off" />
<authentication mode="Forms"> <authentication mode="Forms">
<forms name=".APPBOX_FORMS_AUTH" loginUrl="~/default.aspx" timeout="3" defaultUrl="~/main.aspx" protection="All" path="/"/> <forms name=".APPBOX_FORMS_AUTH" loginUrl="~/default_CYJ.aspx" timeout="3" defaultUrl="~/main.aspx" protection="All" path="/" />
</authentication> </authentication>
<authorization> <authorization>
<deny users="?"/> <deny users="?" />
</authorization> </authorization>
<compilation debug="true" targetFramework="4.5.2"> <compilation debug="true" targetFramework="4.5.2">
<assemblies> <assemblies>
<add assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> <add assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</assemblies> </assemblies>
</compilation> </compilation>
<!--<httpRuntime/>--> <!--<httpRuntime/>-->
<pages controlRenderingCompatibilityVersion="4.0" clientIDMode="AutoID"> <pages controlRenderingCompatibilityVersion="4.0" clientIDMode="AutoID">
<namespaces> <namespaces>
<add namespace="System.Web.Optimization"/> <add namespace="System.Web.Optimization" />
</namespaces> </namespaces>
<controls> <controls>
<add assembly="Microsoft.AspNet.Web.Optimization.WebForms" namespace="Microsoft.AspNet.Web.Optimization.WebForms" tagPrefix="webopt"/> <add assembly="Microsoft.AspNet.Web.Optimization.WebForms" namespace="Microsoft.AspNet.Web.Optimization.WebForms" tagPrefix="webopt" />
<add assembly="FineUI" namespace="FineUI" tagPrefix="f"/> <add assembly="FineUI" namespace="FineUI" tagPrefix="f" />
</controls> </controls>
</pages> </pages>
<!-- <httpModules>--> <!-- <httpModules>-->
@ -115,28 +109,28 @@
<runtime> <runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" culture="neutral" publicKeyToken="30ad4fe6b2a6aeed"/> <assemblyIdentity name="Newtonsoft.Json" culture="neutral" publicKeyToken="30ad4fe6b2a6aeed" />
<bindingRedirect oldVersion="0.0.0.0-10.0.0.0" newVersion="10.0.0.0"/> <bindingRedirect oldVersion="0.0.0.0-10.0.0.0" newVersion="10.0.0.0" />
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="WebGrease" culture="neutral" publicKeyToken="31bf3856ad364e35"/> <assemblyIdentity name="WebGrease" culture="neutral" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="0.0.0.0-1.5.2.14234" newVersion="1.5.2.14234"/> <bindingRedirect oldVersion="0.0.0.0-1.5.2.14234" newVersion="1.5.2.14234" />
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="EntityFramework" publicKeyToken="b77a5c561934e089" culture="neutral"/> <assemblyIdentity name="EntityFramework" publicKeyToken="b77a5c561934e089" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0"/> <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="FineUI" publicKeyToken="0ff1835d01c384a9" culture="neutral"/> <assemblyIdentity name="FineUI" publicKeyToken="0ff1835d01c384a9" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.1.0" newVersion="6.0.1.0"/> <bindingRedirect oldVersion="0.0.0.0-6.0.1.0" newVersion="6.0.1.0" />
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="NPOI" publicKeyToken="0df73ec7942b34e1" culture="neutral"/> <assemblyIdentity name="NPOI" publicKeyToken="0df73ec7942b34e1" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.1.1.0" newVersion="2.1.1.0"/> <bindingRedirect oldVersion="0.0.0.0-2.1.1.0" newVersion="2.1.1.0" />
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="EPPlus" publicKeyToken="ea159fdaa78159a1" culture="neutral"/> <assemblyIdentity name="EPPlus" publicKeyToken="ea159fdaa78159a1" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.5.2.1" newVersion="4.5.2.1"/> <bindingRedirect oldVersion="0.0.0.0-4.5.2.1" newVersion="4.5.2.1" />
</dependentAssembly> </dependentAssembly>
</assemblyBinding> </assemblyBinding>
</runtime> </runtime>
@ -150,14 +144,14 @@
<location path="res"> <location path="res">
<system.web> <system.web>
<authorization> <authorization>
<allow users="*"/> <allow users="*" />
</authorization> </authorization>
</system.web> </system.web>
</location> </location>
<location path="extjs"> <location path="extjs">
<system.web> <system.web>
<authorization> <authorization>
<allow users="*"/> <allow users="*" />
</authorization> </authorization>
</system.web> </system.web>
</location> </location>
@ -165,26 +159,26 @@
<system.webServer> <system.webServer>
<httpProtocol> <httpProtocol>
<customHeaders> <customHeaders>
<add name="X-Content-Type-Options" value="nosniff"/> <add name="X-Content-Type-Options" value="nosniff" />
<add name="X-XSS-Protection" value="1"/> <add name="X-XSS-Protection" value="1" />
</customHeaders> </customHeaders>
</httpProtocol> </httpProtocol>
<security> <security>
<!--<requestFiltering allowDoubleEscaping="true"/>--> <!--<requestFiltering allowDoubleEscaping="true"/>-->
<requestFiltering allowDoubleEscaping="true"> <requestFiltering allowDoubleEscaping="true">
<requestLimits maxAllowedContentLength="2147483647"/> <requestLimits maxAllowedContentLength="2147483647" />
</requestFiltering> </requestFiltering>
</security> </security>
<validation validateIntegratedModeConfiguration="false"/> <validation validateIntegratedModeConfiguration="false" />
<modules> <modules>
<remove name="FineUIScriptModule"/> <remove name="FineUIScriptModule" />
<add name="FineUIScriptModule" preCondition="managedHandler" type="FineUI.ScriptModule, FineUI"/> <add name="FineUIScriptModule" preCondition="managedHandler" type="FineUI.ScriptModule, FineUI" />
</modules> </modules>
<handlers> <handlers>
<add name="FineUIResourceHandler" verb="GET" path="res.axd" type="FineUI.ResourceHandler, FineUI"/> <add name="FineUIResourceHandler" verb="GET" path="res.axd" type="FineUI.ResourceHandler, FineUI" />
</handlers> </handlers>
<staticContent> <staticContent>
<mimeMap fileExtension=".grf" mimeType="grf/gridreport"/> <mimeMap fileExtension=".grf" mimeType="grf/gridreport" />
</staticContent> </staticContent>
</system.webServer> </system.webServer>
<entityFramework> <entityFramework>
@ -194,29 +188,29 @@
</parameters> </parameters>
</defaultConnectionFactory>--> </defaultConnectionFactory>-->
<providers> <providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer"/> <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
</providers> </providers>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework"> <defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
<parameters> <parameters>
<parameter value="mssqllocaldb"/> <parameter value="mssqllocaldb" />
</parameters> </parameters>
</defaultConnectionFactory> </defaultConnectionFactory>
</entityFramework> </entityFramework>
<system.codedom> <system.codedom>
<compilers> <compilers>
<compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:6 /nowarn:1659;1699;1701"/> <compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:6 /nowarn:1659;1699;1701" />
<compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:14 /nowarn:41008 /define:_MYTYPE=\&quot;Web\&quot; /optionInfer+"/> <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:14 /nowarn:41008 /define:_MYTYPE=\&quot;Web\&quot; /optionInfer+" />
</compilers> </compilers>
</system.codedom> </system.codedom>
<system.serviceModel> <system.serviceModel>
<bindings> <bindings>
<basicHttpBinding> <basicHttpBinding>
<binding name="JsonServiceSoap"/> <binding name="JsonServiceSoap" />
</basicHttpBinding> </basicHttpBinding>
<customBinding> <customBinding>
<binding name="JsonServiceSoap12"> <binding name="JsonServiceSoap12">
<textMessageEncoding messageVersion="Soap12"/> <textMessageEncoding messageVersion="Soap12" />
<httpTransport/> <httpTransport />
</binding> </binding>
</customBinding> </customBinding>
</bindings> </bindings>

4
SCP/packages.config

@ -13,6 +13,7 @@
<package id="FineUI" version="6.0.1" targetFramework="net452" /> <package id="FineUI" version="6.0.1" targetFramework="net452" />
<package id="jQuery" version="1.10.2" targetFramework="net452" /> <package id="jQuery" version="1.10.2" targetFramework="net452" />
<package id="knockoutjs" version="3.4.2" targetFramework="net452" /> <package id="knockoutjs" version="3.4.2" targetFramework="net452" />
<package id="MailKit" version="3.1.0" targetFramework="net452" />
<package id="Microsoft.ApplicationInsights" version="2.2.0" targetFramework="net452" /> <package id="Microsoft.ApplicationInsights" version="2.2.0" targetFramework="net452" />
<package id="Microsoft.ApplicationInsights.Agent.Intercept" version="2.0.6" targetFramework="net452" /> <package id="Microsoft.ApplicationInsights.Agent.Intercept" version="2.0.6" targetFramework="net452" />
<package id="Microsoft.ApplicationInsights.DependencyCollector" version="2.2.0" targetFramework="net452" /> <package id="Microsoft.ApplicationInsights.DependencyCollector" version="2.2.0" targetFramework="net452" />
@ -32,9 +33,12 @@
<package id="Microsoft.Net.Compilers" version="1.3.2" targetFramework="net452" developmentDependency="true" /> <package id="Microsoft.Net.Compilers" version="1.3.2" targetFramework="net452" developmentDependency="true" />
<package id="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" version="1.10.9" targetFramework="net452" /> <package id="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" version="1.10.9" targetFramework="net452" />
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net452" /> <package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net452" />
<package id="MimeKit" version="3.1.0" targetFramework="net452" />
<package id="Modernizr" version="2.6.2" targetFramework="net452" /> <package id="Modernizr" version="2.6.2" targetFramework="net452" />
<package id="NPOI" version="2.3.0" targetFramework="net452" /> <package id="NPOI" version="2.3.0" targetFramework="net452" />
<package id="Portable.BouncyCastle" version="1.9.0" targetFramework="net452" />
<package id="Respond" version="1.2.0" targetFramework="net452" /> <package id="Respond" version="1.2.0" targetFramework="net452" />
<package id="SharpZipLib" version="0.86.0" targetFramework="net452" /> <package id="SharpZipLib" version="0.86.0" targetFramework="net452" />
<package id="System.Buffers" version="4.5.1" targetFramework="net452" />
<package id="WebGrease" version="1.5.2" targetFramework="net452" /> <package id="WebGrease" version="1.5.2" targetFramework="net452" />
</packages> </packages>

28
UniApiGroup/App.config

@ -1,38 +1,38 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<configuration> <configuration>
<configSections> <configSections>
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/> <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> <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --></configSections>
<appSettings> <appSettings>
<add key="MailSender" value="scp@jinhengairbag.com"/> <add key="MailSender" value="scp@jinhengairbag.com" />
<add key="MailServer" value="smtp.qiye.aliyun.com"/> <add key="MailServer" value="smtp.qiye.aliyun.com" />
<add key="MailUserName" value="scp@jinhengairbag.com"/> <add key="MailUserName" value="scp@jinhengairbag.com" />
<add key="MailPassword" value="SCPscp2020"/> <add key="MailPassword" value="SCPscp2020" />
<add key="MailPort" value="25"/> <add key="MailPort" value="25" />
</appSettings> </appSettings>
<startup> <startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2"/> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
</startup> </startup>
<entityFramework> <entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework"> <defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
<parameters> <parameters>
<parameter value="mssqllocaldb"/> <parameter value="mssqllocaldb" />
</parameters> </parameters>
</defaultConnectionFactory> </defaultConnectionFactory>
<providers> <providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer"/> <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
</providers> </providers>
</entityFramework> </entityFramework>
<runtime> <runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="EntityFramework" publicKeyToken="b77a5c561934e089" culture="neutral"/> <assemblyIdentity name="EntityFramework" publicKeyToken="b77a5c561934e089" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0"/> <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="EPPlus" publicKeyToken="ea159fdaa78159a1" culture="neutral"/> <assemblyIdentity name="EPPlus" publicKeyToken="ea159fdaa78159a1" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.5.2.1" newVersion="4.5.2.1"/> <bindingRedirect oldVersion="0.0.0.0-4.5.2.1" newVersion="4.5.2.1" />
</dependentAssembly> </dependentAssembly>
</assemblyBinding> </assemblyBinding>
</runtime> </runtime>

Loading…
Cancel
Save