Browse Source

需求单No.139601

master
wugang 7 years ago
parent
commit
39dcaf1cdb
2 changed files with 59 additions and 15 deletions
  1. +47
    -14
      BWP.B3_YunKen.Web/Pages/WeixinMessage_/CusAcceptWeixinMessageTemplate.cs
  2. +12
    -1
      BWP.B3_YunKen/BLActions/CusrAcceptDoCheckSendWeixinMessage.cs

+ 47
- 14
BWP.B3_YunKen.Web/Pages/WeixinMessage_/CusAcceptWeixinMessageTemplate.cs View File

@ -35,25 +35,54 @@ namespace BWP.Web.Pages.WeixinMessage_
string allUnitNum = string.Empty;
string money = string.Empty;
string freightPrice = string.Empty;
if (cusAccept.BillType == dmoTypeId && cusAccept.BillID != null) {
if (cusAccept.BillType == dmoTypeId) {
var outbl = BIFactory.Create<ISaleOutStoreBL>();
var saleOutStore = outbl.Load(cusAccept.BillID.Value);
outCode = saleOutStore.Code;
dealer = saleOutStore.CustomerDealer_Name;
car_Name = saleOutStore.Car_Name;
freightUnitPrice = saleOutStore.FreightUnitPrice==null?string.Empty:saleOutStore.FreightUnitPrice.ToString();
driver_Name = saleOutStore.Driver_Name;
driverPhone = saleOutStore.DriverPhone;
allUnitNum = saleOutStore.AllUnitNum == null ? string.Empty : saleOutStore.AllUnitNum.ToString();
money = saleOutStore.Money == null ? string.Empty : saleOutStore.Money.ToString();
freightPrice = saleOutStore.FreightPrice == null ? string.Empty : saleOutStore.FreightPrice.ToString();
if (cusAccept.BillID != null) {
var saleOutStore = outbl.Load(cusAccept.BillID.Value);
outCode = saleOutStore.Code;
dealer = saleOutStore.CustomerDealer_Name;
car_Name = saleOutStore.Car_Name;
if (!string.IsNullOrEmpty(saleOutStore.Car_Name) && !string.IsNullOrEmpty(saleOutStore.HandcarNumber)) {
car_Name = saleOutStore.Car_Name + "/" + saleOutStore.HandcarNumber;
}
freightUnitPrice = saleOutStore.FreightUnitPrice == null ? string.Empty : saleOutStore.FreightUnitPrice.ToString();
driver_Name = saleOutStore.Driver_Name;
driverPhone = saleOutStore.DriverPhone;
if (!string.IsNullOrEmpty(saleOutStore.DriverPhone) && !string.IsNullOrEmpty(saleOutStore.DriverPhone1)) {
driverPhone = saleOutStore.DriverPhone + "/" + saleOutStore.DriverPhone1;
}
allUnitNum = saleOutStore.AllUnitNum == null ? string.Empty : saleOutStore.AllUnitNum.ToString();
money = saleOutStore.Money == null ? string.Empty : saleOutStore.Money.ToString();
freightPrice = saleOutStore.FreightPrice == null ? string.Empty : saleOutStore.FreightPrice.ToString();
} else {
outCode = cusAccept.BillIDs;
dealer = cusAccept.CustomerDealer_Name;
car_Name = cusAccept.Car_Name;
if (!string.IsNullOrEmpty(cusAccept.Car_Name) && !string.IsNullOrEmpty(cusAccept.HandcarNumber)) {
car_Name = cusAccept.Car_Name + "/" + cusAccept.HandcarNumber;
}
freightUnitPrice = cusAccept.FreightUnitPrice == null ? string.Empty : cusAccept.FreightUnitPrice.ToString();
driver_Name = cusAccept.Driver_Name;
driverPhone = cusAccept.DriverPhone;
if (!string.IsNullOrEmpty(cusAccept.DriverPhone) && !string.IsNullOrEmpty(cusAccept.DriverPhone1)) {
driverPhone = cusAccept.DriverPhone + "/" + cusAccept.DriverPhone1;
}
allUnitNum = cusAccept.AcceptNumber == null ? string.Empty : cusAccept.AcceptNumber.ToString();
money = cusAccept.Money == null ? string.Empty : cusAccept.Money.ToString();
freightPrice = cusAccept.FreightPrice == null ? string.Empty : cusAccept.FreightPrice.ToString();
}
}
var checkTime = cusAccept.CheckTime == null ? "" : cusAccept.CheckTime.Value.ToString();
var acceptNumber = cusAccept.AcceptNumber==null?string.Empty:cusAccept.AcceptNumber.ToString();
var acceptFreightUnitPrice = cusAccept.FreightUnitPrice==null?string.Empty:cusAccept.FreightUnitPrice.ToString();
var acceptMoney = cusAccept.Money==null?string.Empty:cusAccept.Money.ToString();
var acceptFreightPrice = cusAccept.FreightPrice==null?string.Empty:cusAccept.FreightPrice.ToString();
var employee_Name = cusAccept.Employee_Name;
var tel = string.Empty;
using (var context = new TransactionContext()) {
tel = InnerBLUtil.GetDmoPropertyByID<string>(context.Session, typeof(Employee), "HandPhone", cusAccept.Employee_ID ?? 0);
}
var html = @"
<article class=""weui-article"">
<h1>{title}</h1>
@ -64,7 +93,11 @@ namespace BWP.Web.Pages.WeixinMessage_
<tr><td></td><td colspan=""5"">{CustomerDealer_Name}</td></tr>
<tr><td></td><td colspan=""2"">{Car_Name}</td><td></td><td colspan=""2"">{FreightUnitPrice}</td></tr>
<tr><td></td><td colspan=""2"">{Driver_Name}</td><td></td><td colspan=""2"">{DriverPhone}</td></tr>
<tr><td></td><td>{AllUnitNum}</td><td></td><td>{Money}</td><td></td><td>{FreightPrice}</td></tr>
<tr><td>(kg)</td><td>{AllUnitNum}</td><td></td><td>{Money}</td><td></td><td>{FreightPrice}</td></tr>
</table>
<table border=""1"" cellspacing=""0"" style=""margin-top:10px;"">
<tr><td></td><td colspan=""2"">{Employee_Name}</td><td></td><td colspan=""2"">{Tel}</td></tr>
<tr><td></td><td colspan=""5""></td></tr>
</table>
<table border=""1"" cellspacing=""0"" style=""margin-top:10px;"">
<tr><td colspan=""3""></td><td></td><td colspan=""2"">{AcceptCode}</td></tr>
@ -78,7 +111,7 @@ namespace BWP.Web.Pages.WeixinMessage_
</article>
";
html = html.Replace("{title}", mMessage.Title);
html = html.Replace("{OutCode}", outCode).Replace("{AccountingUnit_Name}", cusAccept.AccountingUnit_Name).Replace("{CheckTime}", checkTime).Replace("{CustomerDealer_Name}", dealer).Replace("{Car_Name}", car_Name).Replace("{FreightUnitPrice}", freightUnitPrice).Replace("{Driver_Name}", driver_Name).Replace("{DriverPhone}", driverPhone).Replace("{AllUnitNum}", allUnitNum).Replace("{Money}", money).Replace("{FreightPrice}", freightPrice).Replace("{AcceptCode}", cusAccept.Code).Replace("{AcceptNumber}", acceptNumber).Replace("{AcceptFreightUnitPrice}", acceptFreightUnitPrice).Replace("{AcceptMoney}", acceptMoney).Replace("{AcceptFreightPrice}", acceptFreightPrice);
html = html.Replace("{OutCode}", outCode).Replace("{AccountingUnit_Name}", cusAccept.AccountingUnit_Name).Replace("{CheckTime}", checkTime).Replace("{CustomerDealer_Name}", dealer).Replace("{Car_Name}", car_Name).Replace("{FreightUnitPrice}", freightUnitPrice).Replace("{Driver_Name}", driver_Name).Replace("{DriverPhone}", driverPhone).Replace("{AllUnitNum}", allUnitNum).Replace("{Money}", money).Replace("{FreightPrice}", freightPrice).Replace("{AcceptCode}", cusAccept.Code).Replace("{AcceptNumber}", acceptNumber).Replace("{AcceptFreightUnitPrice}", acceptFreightUnitPrice).Replace("{AcceptMoney}", acceptMoney).Replace("{AcceptFreightPrice}", acceptFreightPrice).Replace("{Employee_Name}", employee_Name).Replace("{Tel}", tel);
if (cusAccept.Details.Count() > 0) {
var str = new StringBuilder();
foreach (var detail in cusAccept.Details) {


+ 12
- 1
BWP.B3_YunKen/BLActions/CusrAcceptDoCheckSendWeixinMessage.cs View File

@ -69,7 +69,18 @@ namespace BWP.B3_YunKen.BLActions
externalMessage.Receiver = userName;
externalMessage.Url = url;
externalMessage.Subject = message.Title;
externalMessage.Content = message.Title;
//string customerDealer_Name = string.Empty;
//if(accept.BillID!=null){
// var outbl = BIFactory.Create<ISaleOutStoreBL>(context);
// if (accept.BillID != null) {
// var saleOutStore = outbl.Load(accept.BillID.Value);
// customerDealer_Name = saleOutStore.CustomerDealer_Name;
// }else{
// customerDealer_Name = accept.CustomerDealer_Name;
// }
//}
var str = "发货工厂:" + accept.AccountingUnit_Name + " 发货时间:" + accept.CheckTime != null ? accept.CheckTime.Value.ToString() : string.Empty + " 客户名称:"+accept.CustomerDealer_Name+" 分销商:"+accept.AccountCustomer_Name+" 客户验收单号:"+accept.Code;
externalMessage.Content = str;
externalMessageBL.Insert(externalMessage);
}


Loading…
Cancel
Save