83 lines
3.1 KiB
C#
83 lines
3.1 KiB
C#
using System;
|
|
using System.Linq;
|
|
using WX.CRM.BLL.Csvr;
|
|
using WX.CRM.BLL.Res;
|
|
using WX.CRM.BLL.Util;
|
|
using WX.CRM.BLL.Wx;
|
|
using WX.CRM.Common;
|
|
using WX.CRM.DataSynFactory.Templates;
|
|
using WX.CRM.Model.Entity;
|
|
|
|
namespace WX.CRM.DataSynFactory.Cmd
|
|
{
|
|
public class Client_RejectContract_IMP : Interfaces.IDataImportSvr<Client_RejectContract>
|
|
{
|
|
private WX_SZZYORDER_BL _order = new WX_SZZYORDER_BL();
|
|
private RES_CUSTOMERDETAIL_BL _customer = new RES_CUSTOMERDETAIL_BL();
|
|
private CSVR_TODOITEM_BL _todoItem = new CSVR_TODOITEM_BL();
|
|
private CACHE_BL _cache = new CACHE_BL();
|
|
private ValidationErrors errors = new ValidationErrors();
|
|
public bool GenerateBusinessOne(Client_RejectContract t)
|
|
{
|
|
try
|
|
{
|
|
var orderId = decimal.Parse(t.OrderId.ToString());
|
|
var order = _order.Get(p => p.ORDERID == orderId);
|
|
order.RISKCTRLSTATUS = t.Status;
|
|
order.REJECTREMARK = t.RejectRemark;
|
|
if (!string.IsNullOrWhiteSpace(t.Name))
|
|
{
|
|
order.CNAME = t.Name;
|
|
|
|
var customer = _customer.Get(p => p.RESID == order.RESID);
|
|
if (customer != null)
|
|
{
|
|
customer.CNAME = t.Name;
|
|
_customer.Update(customer);
|
|
}
|
|
}
|
|
|
|
var res = _order.Update(order);
|
|
|
|
if (res)
|
|
{
|
|
#region 添加提醒
|
|
if (order.RISKCTRLSTATUS == -1)
|
|
{
|
|
var hgUsers = _cache.GetValue_Parameter(Model.Enum.Parameter.Sys_HG_Users);
|
|
var users = _cache.GetUserList();
|
|
var user10000 = users.Single(p => p.EID == 10000);
|
|
if (!string.IsNullOrEmpty(hgUsers))
|
|
{
|
|
var userArr = hgUsers.Split(',');
|
|
foreach (var item in userArr)
|
|
{
|
|
var todo = new CSVR_TODOITEM()
|
|
{
|
|
SENDEDUSERID = user10000.PKID,
|
|
RECEIVEDUSERID = decimal.Parse(item),
|
|
ISPRIVATE = 1,
|
|
MEMO = "订单号为:" + orderId + "的合同被驳回,具体查看驳回说明",
|
|
STARTTIME = DateTime.Now,
|
|
DOSTATUS = 0,
|
|
URL = "/WeiXin/JZOrder/OrderList",
|
|
URLTITLE = "订单列表"
|
|
};
|
|
_todoItem.Create(ref errors, todo);
|
|
}
|
|
}
|
|
}
|
|
#endregion
|
|
}
|
|
|
|
return res;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
LogHelper.Error(ex.ToString());
|
|
return false;
|
|
}
|
|
}
|
|
}
|
|
}
|