估值接收邮件发送处理
This commit is contained in:
@@ -234,7 +234,7 @@ namespace YLErp.Modules.ClientModule
|
||||
/// </summary>
|
||||
/// <param name="clientId"></param>
|
||||
/// <returns>多个邮件地址,用分号隔开</returns>
|
||||
public static IEnumerable<string> GetClientEmails(int clientId, bool includeClientMail = false, List<string> receiver = null)
|
||||
public static IEnumerable<string> GetClientEmails(int clientId, bool includeClientMail = false, List<string> receiver = null,bool isEodValue = false)
|
||||
{
|
||||
if (clientId < 1)
|
||||
{
|
||||
@@ -248,7 +248,7 @@ namespace YLErp.Modules.ClientModule
|
||||
&& (x.DeadLine == null || x.DeadLine > DateTime.Now)
|
||||
&& x.IsReceiveEmail == 1 && x.Email != null)
|
||||
.ToList();
|
||||
|
||||
|
||||
if (receiver != null && receiver.Count > 0)
|
||||
{
|
||||
foreach (var item in clientContacts)
|
||||
@@ -262,7 +262,22 @@ namespace YLErp.Modules.ClientModule
|
||||
}
|
||||
else
|
||||
{
|
||||
clientContactMails = clientContacts.Select(o => o.Email).ToList();
|
||||
if (isEodValue)
|
||||
{
|
||||
foreach (var item in clientContacts)
|
||||
{
|
||||
var ids = item.ContactTypeId.Split(',');
|
||||
//1 是估值接收人
|
||||
if (ids.Contains("1"))
|
||||
{
|
||||
clientContactMails.Add(item.Email);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
clientContactMails = clientContacts.Select(o => o.Email).ToList();
|
||||
}
|
||||
}
|
||||
|
||||
if (includeClientMail)
|
||||
|
||||
+1
-1
@@ -153,7 +153,7 @@ namespace YLErp.Modules.ReportModule.SettlementReportModule
|
||||
}
|
||||
}
|
||||
// 要向该客户的所有订阅了邮件通知的人员发送邮件
|
||||
var emails = ClientDataQueryService.GetClientEmails(report.client.id, false, recevier);
|
||||
var emails = ClientDataQueryService.GetClientEmails(report.client.id, false, recevier,true);
|
||||
var status = EmailTradeConfirmResultType.Succeed;
|
||||
if (emails.All(o => string.IsNullOrWhiteSpace(o)))
|
||||
{
|
||||
|
||||
@@ -590,7 +590,8 @@ namespace YLErp.Web.Controllers
|
||||
|
||||
public ViewResult TradeMarketClientSend(int clientid, double payablemargin = -1, double payableFund = -1, string reportType = "", bool ParentFlag = false)
|
||||
{
|
||||
ViewBag.emails = ClientDataQueryService.GetClientEmails(clientid, false);
|
||||
var isEodValue = true;
|
||||
ViewBag.emails = ClientDataQueryService.GetClientEmails(clientid, false,isEodValue:isEodValue);
|
||||
ViewBag.TradeMarketSheets = DBCacheManager.Single.GetStr(CacheTable.TradeMarketSheets);
|
||||
ViewBag.LuoKuanDesc = DBCacheManager.Single.GetStr(CacheTable.LuoKuanDesc);
|
||||
ViewBag.MarginLuoKuanDesc = DBCacheManager.Single.GetStr(CacheTable.MarginLuoKuanDesc);
|
||||
|
||||
@@ -173,7 +173,6 @@
|
||||
thisObj.Model.CCEmail = $("#CCEmail").val();
|
||||
|
||||
var template = $("#setTemplate").val();
|
||||
var receiver = ContractTypeCtrl.getValue();
|
||||
|
||||
var doneFunc = function (res) {
|
||||
if (!res || !res.obj) {
|
||||
@@ -187,13 +186,13 @@
|
||||
area: ["430px", "175px"],
|
||||
btn: ['使用', '不使用',"取消"],
|
||||
yes: function (index, layero) {
|
||||
main.post("/clientbalance/GenerateTradeMarketBill2", { emailData: thisObj.Model, skipOrNot: "Not", template: template, receiver: receiver})
|
||||
main.post("/clientbalance/GenerateTradeMarketBill2", { emailData: thisObj.Model, skipOrNot: "Not", template: template})
|
||||
.done(function () {
|
||||
layer.close(layerIndex);
|
||||
});
|
||||
},
|
||||
btn2: function (index, layero) {
|
||||
main.post("/clientbalance/GenerateTradeMarketBill2", { emailData: thisObj.Model, skipOrNot: "Skip", template: template, receiver: receiver })
|
||||
main.post("/clientbalance/GenerateTradeMarketBill2", { emailData: thisObj.Model, skipOrNot: "Skip", template: template })
|
||||
.done(function () {
|
||||
layer.close(layerIndex);
|
||||
});
|
||||
@@ -204,7 +203,7 @@
|
||||
});
|
||||
}
|
||||
}
|
||||
main.post("/clientbalance/GenerateTradeMarketBill2", { emailData: thisObj.Model, skipOrNot: "", template: template, receiver: receiver }).done(doneFunc);
|
||||
main.post("/clientbalance/GenerateTradeMarketBill2", { emailData: thisObj.Model, skipOrNot: "", template: template }).done(doneFunc);
|
||||
},
|
||||
close: function () {
|
||||
parent.layer.closeAll();
|
||||
@@ -334,7 +333,7 @@
|
||||
<div>
|
||||
<input class="btn btn-primary" type="button" value="保存" v-on:click="saveLuoKuan()" />
|
||||
<input class="btn btn-primary" type="button" value="导出" v-on:click="downloadFile()" />
|
||||
<input class="btn btn-primary" type="button" value="发送" v-on:click="sendEmail()" />
|
||||
<input class="btn btn-primary" type="button" value="发送" v-on:click="sendReport()" />
|
||||
<input class="btn btn-primary" type="button" value="取消" v-on:click="close()" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user