569 lines
24 KiB
C#
569 lines
24 KiB
C#
using System;
|
||
using System.Collections.Generic;
|
||
using System.Data;
|
||
using System.Data.Entity.Validation;
|
||
using System.Linq;
|
||
using WX.CRM.BLL.Base;
|
||
using WX.CRM.BLL.Util;
|
||
using WX.CRM.Common;
|
||
using WX.CRM.DAL.Res;
|
||
using WX.CRM.IBLL.Res;
|
||
using WX.CRM.Model.Entity;
|
||
using WX.CRM.Model.QueryMap;
|
||
using WX.CRM.BLL.Application.UserComBox;
|
||
|
||
namespace WX.CRM.BLL.Res
|
||
{
|
||
public class RES_DISTRIBUTE_BL : IRES_DISTRIBUTE, IRES_DISTRIBUTE_Q
|
||
{
|
||
RES_DISTRIBUTE_DAL _dal = new RES_DISTRIBUTE_DAL();
|
||
|
||
#region 添加
|
||
|
||
/// <summary>
|
||
/// 添加
|
||
/// </summary>
|
||
/// <param name="errors"></param>
|
||
/// <param name="model"></param>
|
||
/// <returns></returns>
|
||
public bool Create(ref ValidationErrors errors, WX.CRM.Model.Entity.RES_DISTRIBUTE model)
|
||
{
|
||
try
|
||
{
|
||
using (WX.CRM.Model.Entity.crmContext db = new WX.CRM.Model.Entity.crmContext())
|
||
{
|
||
model.PKID = new SEQUENCES_BL().Seq_base_get();
|
||
db.RES_DISTRIBUTE.Add(model);
|
||
return db.SaveChanges().GetResult();
|
||
}
|
||
}
|
||
catch (DbEntityValidationException dbEx)
|
||
{
|
||
var ex1 = dbEx.EntityValidationErrors.FirstOrDefault();
|
||
if (ex1 != null)
|
||
{
|
||
var ex2 = ex1.ValidationErrors.FirstOrDefault();
|
||
if (ex2 != null)
|
||
{
|
||
LogHelper.Error("ES_DISTRIBUTE.Create|ex2" + ex2.ErrorMessage.ToString());
|
||
errors.Add(ex2.ErrorMessage);
|
||
}
|
||
else
|
||
{
|
||
LogHelper.Error("ES_DISTRIBUTE.Create|dbEx" + dbEx.Message.ToString());
|
||
errors.Add(dbEx.Message);
|
||
}
|
||
}
|
||
else
|
||
{
|
||
LogHelper.Error("ES_DISTRIBUTE.Create|dbEx2" + dbEx.Message.ToString());
|
||
errors.Add(dbEx.Message);
|
||
}
|
||
return false;
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
LogHelper.Error("ES_DISTRIBUTE.Create|ex" + ex.ToString());
|
||
errors.Add(ex.Message);
|
||
return false;
|
||
}
|
||
}
|
||
#endregion
|
||
|
||
#region 修改
|
||
|
||
/// <summary>
|
||
/// 数据的修改
|
||
/// </summary>
|
||
/// <param name="errors"></param>
|
||
/// <param name="model"></param>
|
||
/// <returns></returns>
|
||
public bool Update(ref ValidationErrors errors, WX.CRM.Model.Entity.RES_DISTRIBUTE model)
|
||
{
|
||
try
|
||
{
|
||
using (var db = new WX.CRM.Model.Entity.crmContext())
|
||
{
|
||
WX.CRM.Model.Entity.RES_DISTRIBUTE entry = db.RES_DISTRIBUTE.FirstOrDefault(m => m.ACTIVITYID == model.ACTIVITYID);
|
||
if (entry == null)
|
||
return false;
|
||
|
||
entry.RESTYPEID = model.RESTYPEID;
|
||
entry.RESTYPEID = model.RESTYPEID;
|
||
entry.DISLEADER = model.DISLEADER;
|
||
entry.SALESREMARK = model.SALESREMARK;
|
||
entry.REMARK = model.REMARK;
|
||
db.SaveChanges();
|
||
return true;
|
||
}
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
errors.Add(ex.Message);
|
||
return false;
|
||
}
|
||
}
|
||
#endregion
|
||
|
||
#region 删除
|
||
|
||
/// <summary>
|
||
/// 删除
|
||
/// </summary>
|
||
/// <param name="errors"></param>
|
||
/// <param name="id"></param>
|
||
/// <returns></returns>
|
||
public bool Delete(ref ValidationErrors errors, decimal id)
|
||
{
|
||
try
|
||
{
|
||
using (var db = new WX.CRM.Model.Entity.crmContext())
|
||
{
|
||
WX.CRM.Model.Entity.RES_DISTRIBUTE entry = db.RES_DISTRIBUTE.FirstOrDefault(m => m.PKID == id);
|
||
if (entry == null)
|
||
{
|
||
errors.Add("数据已经被删除!");
|
||
return false;
|
||
}
|
||
db.RES_DISTRIBUTE.Remove(entry);
|
||
return db.SaveChanges().GetResult();
|
||
}
|
||
}
|
||
catch (Exception ex) { errors.Add(ex.Message); return false; }
|
||
}
|
||
#endregion
|
||
|
||
#region 获取分页数据列表
|
||
public List<WX.CRM.Model.Entity.RES_DISTRIBUTE_Extend> GetList(ref Pager pager, string pici, decimal distributeId, string category, decimal? saleDeptId, string groupId, decimal? innerUserId, DateTime? sTime, DateTime? eTime, string resid)
|
||
{
|
||
using (var db = new WX.CRM.Model.Entity.crmContext())
|
||
{
|
||
var queryData = db.RES_DISTRIBUTE.AsQueryable();
|
||
if (!string.IsNullOrWhiteSpace(pici))
|
||
{
|
||
queryData = queryData.Where(m => m.PICI.TrimEnd() == pici);
|
||
}
|
||
var data = (from a in queryData
|
||
join b in db.RES_DISTRIBUTE_DETAIL on a.PKID equals b.DISTRIBUTEID
|
||
join c in db.CACHE_RES_RESOURCE_COUNT on b.RESID equals c.RESID
|
||
join d in db.RES_CUSTOMERDETAIL on b.RESID equals d.RESID
|
||
join u in db.BAS_INNERUSER on b.SALESID equals u.PKID
|
||
join r in db.RES_RESOURCETYPE on a.RESTYPEID equals r.RESTYPEID
|
||
join t in db.RES_ACTIVITY on a.ACTIVITYID equals t.ACTIVITYID into at
|
||
from e in at.DefaultIfEmpty()
|
||
select new RES_DISTRIBUTE_Extend()
|
||
{
|
||
res_Distribute = a,
|
||
ResourceTypeName = r.TYPENAME,
|
||
ActivityName = e.ACTIVITYNAME,
|
||
ResId = b.RESID,
|
||
SALESID = b.SALESID,
|
||
HASACTIVE = c.HASACTIVE,
|
||
LASTACTIVETIME = c.LASTACTIVETIME,
|
||
CUSTOMERCATEGORY = d.CUSTOMERCATEGORY,
|
||
LASTCALLTIME = c.LASTCALLTIME,
|
||
LOGID = b.LOGID,
|
||
DisTime = b.CTIME
|
||
});
|
||
if (innerUserId.HasValue)
|
||
{
|
||
data = data.Where(p => p.SALESID == innerUserId.Value);
|
||
}
|
||
else
|
||
{
|
||
if (!string.IsNullOrWhiteSpace(groupId) && (groupId.IndexOf(',') < 0 || saleDeptId <= 1)) //当单个组时走这个判断
|
||
{
|
||
var _groupids = OperationUtil.ConvertToDecimal(groupId.ToString().Split(','));
|
||
List<decimal?> groupList = new List<decimal?>();
|
||
if (_groupids != null)
|
||
{
|
||
foreach (var g in _groupids)
|
||
{
|
||
groupList.Add(g);
|
||
}
|
||
}
|
||
if (groupList != null)
|
||
{
|
||
var returnData = (from a in data
|
||
join b in db.BAS_INNERUSERGROUP on a.SALESID equals b.INNERUSERID
|
||
where groupList.Contains(b.GID)
|
||
select a);
|
||
|
||
data = returnData;
|
||
}
|
||
}
|
||
else if (saleDeptId > 1) //销售部门走这个判断
|
||
{
|
||
data = (from a in data
|
||
join b in db.BAS_INNERUSERGROUP on a.SALESID equals b.INNERUSERID
|
||
join c in db.BAS_INNERGROUP on b.GID equals c.GID
|
||
join d in db.BAS_SALESDEPARTMENT on c.SALEDEPTID equals d.SALEDEPTID
|
||
where d.SALEDEPTID == saleDeptId
|
||
select a);
|
||
}
|
||
}
|
||
if (!string.IsNullOrEmpty(category))
|
||
{
|
||
data = data.Where(p => p.CUSTOMERCATEGORY == category);
|
||
}
|
||
if (sTime.HasValue)
|
||
{
|
||
//data = data.Where(p => p.res_Distribute.CTIME >= sTime);
|
||
data = data.Where(p => p.DisTime >= sTime);
|
||
}
|
||
if (eTime.HasValue)
|
||
{
|
||
eTime = eTime.Value.AddDays(1);
|
||
//data = data.Where(p => p.res_Distribute.CTIME < eTime);
|
||
data = data.Where(p => p.DisTime < eTime);
|
||
}
|
||
if (!string.IsNullOrEmpty(resid))
|
||
{
|
||
data = data.Where(p => p.ResId == resid);
|
||
}
|
||
data = data.OrderByDescending(m => m.LOGID);
|
||
PagerUtil.SetPager<WX.CRM.Model.Entity.RES_DISTRIBUTE_Extend>(ref data, ref pager);
|
||
return data.ToList();
|
||
}
|
||
}
|
||
#endregion
|
||
|
||
#region 获取分配历史数据列表
|
||
public List<RES_DISTRIBUTE_Extend> GetListByHis(ref Pager pager, string pici, decimal distributeId, string category, decimal? saleDeptId, string groupId, decimal? innerUserId, DateTime? sTime, DateTime? eTime, string resid, decimal? isrecycle, DateTime? r1Time, DateTime? r2Time, decimal? hasGt)
|
||
{
|
||
using (var db = new crmContext())
|
||
{
|
||
var queryData = db.RES_DISTRIBUTE.AsQueryable();
|
||
if (!string.IsNullOrWhiteSpace(pici))
|
||
{
|
||
queryData = queryData.Where(m => m.PICI.TrimEnd() == pici);
|
||
}
|
||
var data = (from a in queryData
|
||
join b in db.RES_DISTRIBUTEDETAIL_HIS on a.PKID equals b.DISTRIBUTEID
|
||
join c in db.CACHE_RES_RESOURCE_COUNT on b.RESID equals c.RESID
|
||
join d in db.RES_CUSTOMERDETAIL on b.RESID equals d.RESID
|
||
join e in db.RES_DISTRIBUTEHIS_EFFECT on new { b.DISTRIBUTEID, b.RESID } equals new { e.DISTRIBUTEID, e.RESID }
|
||
join u in db.BAS_INNERUSER on b.SALESID equals u.PKID
|
||
join r in db.RES_RESOURCETYPE on a.RESTYPEID equals r.RESTYPEID
|
||
join t in db.RES_ACTIVITY on a.ACTIVITYID equals t.ACTIVITYID into atTmp
|
||
from at in atTmp.DefaultIfEmpty()
|
||
select new RES_DISTRIBUTE_Extend()
|
||
{
|
||
res_Distribute = a,
|
||
ResourceTypeName = r.TYPENAME,
|
||
ActivityName = at.ACTIVITYNAME,
|
||
ResId = b.RESID,
|
||
SALESID = b.SALESID,
|
||
HASACTIVE = c.HASACTIVE,
|
||
LASTACTIVETIME = c.LASTACTIVETIME,
|
||
CUSTOMERCATEGORY = d.CUSTOMERCATEGORY,
|
||
LASTCALLTIME = c.LASTCALLTIME,
|
||
LOGID = b.LOGID,
|
||
RECYCLETIME = e.ETIME,
|
||
DisTime = b.CTIME
|
||
});
|
||
if (innerUserId.HasValue)
|
||
{
|
||
data = data.Where(p => p.SALESID == innerUserId.Value);
|
||
}
|
||
else
|
||
{
|
||
if (!string.IsNullOrWhiteSpace(groupId) && (groupId.IndexOf(',') < 0 || saleDeptId <= 1)) //当单个组时走这个判断
|
||
{
|
||
var _groupids = OperationUtil.ConvertToDecimal(groupId.ToString().Split(','));
|
||
List<decimal?> groupList = new List<decimal?>();
|
||
if (_groupids != null)
|
||
{
|
||
foreach (var g in _groupids)
|
||
{
|
||
groupList.Add(g);
|
||
}
|
||
}
|
||
if (groupList != null)
|
||
{
|
||
var returnData = (from a in data
|
||
join b in db.BAS_INNERUSERGROUP on a.SALESID equals b.INNERUSERID
|
||
where groupList.Contains(b.GID)
|
||
select a);
|
||
|
||
data = returnData;
|
||
}
|
||
}
|
||
else if (saleDeptId > 1) //销售部门走这个判断
|
||
{
|
||
data = (from a in data
|
||
join b in db.BAS_INNERUSERGROUP on a.SALESID equals b.INNERUSERID
|
||
join c in db.BAS_INNERGROUP on b.GID equals c.GID
|
||
join d in db.BAS_SALESDEPARTMENT on c.SALEDEPTID equals d.SALEDEPTID
|
||
where d.SALEDEPTID == saleDeptId
|
||
select a);
|
||
}
|
||
}
|
||
if (!string.IsNullOrEmpty(category))
|
||
{
|
||
data = data.Where(p => p.CUSTOMERCATEGORY == category);
|
||
}
|
||
if (sTime.HasValue)
|
||
{
|
||
//data = data.Where(p => p.res_Distribute.CTIME >= sTime);
|
||
data = data.Where(p => p.DisTime >= sTime);
|
||
}
|
||
if (eTime.HasValue)
|
||
{
|
||
eTime = eTime.Value.AddDays(1);
|
||
//data = data.Where(p => p.res_Distribute.CTIME < eTime);
|
||
data = data.Where(p => p.DisTime < eTime);
|
||
}
|
||
if (!string.IsNullOrEmpty(resid))
|
||
{
|
||
data = data.Where(p => p.ResId == resid);
|
||
}
|
||
if (isrecycle.HasValue)
|
||
{
|
||
if (isrecycle == 1)
|
||
{
|
||
data = data.Where(p => p.RECYCLETIME.HasValue);
|
||
if (r1Time.HasValue)
|
||
{
|
||
data = data.Where(p => p.RECYCLETIME >= r1Time.Value);
|
||
}
|
||
if (r2Time.HasValue)
|
||
{
|
||
r2Time = r2Time.Value.AddDays(1);
|
||
data = data.Where(p => p.RECYCLETIME < r2Time);
|
||
}
|
||
}
|
||
else
|
||
{
|
||
data = data.Where(p => p.RECYCLETIME == null);
|
||
}
|
||
}
|
||
if (hasGt.HasValue)
|
||
{
|
||
if (hasGt == 1)
|
||
{
|
||
data = data.Where(p => p.LASTACTIVETIME.HasValue || p.LASTCALLTIME.HasValue);
|
||
}
|
||
else
|
||
{
|
||
data = data.Where(p => p.LASTACTIVETIME == null && p.LASTCALLTIME == null);
|
||
}
|
||
}
|
||
data = data.OrderByDescending(m => m.LOGID);
|
||
PagerUtil.SetPager<WX.CRM.Model.Entity.RES_DISTRIBUTE_Extend>(ref data, ref pager);
|
||
return data.ToList();
|
||
}
|
||
}
|
||
#endregion
|
||
|
||
|
||
#region 获取资源明细
|
||
/// <summary>
|
||
/// 获取资源明细
|
||
/// </summary>
|
||
/// <param name="id"></param>
|
||
/// <param name="userId"></param>
|
||
/// <returns></returns>
|
||
public List<WX.CRM.Model.Entity.CACHE_RES_RESOURCE_COUNT> GetDetail_Distribute(ref Pager pg, decimal id, decimal userId)
|
||
{
|
||
using (var db = new WX.CRM.Model.Entity.crmContext())
|
||
{
|
||
var queryData = (
|
||
from a in db.CACHE_RES_RESOURCE_COUNT
|
||
join b in db.RES_DISTRIBUTE_DETAIL on a.RESID equals b.RESID
|
||
join c in db.RES_DISTRIBUTE on b.DISTRIBUTEID equals c.PKID
|
||
where c.PKID.Equals(id)
|
||
where b.SALESID.Equals(userId)
|
||
select a
|
||
);
|
||
queryData = queryData.OrderBy(m => m.RESID);
|
||
PagerUtil.SetPager<WX.CRM.Model.Entity.CACHE_RES_RESOURCE_COUNT>(ref queryData, ref pg);
|
||
return queryData.ToList();
|
||
}
|
||
}
|
||
|
||
public List<CACHE_RES_RESOURCE_COUNT> GetCacheResourceCount(List<string> resids)
|
||
{
|
||
using (var db = new crmContext())
|
||
{
|
||
var data = db.CACHE_RES_RESOURCE_COUNT.Where(p => resids.Contains(p.RESID));
|
||
return data.ToList();
|
||
}
|
||
}
|
||
#endregion
|
||
|
||
#region 获取未写工单的手工分配资源数量,用于提醒
|
||
|
||
public int GetNewDistributeCount(decimal userId)
|
||
{
|
||
try
|
||
{
|
||
using (var db = new crmContext())
|
||
{
|
||
var q = from a in db.CACHE_RES_RESOURCE_COUNT
|
||
join b in db.RES_DISTRIBUTE_DETAIL on a.RESID equals b.RESID
|
||
where b.SALESID.Equals(userId) && a.HASACTIVE == 0
|
||
select a;
|
||
return q.ToList().Count;
|
||
}
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
LogHelper.Error(ex.ToString());
|
||
throw;
|
||
}
|
||
|
||
}
|
||
#endregion
|
||
|
||
#region 获取待分配的资源并写入表
|
||
public void DistbuteDataQueryAndInsert(decimal resTypeId, decimal ActivityId, DateTime? stime, DateTime? etime, decimal userId, int hasRole, ref int count, ref decimal importId)
|
||
{
|
||
_dal.DistbuteDataQueryAndInsert(resTypeId, ActivityId, stime, etime, userId, hasRole, ref count, ref importId);
|
||
}
|
||
#endregion
|
||
|
||
/// <summary>
|
||
/// 获取分配资源的手机号码
|
||
/// </summary>
|
||
/// <param name="DISTRIBUTEID">资源分配ID</param>
|
||
/// <returns></returns>
|
||
public List<string> GetFBMobile(decimal DISTRIBUTEID, decimal saleid)
|
||
{
|
||
using (var db = new WX.CRM.Model.Entity.crmContext())
|
||
{
|
||
WX.CRM.IBLL.Util.ISecurityHelper sHelper = new SecurityHelper();
|
||
string clientid = Utility.GetSettingByKey("CRMClientKey");
|
||
var queryData = (
|
||
from a in db.RES_DISTRIBUTE_DETAIL
|
||
join b in db.RES_RESOURCEMOBILE on a.RESID equals b.RESID
|
||
where a.DISTRIBUTEID.Equals(DISTRIBUTEID)
|
||
where a.SALESID.Equals(saleid)
|
||
select b.MOBILE);
|
||
List<string> phoneList = queryData.ToList();
|
||
for (int i = 0; i < phoneList.Count; i++)
|
||
{
|
||
phoneList[i] = sHelper.decyptData(clientid, phoneList[i]);
|
||
}
|
||
return phoneList;
|
||
}
|
||
}
|
||
|
||
public void UpdateAllocate(decimal v_pkid, decimal v_UserId)
|
||
{
|
||
_dal.UpdateAllocate(v_pkid, v_UserId);
|
||
}
|
||
public void UpdateAllocate2(decimal v_pkid, decimal v_UserId, decimal fenpeiUserId)
|
||
{
|
||
_dal.UpdateAllocate2(v_pkid, v_UserId, fenpeiUserId);
|
||
}
|
||
|
||
public void UpdateCacheResCountActiveFlag(string resId, DateTime lastActiveTime)
|
||
{
|
||
_dal.UpdateCacheResCountActiveFlag(resId, lastActiveTime);
|
||
}
|
||
|
||
public void UpdateHFStatus(string resId,int status)
|
||
{
|
||
_dal.UpdateHFStatus(resId, status);
|
||
}
|
||
|
||
|
||
public void UpdateCacheResCountLastCallTime(string resId, DateTime lastCallTime)
|
||
{
|
||
_dal.UpdateCacheResCountLastCallTime(resId, lastCallTime);
|
||
}
|
||
|
||
public DataSet Res_DistributeCount(DateTime sTime, DateTime eTime)
|
||
{
|
||
return _dal.Res_DistributeCount(sTime, eTime);
|
||
}
|
||
|
||
public DataSet Res_DistributeUnCount(DateTime sTime, DateTime eTime, decimal saleid)
|
||
{
|
||
return _dal.Res_DistributeUnCount(sTime, eTime, saleid);
|
||
}
|
||
|
||
public List<ChangeDistbuteView> GetDistbuteRes(ref Pager pg, string resid, decimal? inneruserid, string groupId, string resourcetag, decimal resourcetypeid)
|
||
{
|
||
var ds = _dal.GetDistbuteRes(ref pg, resid, inneruserid, groupId, resourcetag, resourcetypeid);
|
||
var list = ds.Tables[0].ToList<ChangeDistbuteView>();
|
||
var model = list.FirstOrDefault(p => p.logid == 0);
|
||
pg.totalRows = Convert.ToInt32(model.rn);
|
||
list.Remove(model);
|
||
return list;
|
||
}
|
||
|
||
public List<DistbuteCountView> GetDistbuteResCount(ref Pager pg, decimal? inneruserid, string groupId, DateTime? sTime, DateTime? eTime, decimal? resourcetypeid, decimal? resourceactivityid, decimal? hasNum = null, decimal? hasOrder = null, decimal? hasRecord = null, decimal? hasMemo = null)
|
||
{
|
||
var ds = _dal.GetDistbuteResCount(ref pg, inneruserid, groupId, sTime, eTime, resourcetypeid, resourceactivityid, hasNum, hasOrder, hasRecord, hasMemo);
|
||
var list = ds.Tables[0].ToList<DistbuteCountView>();
|
||
var model = list.OrderByDescending(p => p.rn).First();
|
||
pg.totalRows = Convert.ToInt32(model.rn);
|
||
return list;
|
||
}
|
||
|
||
public void ExecDistbuteRecycle(decimal? inneruserid, string groupId, DateTime? sTime, DateTime? eTime, decimal? resourcetypeid, decimal? resourceactivityid, decimal? hasNum = null, decimal? hasOrder = null, decimal? hasRecord = null, decimal? hasMemo = null, decimal? tranResTypeId = null, decimal? tranResActivityId = null, string tranResTag = null, decimal? tranCompanyId = null, decimal? num = null)
|
||
{
|
||
_dal.ExecDistbuteRecycle(inneruserid, groupId, sTime, eTime, resourcetypeid, resourceactivityid, hasNum, hasOrder, hasRecord, hasMemo, tranResTypeId, tranResActivityId, tranResTag, tranCompanyId, num);
|
||
}
|
||
|
||
public int GetRegisterResouceNotice()
|
||
{
|
||
return _dal.GetRegisterResouceNotice();
|
||
}
|
||
|
||
public DataSet GetDistbuteHisCount(DateTime? stime, DateTime? etime, string deptId, string groupId, string innerUserId)
|
||
{
|
||
if (!stime.HasValue)
|
||
{
|
||
stime = DateTime.Now.Date;
|
||
}
|
||
if (!etime.HasValue)
|
||
{
|
||
etime = DateTime.Now.AddDays(1).Date;
|
||
}
|
||
else
|
||
{
|
||
etime = etime.Value.AddDays(1);
|
||
}
|
||
if (!string.IsNullOrWhiteSpace(deptId))
|
||
{
|
||
UserServices userservices = new UserServices();
|
||
List<decimal> deptIDS = new List<decimal>();
|
||
List<decimal> gidS = new List<decimal>();
|
||
userservices.GetAllDeptIDOrGidByDeptStr(deptId, ref deptIDS, ref gidS);//获取所有的组别和gid
|
||
deptId = string.Join(",", deptIDS);
|
||
}
|
||
return _dal.GetDistbuteHisCount(stime, etime, deptId, groupId, innerUserId);
|
||
}
|
||
|
||
public DataSet GetResDistributeHisEffect(string pici, decimal? restypeid, DateTime? stime, DateTime? etime)
|
||
{
|
||
return _dal.GetResDistributeHisEffect(pici, restypeid, stime, etime);
|
||
}
|
||
|
||
public DataSet GetResAllcoteLogEffect(string saleDeptId,string groupId, decimal? userId, decimal? restypeid, DateTime? stime, DateTime? etime)
|
||
{
|
||
if (!string.IsNullOrWhiteSpace(saleDeptId))
|
||
{
|
||
UserServices userservices = new UserServices();
|
||
List<decimal> ALLdeptIDS = new List<decimal>();
|
||
List<decimal> ALLgidS = new List<decimal>();
|
||
userservices.GetAllDeptIDOrGidByDeptStr(saleDeptId, ref ALLdeptIDS, ref ALLgidS);//获取所有的组别和gid
|
||
groupId = string.Join(",", ALLgidS);
|
||
}
|
||
return _dal.GetResAllcoteLogEffect(groupId, userId, restypeid, stime, etime);
|
||
}
|
||
|
||
|
||
public string Bei3Allocate(string resId, decimal eid, decimal resTypeId, string resTag)
|
||
{
|
||
return _dal.Bei3Allocate(resId, eid, resTypeId, resTag);
|
||
}
|
||
public string GiveUp(string resId, decimal userId)
|
||
{
|
||
return _dal.GiveUp(resId, userId);
|
||
}
|
||
}
|
||
} |