51 lines
1.7 KiB
C#
51 lines
1.7 KiB
C#
using System;
|
|
using WX.CRM.BLL.Wx;
|
|
using WX.CRM.Common;
|
|
using WX.CRM.DataSynFactory.Templates;
|
|
|
|
namespace WX.CRM.DataSynFactory.Cmd
|
|
{
|
|
public class Client_PayReject_IMP : Interfaces.IDataImportSvr<Client_PayReject>
|
|
{
|
|
private WX_SZZYORDER_BL _order = new WX_SZZYORDER_BL();
|
|
private WX_SZZYORDERPAY_BL _orderPay = new WX_SZZYORDERPAY_BL();
|
|
public bool GenerateBusinessOne(Client_PayReject t)
|
|
{
|
|
try
|
|
{
|
|
var orderPay = _orderPay.Get(p => p.SID == t.Id);
|
|
orderPay.AUDITSTATUS = t.Status;
|
|
orderPay.AUDITOR = t.UserId;
|
|
orderPay.AUDITORNAME = t.UserName;
|
|
orderPay.AUDITTIME = DateTime.Now;
|
|
orderPay.REJECTREMARK = t.RejectRemark;
|
|
|
|
var order = _order.Get(p => p.ORDERID == orderPay.ORDERID);
|
|
if (order != null)
|
|
{
|
|
if (order.ORDERSTATUS == "180" || order.ORDERSTATUS == "190" || order.ORDERSTATUS == "195")
|
|
{
|
|
order.ORDERSTATUS = "195";
|
|
order.ORDERSTATUSNAME = "支付驳回";
|
|
|
|
//减少支付金额
|
|
if (order.ARRIVALPAY >= orderPay.PAYPRICE)
|
|
{
|
|
order.ARRIVALPAY -= orderPay.PAYPRICE;
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
return _order.Update(order) && _orderPay.Update(orderPay);
|
|
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
LogHelper.Error("Client_PayReject,营业部入库失败:" + ex);
|
|
return false;
|
|
}
|
|
}
|
|
}
|
|
}
|