修改移交功能

master
孙亮 9 months ago
parent ad6ea81b07
commit 837654f247

@ -312,9 +312,11 @@ namespace BP.WF.Template
{
//if (BP.Web.WebUser.No.Equals("admin") == true)
// return this.RetrieveAll(FlowSortAttr.Idx);
if (BP.Web.WebUser.IsAdmin == false)
throw new Exception("err@您不是管理员.");
if (Glo.CCBPMRunModel != CCBPMRunModel.Single) {
if (BP.Web.WebUser.IsAdmin == false)
throw new Exception("err@您不是管理员.");
}
//if (Glo.CCBPMRunModel != CCBPMRunModel.Single)
//{

@ -52,6 +52,14 @@ namespace BP.WF.Template
/// </summary>
public class PushMsgAttr
{
/// <summary>
/// NodeID
/// </summary>
public const string NodeID = "NodeID";
/// <summary>
/// EventNo
/// </summary>
public const string EventNo = "EventNo";
/// <summary>
/// 流程编号
/// </summary>

@ -33,6 +33,38 @@ namespace BP.WF
Node nd = new Node(gwf.NodeID);
Work work = nd.HisWork;
work.OID = workID;
work.RetrieveFromDBSources();
DateTime dtOfShould = DateTime.Now;
if (nd.HisCHWay == CHWay.ByTime)
{
//按天、小时考核
if (nd.GetParaInt("CHWayOfTimeRole") == 0)
{
//增加天数. 考虑到了节假日.
//判断是修改了节点期限的天数
int timeLimit = nd.TimeLimit;
dtOfShould = Glo.AddDayHoursSpan(DateTime.Now, timeLimit,
nd.TimeLimitHH, nd.TimeLimitMM, nd.TWay);
}
//按照节点字段设置
if (nd.GetParaInt("CHWayOfTimeRole") == 1)
{
//获取设置的字段、
string keyOfEn = nd.GetParaString("CHWayOfTimeRoleField");
if (DataType.IsNullOrEmpty(keyOfEn) == true)
nd.HisCHWay = CHWay.None;
else
dtOfShould = DataType.ParseSysDateTime2DateTime(work.GetValByKey(keyOfEn).ToString());
}
}
string sdt = "";
if (nd.HisCHWay == CHWay.None)
sdt = "无";
else
sdt = DataType.SysDateTimeFormat(dtOfShould);
//检查被移交人是否在当前的待办列表里否?
GenerWorkerList gwl = new GenerWorkerList();
i = gwl.Retrieve(GenerWorkerListAttr.FK_Emp, emp.UserID,
@ -74,7 +106,7 @@ namespace BP.WF
item.DeptName = WebUser.DeptName;
item.ItIsRead = false;
item.SDT = sdt;
item.Insert(); //执行插入.
break;
}
@ -88,16 +120,13 @@ namespace BP.WF
//移交后事件
string atPara1 = "@SendToEmpIDs=" + emp.UserID;
string info = "@" + ExecEvent.DoNode(EventListNode.ShitAfter, nd, work, null, atPara1);
if (info == null || info.Equals("@null")) info = "";
//处理移交后发送的消息事件,发送消息.
PushMsgs pms1 = new PushMsgs();
pms1.Retrieve(PushMsgAttr.FK_Node, nd.NodeID, PushMsgAttr.FK_Event, EventListNode.ShitAfter);
pms1.Retrieve(PushMsgAttr.NodeID, nd.NodeID, PushMsgAttr.EventNo, EventListNode.ShitAfter);
foreach (PushMsg pm in pms1)
pm.DoSendMessage(nd, nd.HisWork, null, null, null, emp.UserID);
string emps = gwf.Emps;
emps += WebUser.No+","+WebUser.Name+"@";
gwf.Emps = emps;
gwf.WFState = WFState.Shift;
gwf.TodoEmpsNum = 1;
gwf.TodoEmps = emp.UserID + "," + emp.Name + ";";
@ -107,16 +136,19 @@ namespace BP.WF
//非协作模式.
gwl = new GenerWorkerList();
gwl.Retrieve(GenerWorkerListAttr.FK_Node, gwf.NodeID, GenerWorkerListAttr.WorkID, gwf.WorkID, GenerWorkerListAttr.FK_Emp, WebUser.No);
//删除当前人的待办
gwl.Delete();
//增加移交人的待办
gwl.EmpNo = emp.UserID;
gwl.EmpName = emp.Name;
gwl.ItIsEnable = true;
gwl.ItIsRead = false;
gwl.Insert();
i = gwl.Retrieve(GenerWorkerListAttr.FK_Node, gwf.NodeID, GenerWorkerListAttr.WorkID, gwf.WorkID);
if (i == 1) {
string sql = "UPDATE WF_GenerWorkerlist SET IsRead=0, FK_Emp='" + emp.UserID + "', EmpName='" + emp.Name + "' WHERE FK_Emp='" + gwl.EmpNo + "' AND FK_Node=" + gwf.NodeID + " AND WorkID=" + workID;
DBAccess.RunSQL(sql);
} else {
gwl.Delete(GenerWorkerListAttr.WorkID, gwf.WorkID, GenerWorkerListAttr.FK_Node, gwf.NodeID);
gwl.EmpNo = emp.UserID;
gwl.EmpName = emp.Name;
gwl.ItIsEnable = true;
gwl.ItIsRead = false;
gwl.SDT = sdt;
gwl.Insert();
}
gwf.WFState = WFState.Shift;
gwf.TodoEmpsNum = 1;
gwf.TodoEmps = gwf.TodoEmps.Replace(WebUser.No + "," + WebUser.Name + ";", "") + emp.UserID + "," + emp.Name + ";";
@ -154,14 +186,45 @@ namespace BP.WF
gwls.Retrieve(GenerWorkerListAttr.FK_Node, gwf.NodeID,
GenerWorkerListAttr.WorkID, workID);
//定义变量.
GenerWorkerList gwl = null;
GenerWorkerList gwl = new GenerWorkerList();
int i = 0;
//人员.
Node nd = new Node(gwf.NodeID);
Work work = nd.HisWork;
work.OID = workID;
work.RetrieveFromDBSources();
DateTime dtOfShould = DateTime.Now;
if (nd.HisCHWay == CHWay.ByTime)
{
//按天、小时考核
if (nd.GetParaInt("CHWayOfTimeRole") == 0)
{
//增加天数. 考虑到了节假日.
//判断是修改了节点期限的天数
int timeLimit = nd.TimeLimit;
dtOfShould = Glo.AddDayHoursSpan(DateTime.Now, timeLimit,
nd.TimeLimitHH, nd.TimeLimitMM, nd.TWay);
}
//按照节点字段设置
if (nd.GetParaInt("CHWayOfTimeRole") == 1)
{
//获取设置的字段、
string keyOfEn = nd.GetParaString("CHWayOfTimeRoleField");
if (DataType.IsNullOrEmpty(keyOfEn) == true)
nd.HisCHWay = CHWay.None;
else
dtOfShould = DataType.ParseSysDateTime2DateTime(work.GetValByKey(keyOfEn).ToString());
}
}
string sdt = "";
if (nd.HisCHWay == CHWay.None)
sdt = "无";
else
sdt = DataType.SysDateTimeFormat(dtOfShould);
string info = null;
string[] strs = toEmps.Split(',');
string empNames = "";
@ -192,6 +255,7 @@ namespace BP.WF
gwl.EmpNo = emp.UserID;
gwl.EmpName = emp.Name;
gwl.PassInt = 0;
gwl.SDT = sdt;
gwl.Insert();
//记录日志.
@ -204,7 +268,7 @@ namespace BP.WF
//处理移交后发送的消息事件,发送消息.
PushMsgs pms1 = new PushMsgs();
pms1.Retrieve(PushMsgAttr.FK_Node, nd.NodeID, PushMsgAttr.FK_Event, EventListNode.ShitAfter);
pms1.Retrieve(PushMsgAttr.NodeID, nd.NodeID, PushMsgAttr.EventNo, EventListNode.ShitAfter);
foreach (PushMsg pm in pms1)
pm.DoSendMessage(nd, nd.HisWork, null, null, null, emp.UserID);
@ -218,6 +282,7 @@ namespace BP.WF
gwl.EmpNo = emp.UserID;
gwl.EmpName = emp.Name;
gwl.PassInt = 0;
gwl.SDT = sdt;
gwl.Insert();
}

Loading…
Cancel
Save