diff --git a/CCFlow/CCFlow/DataUser/JSLibData/CCFormRef.js b/CCFlow/CCFlow/DataUser/JSLibData/CCFormRef.js index baa7b060..a327b5de 100644 --- a/CCFlow/CCFlow/DataUser/JSLibData/CCFormRef.js +++ b/CCFlow/CCFlow/DataUser/JSLibData/CCFormRef.js @@ -189,4 +189,31 @@ function IsSaveDtl() { }); return regInput; -} \ No newline at end of file +} +function chart() { + var trs = $('.table.wupop tbody tr'); + var pushArray = []; + for (var i = 0; i < trs.length; i++) { + var index = i; + var trData = $($('table tbody tr')[index]).data().data; + trData.FK_Flow = GetQueryString("FK_Flow"); + pushArray.push(trData); + } + //localStorage.setItem('pushArray', JSON.stringify(pushArray)); + + let dtlData = JSON.stringify(pushArray); + let body = {} + body.code = '@host#control#openPage'; + body.data = { + newPage: false, + params: { + dtlData + }, + moduleId: 'b9ff8cfe-005a-1833-9445-bed425bf623a' + } + body.msg = '跳转'; + body.to = 'iBKLinker-union-framework'; + body.from = 'prd'; + window.top?.postMessage(body, '*') + +} \ No newline at end of file diff --git a/CCFlow/CCFlow/Default.aspx b/CCFlow/CCFlow/Default.aspx index e72c2065..663a4f11 100644 --- a/CCFlow/CCFlow/Default.aspx +++ b/CCFlow/CCFlow/Default.aspx @@ -20,7 +20,7 @@ -

单组织版-集团版-SAAS登陆

+ <%--

单组织版-集团版-SAAS登陆

@@ -51,7 +51,7 @@

JFlow

+ --%> diff --git a/CCFlow/CCFlow/Default.htm b/CCFlow/CCFlow/Default.htm index a5147da5..497c9679 100644 --- a/CCFlow/CCFlow/Default.htm +++ b/CCFlow/CCFlow/Default.htm @@ -87,7 +87,7 @@ -

单组织版-集团版-SAAS登陆

+ \ No newline at end of file diff --git a/CCFlow/CCFlow/Portal/Standard/Login.htm b/CCFlow/CCFlow/Portal/Standard/Login.htm index bce1cf59..665a78c9 100644 --- a/CCFlow/CCFlow/Portal/Standard/Login.htm +++ b/CCFlow/CCFlow/Portal/Standard/Login.htm @@ -312,7 +312,7 @@
选择接收人
- - @@ -699,27 +895,77 @@
-
+
- + + +
+
+ + 常用联系人 + + +
+
+
+ + + + + + + + + + + + + + + +
#姓名部门操作
+
+
+
+ + +
+
+
+ +
+ +
+
+ + + + - + diff --git a/CCFlow/CCFlow/WF/WorkOpt/PrintDoc.htm b/CCFlow/CCFlow/WF/WorkOpt/PrintDoc.htm index f98e6ecf..2b110cba 100644 --- a/CCFlow/CCFlow/WF/WorkOpt/PrintDoc.htm +++ b/CCFlow/CCFlow/WF/WorkOpt/PrintDoc.htm @@ -88,10 +88,21 @@ //如果是一个url. if (data.indexOf('file@') == 0) { - data = data.replace('file@', ''); if (data.indexOf('rtf@') != -1) { - window.location.href = filterXSS(data).replace('rtf@', ''); + data = filterXSS(data).replace('rtf@', ''); + if (data.lastIndexOf('/') == -1) { + data = ReplaceName(data); + window.location.href = filterXSS(data); + + } + + var filePath = data.substring(0, data.lastIndexOf('/') + 1); + var fileName = data.substring(data.lastIndexOf('/') + 1); + fileName = ReplaceName(fileName); + data = filePath + fileName; + window.location.href = filterXSS(data); + return; } else { data = data.replace('word@', ''); if (plant == 'CCFlow') { @@ -168,10 +179,21 @@ } //如果是一个url. if (data.indexOf('url@') == 0) { - data = data.replace('url@', ''); + data = data.replace('file@', ''); if (data.indexOf('rtf@') != -1) { - window.location.href = filterXSS(data).replace('rtf@', ''); + data = filterXSS(data).replace('rtf@', ''); + if (data.lastIndexOf('/') == -1) { + data = ReplaceName(data); + window.location.href = filterXSS(data); + + } + + var filePath = data.substring(0, data.lastIndexOf('/') + 1); + var fileName = data.substring(data.lastIndexOf('/') + 1); + fileName = ReplaceName(fileName); + data = filePath + fileName; + window.location.href = filterXSS(data); return; } else { data = data.replace('word@', ''); @@ -190,10 +212,21 @@ //如果是一个url. if (data.indexOf('file@') == 0) { - data = data.replace('file@', ''); if (data.indexOf('rtf@') != -1) { - window.location.href = filterXSS(data).replace('rtf@', ''); + data = filterXSS(data).replace('rtf@', ''); + if (data.lastIndexOf('/') == -1) { + data = ReplaceName(data); + window.location.href = filterXSS(data); + + } + + var filePath = data.substring(0, data.lastIndexOf('/') + 1); + var fileName = data.substring(data.lastIndexOf('/') + 1); + fileName = ReplaceName(fileName); + data = filePath + fileName; + window.location.href = filterXSS(data); + return; } else { data = data.replace('word@', ''); if (plant == 'CCFlow') { @@ -286,6 +319,17 @@ } } + function ReplaceName(fileName) { + fileName = fileName.replace(/%/g, "%25"); + fileName = fileName.replace(/\+/g, "%2B"); + fileName = fileName.replace(/ /g, "%20"); + fileName = fileName.replace(/\//g, "%2F"); + fileName = fileName.replace(/\?/g, "%3F"); + fileName = fileName.replace(/#/g, "%23"); + fileName = fileName.replace(/&/g, "%26"); + fileName = fileName.replace(/=/g, "%3D"); + return fileName; + } diff --git a/CCFlow/Components/BP.Demo/DoEvnFlow.cs b/CCFlow/Components/BP.Demo/DoEvnFlow.cs index 7f457f9f..ea3605f3 100644 --- a/CCFlow/Components/BP.Demo/DoEvnFlow.cs +++ b/CCFlow/Components/BP.Demo/DoEvnFlow.cs @@ -1,5 +1,6 @@ using BP.DA; using BP.Sys; +using BP.Web; using BP.WF; using System; using System.Collections.Generic; @@ -38,7 +39,7 @@ namespace BP.Demo { BP.DA.DBAccess.RunSQL("UPDATE " + pTable2 + " SET BFSJ = '" + BFParas.Rows[0][2] + "' WHERE OID=" + BFParas.Rows[0][1]); } - + } catch (Exception ex) { return ex.Message; diff --git a/CCFlow/Components/BP.En30/Sys/MapDtl.cs b/CCFlow/Components/BP.En30/Sys/MapDtl.cs index c9f6d4fd..dd8cfd0d 100644 --- a/CCFlow/Components/BP.En30/Sys/MapDtl.cs +++ b/CCFlow/Components/BP.En30/Sys/MapDtl.cs @@ -126,6 +126,10 @@ namespace BP.Sys /// public const string UrlDtl = "UrlDtl"; /// + /// 扩展按钮 + /// + public const String BtnLab = "BtnLab"; + /// /// 移动端显示方式 /// public const string MobileShowModel = "MobileShowModel"; @@ -1283,6 +1287,8 @@ namespace BP.Sys map.AddTBInt(MapDtlAttr.EditModel, 0, "行数据显示格式", false, false); map.AddTBString(MapDtlAttr.UrlDtl, null, "自定义Url", true, false, 0, 200, 20, true); + map.AddTBString(MapDtlAttr.BtnLab, null, "扩展按钮", true, false, 0, 200, 20, true); + map.AddTBString(MapDtlAttr.ColAutoExp, null, "列字段计算", true, false, 0, 200, 20, true); map.AddTBInt(MapDtlAttr.MobileShowModel, 0, "移动端数据显示格式", false, false); map.AddTBString(MapDtlAttr.MobileShowField, null, "移动端列表显示字段", true, false, 0, 100, 20); diff --git a/CCFlow/Components/BP.WF/BP.WF.csproj b/CCFlow/Components/BP.WF/BP.WF.csproj index 1c463a58..8e8175c4 100644 --- a/CCFlow/Components/BP.WF/BP.WF.csproj +++ b/CCFlow/Components/BP.WF/BP.WF.csproj @@ -646,6 +646,7 @@ + diff --git a/CCFlow/Components/BP.WF/Data/AdminGroup/GenerWorkFlowView.cs b/CCFlow/Components/BP.WF/Data/AdminGroup/GenerWorkFlowView.cs index 4bf6d86c..ddc2a1c0 100644 --- a/CCFlow/Components/BP.WF/Data/AdminGroup/GenerWorkFlowView.cs +++ b/CCFlow/Components/BP.WF/Data/AdminGroup/GenerWorkFlowView.cs @@ -3,6 +3,7 @@ using System.Data; using BP.DA; using BP.Sys; using BP.En; +using BP.Web; namespace BP.WF.Data.AdminGroup { diff --git a/CCFlow/Components/BP.WF/Dev2Interface.cs b/CCFlow/Components/BP.WF/Dev2Interface.cs index dd071d62..74d3446e 100644 --- a/CCFlow/Components/BP.WF/Dev2Interface.cs +++ b/CCFlow/Components/BP.WF/Dev2Interface.cs @@ -59,7 +59,36 @@ namespace BP.WF //ps.SQL = "SELECT count(b.WorkID) as Num FROM WF_Generworkflow a JOIN WF_GenerWorkerList b ON a.WorkID=b.WorkID WHERE b.FK_Emp=" + dbstr + "FK_Emp AND b.IsPass=0 AND a.WFState <> 0 " + wfSql; ps.SQL = "SELECT count(WorkID) as Num FROM WF_EmpWorks where WFSTATE>1 and Tasksta = 0 AND FK_Emp ="+dbstr+" FK_Emp "+wfSql; ps.Add("FK_Emp", userNo); - return DBAccess.RunSQLReturnValInt(ps); + + //获得授权信息. + Auths aths = new Auths(); + aths.Retrieve(AuthAttr.AutherToEmpNo, userNo); + string sql = "SELECT A.*, null as Auther FROM WF_EmpWorks A WHERE TaskSta <0 AND A.FK_Emp='" + userNo + "' "; + foreach (Auth ath in aths) + { + + string todata = ath.TakeBackDT.Replace("-", ""); + if (DataType.IsNullOrEmpty(ath.TakeBackDT) == false) + { + int mydt = int.Parse(todata); + int nodt = int.Parse(DateTime.Now.ToString("yyyyMMdd")); + if (mydt < nodt) + continue; + sql += " UNION "; + + if (ath.AuthType == AuthorWay.SpecFlows) + sql += "SELECT A.*,'" + ath.Auther + "' as Auther FROM WF_EmpWorks A WHERE FK_Emp='" + ath.Auther + "' AND FK_Flow='" + ath.FlowNo + "' "; + else + sql += "SELECT A.*,'" + ath.Auther + "' as Auther FROM WF_EmpWorks A WHERE FK_Emp='" + ath.Auther + "' "; + + + } + } + DataTable dt2 = DBAccess.RunSQLReturnTable(sql); + + int num = DBAccess.RunSQLReturnValInt(ps) - dt2.Rows.Count; + + return num; } } @@ -78,7 +107,34 @@ namespace BP.WF //ps.SQL = "SELECT count(b.WorkID) as Num FROM WF_Generworkflow a JOIN WF_GenerWorkerList b ON a.WorkID=b.WorkID WHERE b.FK_Emp=" + dbstr + "FK_Emp AND b.IsPass=0 AND a.WFState <> 0 " + wfSql; ps.SQL = "SELECT count(WorkID) as Num FROM WF_EmpWorks where WFSTATE >1 and Tasksta = 0 AND FK_Emp = " + dbstr + " FK_Emp " + wfSql; ps.Add("FK_Emp", userNo); - nums = DBAccess.RunSQLReturnValInt(ps); + + //获得授权信息. + Auths aths = new Auths(); + aths.Retrieve(AuthAttr.AutherToEmpNo, userNo); + string sql = "SELECT A.*, null as Auther FROM WF_EmpWorks A WHERE TaskSta <0 AND A.FK_Emp='" + userNo + "' "; + foreach (Auth ath in aths) + { + + string todata = ath.TakeBackDT.Replace("-", ""); + if (DataType.IsNullOrEmpty(ath.TakeBackDT) == false) + { + int mydt = int.Parse(todata); + int nodt = int.Parse(DateTime.Now.ToString("yyyyMMdd")); + if (mydt < nodt) + continue; + sql += " UNION "; + + if (ath.AuthType == AuthorWay.SpecFlows) + sql += "SELECT A.*,'" + ath.Auther + "' as Auther FROM WF_EmpWorks A WHERE FK_Emp='" + ath.Auther + "' AND FK_Flow='" + ath.FlowNo + "' "; + else + sql += "SELECT A.*,'" + ath.Auther + "' as Auther FROM WF_EmpWorks A WHERE FK_Emp='" + ath.Auther + "' "; + + + } + } + DataTable dt2 = DBAccess.RunSQLReturnTable(sql); + + nums = DBAccess.RunSQLReturnValInt(ps) - dt2.Rows.Count; } return nums; @@ -6735,6 +6791,8 @@ namespace BP.WF todoEmps += emp.UserID + "," + emp.Name + ";"; num++; emps.AddEntity(emp); + + } #endregion 处理要调整到的人员 @@ -6747,6 +6805,18 @@ namespace BP.WF //给当前人员产生待办,删除他. GenerWorkerList gwl = new GenerWorkerList(); + //移交后写入最新待办,调整人@BKGY + string sql3 = "select WorkID,FK_Emp from WF_GenerWorkerlist where WorkID = '"+ workid + "' AND FK_Node = '"+ gwf.NodeID + "'"; + DataTable dtNum = DBAccess.RunSQLReturnTable(sql3); + string sql2 = ""; + foreach (DataRow dr in dtNum.Rows) + { + //流程调整前写入最新待办 调整节点@BKGY + sql2 = "INSERT INTO WEB_SOCKET (ID,USER_NO,EmpWorksNums,Flag) "; + sql2 += "VALUES(S_WEB_SOCKET.NEXTVAL,'" + dr[1] + "','" + BP.WF.Dev2Interface.EmpWorksNums(dr[1].ToString()) + "','0')"; + DBAccess.RunSQL(sql2); + } + //删除当前节点的d待办. gwl.Delete(GenerWorkerListAttr.WorkID, workid, GenerWorkerListAttr.FK_Node, gwf.NodeID); //删除要调整到的节点数据. @@ -6777,6 +6847,12 @@ namespace BP.WF gwl.FlowNo = nd.FlowNo; gwl.ItIsEnable = true; gwl.Insert(); + //调整后写入最新待办,被调整人@BKGY + sql2 = ""; + sql2 = "INSERT INTO WEB_SOCKET (ID,USER_NO,EmpWorksNums,Flag) "; + sql2 += "VALUES(S_WEB_SOCKET.NEXTVAL,'" + emp.UserID + "','" + BP.WF.Dev2Interface.EmpWorksNums(emp.UserID) + "','0')"; + DBAccess.RunSQL(sql2); + todoEmpsExts += item.UserID + "," + item.Name + ";"; } @@ -10315,6 +10391,74 @@ namespace BP.WF cdEvent.Wait(); #endregion } + + /// + /// 增加下一步骤的常用联系人 + /// + /// 到达的节点ID + /// 如果多个就用逗号分开 + /// 是否删除历史选择 + public static void Node_AddNextStepCalls(int toNodeID, string emps, bool del_Selected = true) + { + if (DataType.IsNullOrEmpty(emps) == true) + return; + + string selectEmps = ","; + string sql = "SELECT MyPK,FK_Emp,FK_Node,Tag FROM WF_SelectCallers WHERE FK_Node = " + toNodeID + " AND FK_Emp = '" + WebUser.No + "'"; + DataTable dt = DBAccess.RunSQLReturnTable(sql); + + foreach (DataRow item in dt.Rows) + selectEmps += item[1].ToString() + ","; + + string[] empStrs = emps.Split(','); + if (empStrs.Length == 0) return; + #region 筛选需要执行的任务 + dt = DBAccess.RunSQLReturnTable("Select e.FK_Dept, e.No as UserID, e.Name, d.Name as FK_DeptText from Port_Emp e left join port_dept d on e.FK_Dept = d.No where e.No IN ('" + String.Join("','", empStrs) + "')"); + List empRowList = new List(); + foreach (DataRow dr in dt.Rows) + { + string empNo = dr[1].ToString(); + + if (selectEmps.IndexOf("," + empNo + ",") >= 0) + continue; + empRowList.Add(dr); + } + int taskCount = empRowList.Count; + string userNo = WebUser.No; + if (taskCount == 0) return; // 没有任务直接返回 + #endregion + + #region 多线程并行写入 + CountdownEvent cdEvent = new CountdownEvent(taskCount); + empRowList.ForEach(dr => + { + ThreadPool.QueueUserWorkItem(o => + { + _semaphore.Wait(); + try + { + string empNo = dr[1].ToString(); + string MyPK = toNodeID + "_" + empNo + "_"+ userNo; + sql = "INSERT INTO WF_SelectCallers (MyPK, Callers, FK_Node,FK_Emp,EmpName, DeptName,FK_Dept) VALUES "; + sql += "( '" + MyPK + "','" + empNo + "'," + toNodeID + ",'" + userNo + "','" + dr[2] + "','" + dr[3] + "','" + dr["FK_Dept"] + "' )"; + DBAccess.RunSQL(sql); + } + catch (Exception ex) + { + BP.DA.Log.DebugWriteError("插入人员" + dr[1].ToString() + "失败, " + ex.Message); + } + finally + { + _semaphore.Release(); + //affectRows++; + cdEvent.Signal(); + } + }); + }); + cdEvent.Wait(); + #endregion + } + /// /// 增加下一步骤的接受人(用于当前步骤向下一步骤发送时增加接受人) /// diff --git a/CCFlow/Components/BP.WF/HttpHandler/WF_MyView.cs b/CCFlow/Components/BP.WF/HttpHandler/WF_MyView.cs index be408cc4..8c49df22 100644 --- a/CCFlow/Components/BP.WF/HttpHandler/WF_MyView.cs +++ b/CCFlow/Components/BP.WF/HttpHandler/WF_MyView.cs @@ -273,11 +273,11 @@ namespace BP.WF.HttpHandler //sql = "SELECT WorkID,FK_Emp,FK_Node,WhoExeIt From WF_GenerWorkerlist WHERE FK_Emp='" + WebUser.No + "' AND ((IsPass=0 AND WhoExeIt=1) OR IsPass=1) AND IsEnable=1 AND WorkID=" + this.WorkID; //BKGY 撤销发送 - sql = "SELECT WorkID,FK_Emp,FK_Node,IsPass From WF_GenerWorkerlist WHERE WorkID=" + this.WorkID +" And FK_Node='"+ gwf.NodeID+"'"; + sql = "SELECT WorkID,FK_Emp,FK_Node,WhoExeIt,IsPass,FK_Emp From WF_GenerWorkerlist WHERE WorkID=" + this.WorkID +" And FK_Node='"+ gwf.NodeID+"'"; DataTable dtt = DBAccess.RunSQLReturnTable(sql); bool isCanShowUnSend = true; foreach (DataRow item in dtt.Rows) { - if (item["IsPass"].ToString() == "1") { + if (item["IsPass"].ToString() == "1" && nd.TodolistModel != BP.WF.TodolistModel.Teamup) { isCanShowUnSend = false; break; } diff --git a/CCFlow/Components/BP.WF/HttpHandler/WF_WorkOpt.cs b/CCFlow/Components/BP.WF/HttpHandler/WF_WorkOpt.cs index 57708156..08777791 100644 --- a/CCFlow/Components/BP.WF/HttpHandler/WF_WorkOpt.cs +++ b/CCFlow/Components/BP.WF/HttpHandler/WF_WorkOpt.cs @@ -849,10 +849,12 @@ namespace BP.WF.HttpHandler fileModelT = "word"; #region BKGY替换word名称 20231026 sunliang string sql = "select TITLE from WF_GENERWORKFLOW where workid='" + WorkID + "'"; - string name = DBAccess.RunSQLReturnString(sql); - var s = name.Split('_'); - string da = s[0].ToString().Replace("#", "号") + ".doc"; - da = da.Replace("+", "、"); + string da = DBAccess.RunSQLReturnString(sql); + var s = da.Split('_'); + da = s[0] + ".doc"; + + //string da = s[0].ToString().Replace("#", "号") + ".doc"; + //da = da.Replace("+", "、"); //da = "sfsf.doc"; #endregion string billUrl = "url@" + fileModelT + "@" + BP.WF.Glo.CCFlowAppPath + "DataUser/Bill/" + path + da; @@ -1666,6 +1668,65 @@ namespace BP.WF.HttpHandler } return sas; } + public string AccepterOfGenerCaller_Init() + { + //到达的节点ID. + int toNodeID = this.GetRequestValInt("ToNode"); + string emps = this.GetRequestVal("AddEmps"); + + string sql = "SELECT MyPK,FK_Emp,FK_Node,Callers,Tag,EmpName,DeptName FROM WF_SelectCallers WHERE FK_Node = " + toNodeID + " AND FK_Emp = '" + WebUser.No + "'"; + DataTable dt = DBAccess.RunSQLReturnTable(sql); + if (BP.Difference.SystemConfig.AppCenterDBFieldCaseModel == FieldCaseModel.UpperCase) + { + dt.Columns["MYPK"].ColumnName = "MyPK"; + dt.Columns["FK_EMP"].ColumnName = "FK_Emp"; + dt.Columns["FK_NODE"].ColumnName = "FK_Node"; + dt.Columns["CALLERS"].ColumnName = "Callers"; + dt.Columns["TAG"].ColumnName = "Tag"; + dt.Columns["EMPNAME"].ColumnName = "EmpName"; + dt.Columns["DEPTNAME"].ColumnName = "DeptName"; + } + + return BP.Tools.Json.ToJson(dt); + } + /// + /// 增加常用联系人 + /// + /// + public string AccepterOfGener_AddCalls() + { + try + { + //到达的节点ID. + int toNodeID = this.GetRequestValInt("ToNode"); + string emps = this.GetRequestVal("AddEmps"); + + //增加到里面去. + BP.WF.Dev2Interface.Node_AddNextStepCalls(toNodeID, emps, false); + + string sql = "SELECT MyPK,FK_Emp,FK_Node,Callers,Tag,EmpName,DeptName FROM WF_SelectCallers WHERE FK_Node = " + toNodeID + " AND FK_Emp = '" + WebUser.No + "'"; + DataTable dt = DBAccess.RunSQLReturnTable(sql); + if (BP.Difference.SystemConfig.AppCenterDBFieldCaseModel == FieldCaseModel.UpperCase) + { + dt.Columns["MYPK"].ColumnName = "MyPK"; + dt.Columns["FK_EMP"].ColumnName = "FK_Emp"; + dt.Columns["FK_NODE"].ColumnName = "FK_Node"; + dt.Columns["CALLERS"].ColumnName = "Callers"; + dt.Columns["TAG"].ColumnName = "Tag"; + dt.Columns["EMPNAME"].ColumnName = "EmpName"; + dt.Columns["DEPTNAME"].ColumnName = "DeptName"; + } + + return BP.Tools.Json.ToJson(dt); + } + catch (Exception ex) + { + if (ex.Message.Contains("INSERT") == true) + return "err@人员名称重复,导致部分人员插入失败."; + + return "err@" + ex.Message; + } + } /// /// 增加接收人. /// @@ -1705,6 +1766,7 @@ namespace BP.WF.HttpHandler try { int toNodeID = this.GetRequestValInt("ToNode"); + string empNo = WebUser.No; if (toNodeID != 0) //排除协作模式下的会签 { Node nd = new Node(toNodeID); @@ -1716,7 +1778,16 @@ namespace BP.WF.HttpHandler ps.Add("FK_Node", toNodeID); ps.Add("WorkID", this.WorkID); int num = DBAccess.RunSQLReturnValInt(ps, 0); - if (num == 0) + //查询常用联系人 + string[] callers = this.GetRequestVal("Callers").Split(','); + foreach (string caller in callers) + { + DBAccess.RunSQL("UPDATE WF_SELECTCALLERS SET STA=1 WHERE MYPK='" + toNodeID + "_" + caller + "_" + WebUser.No + "'"); + } + //ps.Add("FK_Emp", empNo); + //ps.SQL = "SELECT count(FK_Emp) as Num FROM WF_SelectCallers WHERE FK_Node=" + SystemConfig.AppCenterDBVarStr + "FK_Node AND FK_Emp=" + SystemConfig.AppCenterDBVarStr + "FK_Emp ORDER BY IDX"; + //int num2 = DBAccess.RunSQLReturnValInt(ps,0); + if (num == 0 && callers.Length == 0) return "err@请指定下一步工作的处理人."; Selector sr = new Selector(toNodeID); if (sr.ItIsSimpleSelector == true) diff --git a/CCFlow/Components/BP.WF/Template/FindWorker.cs b/CCFlow/Components/BP.WF/Template/FindWorker.cs index 62028a9a..a8826e67 100644 --- a/CCFlow/Components/BP.WF/Template/FindWorker.cs +++ b/CCFlow/Components/BP.WF/Template/FindWorker.cs @@ -284,6 +284,33 @@ namespace BP.WF.Template ps.Add("WorkID", this.currWn.HisWork.OID); ps.SQL = "SELECT FK_Emp FROM WF_SelectAccper WHERE FK_Node=" + dbStr + "FK_Node AND WorkID=" + dbStr + "WorkID AND AccType=0 ORDER BY IDX"; dt = DBAccess.RunSQLReturnTable(ps); + dt.PrimaryKey = new DataColumn[] { dt.Columns["FK_Emp"] }; + + //查询常用联系人 + ps.Add("FK_Emp", empNo); + ps.SQL = "SELECT Callers FROM WF_SelectCallers WHERE Sta='1' AND FK_Node=" + dbStr + "FK_Node AND FK_Emp=" + dbStr + "FK_Emp ORDER BY IDX"; + //添加常用联系人 + DataTable dt2 = dt.Clone(); + dt2 = DBAccess.RunSQLReturnTable(ps); + dt2.Columns["CALLERS"].ColumnName = "FK_EMP"; + if (dt2.Rows.Count > 0) + { + foreach (DataRow dr in dt2.Rows) + { + DataRow mydr = dt.NewRow(); + if (dt.Rows.Contains(dr[0].ToString()) == true) + continue; + + mydr[0] = dr[0]; + dt.Rows.Add(mydr); + } + } + //恢复数据状态 + ps.SQL = "UPDATE WF_SelectCallers Set Sta='0' WHERE FK_Node=" + dbStr + "FK_Node AND FK_Emp=" + dbStr + "FK_Emp"; + ps.Add("FK_Emp", empNo); + ps.Add("FK_Node", this.town.HisNode.NodeID); + DBAccess.RunSQL(ps); + if (dt.Rows.Count == 0) { /*从上次发送设置的地方查询. */ diff --git a/CCFlow/Components/BP.WF/Template/Frm/MapDtlExt.cs b/CCFlow/Components/BP.WF/Template/Frm/MapDtlExt.cs index f0b32406..1b5a497b 100644 --- a/CCFlow/Components/BP.WF/Template/Frm/MapDtlExt.cs +++ b/CCFlow/Components/BP.WF/Template/Frm/MapDtlExt.cs @@ -869,6 +869,7 @@ namespace BP.WF.Template.Frm map.AddTBString(MapDtlAttr.UrlDtl, null, "自定义Url", true, false, 0, 200, 20, true); + map.AddTBString(MapDtlAttr.BtnLab, null, "扩展按钮", true, false, 0, 200, 20, true); map.AddTBString(MapDtlAttr.ColAutoExp, null, "列字段计算", true, false, 0, 200, 20, true); map.SetHelperAlert(MapDtlAttr.ColAutoExp, "用于计算指定列字段求和/求平均例如:@ShuLiang=Sum@DanJia=Sum@XiaoJi=Sum"); diff --git a/CCFlow/Components/BP.WF/Template/SelectCaller.cs b/CCFlow/Components/BP.WF/Template/SelectCaller.cs new file mode 100644 index 00000000..c48c6c38 --- /dev/null +++ b/CCFlow/Components/BP.WF/Template/SelectCaller.cs @@ -0,0 +1,348 @@ +using System; +using System.Collections; +using BP.DA; +using BP.En; +using BP.Port; + +namespace BP.WF.Template +{ + /// + /// 选择接受人属性 + /// + public class SelectCallerAttr + { + /// + /// 节点 + /// + public const string FK_Node = "FK_Node"; + /// + /// 到人员 + /// + public const string FK_Emp = "FK_Emp"; + /// + /// 操作员名称 + /// + public const string EmpName = "EmpName"; + /// + /// 部门编号 + /// + public const string FK_Dept = "FK_Dept"; + /// + /// 部门名称 + /// + public const string DeptName = "DeptName"; + /// + /// 记录人 + /// + public const string Callers = "Callers"; + /// + /// 顺序号 + /// + public const string Idx = "Idx"; + /// + /// 维度标记 + /// + public const string Tag = "Tag"; + + } + /// + /// 选择接受人 + /// 节点的到人员有两部分组成. + /// 记录了从一个节点到其他的多个节点. + /// 也记录了到这个节点的其他的节点. + /// + public class SelectCaller : EntityMyPK + { + #region 基本属性 + /// + /// UI界面上的访问控制 + /// + public override UAC HisUAC + { + get + { + UAC uac = new UAC(); + uac.OpenAll(); + return uac; + } + } + /// + ///节点 + /// + public int NodeID + { + get + { + return this.GetValIntByKey(SelectCallerAttr.FK_Node); + } + set + { + this.SetValByKey(SelectCallerAttr.FK_Node, value); + } + } + + /// + /// 到人员 + /// + public string EmpNo + { + get + { + return this.GetValStringByKey(SelectCallerAttr.FK_Emp); + } + set + { + this.SetValByKey(SelectCallerAttr.FK_Emp, value); + } + } + /// + /// 标记 + /// + public string Tag + { + get + { + return this.GetValStringByKey(SelectCallerAttr.Tag); + } + set + { + this.SetValByKey(SelectCallerAttr.Tag, value); + } + } + /// + /// 人员名称 + /// + public string EmpName + { + get + { + string s= this.GetValStringByKey(SelectCallerAttr.EmpName); + if (DataType.IsNullOrEmpty(s) == true) + s = this.EmpNo; + return s; + } + set + { + this.SetValByKey(SelectCallerAttr.EmpName, value); + } + } + /// + /// 部门名称 + /// + public string DeptName + { + get + { + return this.GetValStringByKey(SelectCallerAttr.DeptName); + } + set + { + this.SetValByKey(SelectCallerAttr.DeptName, value); + } + } + /// + /// 接收人 + /// + public string Callers + { + get + { + return this.GetValStringByKey(SelectCallerAttr.Callers); + } + set + { + this.SetValByKey(SelectCallerAttr.Callers, value); + } + } + /// + /// 顺序号 + /// + public int Idx + { + get + { + return this.GetValIntByKey(SelectCallerAttr.Idx); + } + set + { + this.SetValByKey(SelectCallerAttr.Idx, value); + } + } + + /// + /// 工作应完成日期(计划) + /// + public string DeptNo + { + get + { + return this.GetValStringByKey(SelectCallerAttr.FK_Dept); + } + set + { + this.SetValByKey(SelectCallerAttr.FK_Dept, value); + } + } + #endregion + + #region 构造方法 + /// + /// 选择接受人 + /// + public SelectCaller() + { + + } + public SelectCaller(string mypk) + { + this.setMyPK(mypk); + this.Retrieve(); + } + /// + /// 重写基类方法 + /// + public override Map EnMap + { + get + { + if (this._enMap != null) + return this._enMap; + + Map map = new Map("WF_SelectCallers", "选择常用联系人"); + map.AddMyPK(); + map.AddTBInt(SelectCallerAttr.FK_Node, 0, "接受人节点", true, false); + map.AddTBString(SelectCallerAttr.FK_Emp, null, "FK_Emp", true, false, 0, 100, 10); + map.AddTBString(SelectCallerAttr.EmpName, null, "接收人名称", true, false, 0, 60, 10); + map.AddTBString(SelectCallerAttr.FK_Dept, null, "部门编号", true, false, 0, 400, 10); + map.AddTBString(SelectCallerAttr.DeptName, null, "部门名称", true, false, 0, 400, 10); + map.AddTBString(SelectCallerAttr.Callers, null, "被选择", true, false, 0, 100, 10); + map.AddTBString(SelectCallerAttr.Tag, null, "Tag", true, false, 0, 100, 10); + + map.AddTBInt(SelectCallerAttr.Idx, 0, "顺序号(可以用于流程队列审核模式)", true, false); + /* + * add 2015-1-12. + * 为了解决多维度的人员问题. + * 在分流点向下发送时, 一个人可以分配两次任务,但是这个任务需要一个维度来区分。 + * 这个维度,有可能是一个类别,批次。 + */ + map.AddTBString(SelectCallerAttr.Tag, null, "维度信息Tag", true, false, 0, 200, 10); + + + this._enMap = map; + return this._enMap; + } + } + #endregion + + + protected override bool beforeInsert() + { + return base.beforeInsert(); + } + + protected override bool beforeUpdateInsertAction() + { + if (this.DeptName.Length == 0) + { + bool isHavePathName = DBAccess.IsExitsTableCol("Port_Dept", "NameOfpath"); + if (isHavePathName == true) + { + this.DeptName = DBAccess.RunSQLReturnStringIsNull("select a.NameOfPath from port_dept a,Port_Emp b where a.No=b.fk_dept and b.no='" + this.EmpNo + "'", "无"); + if (this.DeptName == "无") + this.DeptName = DBAccess.RunSQLReturnStringIsNull("select a.name from port_dept a,Port_Emp b where a.No=b.fk_dept and b.no='" + this.EmpNo + "'", "无"); + } + else + this.DeptName = DBAccess.RunSQLReturnStringIsNull("select a.name from port_dept a,Port_Emp b where a.No=b.fk_dept and b.no='" + this.EmpNo + "'", "无"); + } + this.Callers = BP.Web.WebUser.No; + return base.beforeUpdateInsertAction(); + } + } + /// + /// 选择接受人 + /// + public class SelectCallers : EntitiesMyPK + { + + /// + /// 他的到人员 + /// + public Emps HisEmps + { + get + { + Emps ens = new Emps(); + foreach (SelectCaller ns in this) + { + ens.AddEntity(new Emp(ns.EmpNo)); + } + return ens; + } + } + /// + /// 他的工作节点 + /// + public Nodes HisNodes + { + get + { + Nodes ens = new Nodes(); + foreach (SelectCaller ns in this) + { + ens.AddEntity(new Node(ns.NodeID)); + } + return ens; + } + } + /// + /// 选择接受人 + /// + public SelectCallers() { } + /// + /// 查询出来选择的人员 + /// + /// + /// + public SelectCallers(Int64 FK_Emp) + { + BP.En.QueryObject qo = new QueryObject(this); + qo.AddWhere(SelectCallerAttr.FK_Emp, FK_Emp); + qo.addOrderByDesc(SelectCallerAttr.FK_Node,SelectCallerAttr.Idx); + qo.DoQuery(); + } + /// + /// 得到它的 Entity + /// + public override Entity GetNewEntity + { + get + { + return new SelectCaller(); + } + } + + #region 为了适应自动翻译成java的需要,把实体转换成List. + /// + /// 转化成 java list,C#不能调用. + /// + /// List + public System.Collections.Generic.IList ToJavaList() + { + return (System.Collections.Generic.IList)this; + } + /// + /// 转化成list + /// + /// List + public System.Collections.Generic.List Tolist() + { + System.Collections.Generic.List list = new System.Collections.Generic.List(); + for (int i = 0; i < this.Count; i++) + { + list.Add((SelectCaller)this[i]); + } + return list; + } + #endregion 为了适应自动翻译成java的需要,把实体转换成List. + } +} diff --git a/CCFlow/Components/BP.WF/WF/ShiftWork.cs b/CCFlow/Components/BP.WF/WF/ShiftWork.cs index ef91e133..4834b4e6 100644 --- a/CCFlow/Components/BP.WF/WF/ShiftWork.cs +++ b/CCFlow/Components/BP.WF/WF/ShiftWork.cs @@ -113,6 +113,18 @@ namespace BP.WF } #endregion 判断是否是,admin的移交. + + //移交后写入最新待办,被移交人@BKGY + sql = ""; + sql = "INSERT INTO WEB_SOCKET (ID,USER_NO,EmpWorksNums,Flag) "; + sql += "VALUES(S_WEB_SOCKET.NEXTVAL,'" + emp.No + "','" + BP.WF.Dev2Interface.EmpWorksNums(emp.UserID) + "','0')"; + DBAccess.RunSQL(sql); + + //移交后写入最新待办,移交人@BKGY + sql = ""; + sql = "INSERT INTO WEB_SOCKET (ID,USER_NO,EmpWorksNums,Flag) "; + sql += "VALUES(S_WEB_SOCKET.NEXTVAL,'" + WebUser.No + "','" + BP.WF.Dev2Interface.Todolist_EmpWorks + "','0')"; + DBAccess.RunSQL(sql); //记录日志. Glo.AddToTrack(ActionType.Shift, nd.FlowNo, workID, gwf.FID, nd.NodeID, nd.Name, WebUser.No, WebUser.Name, nd.NodeID, nd.Name, toEmp, emp.Name, msg, null); @@ -266,6 +278,12 @@ namespace BP.WF string atPara1 = "@SendToEmpIDs=" + emp.UserID; info += "@" + ExecEvent.DoNode(EventListNode.ShitAfter, nd, work, null, atPara1); + //移交后写入最新待办 被移交人@BKGY + string sql2 = ""; + sql2 = "INSERT INTO WEB_SOCKET (ID,USER_NO,EmpWorksNums,Flag) "; + sql2 += "VALUES(S_WEB_SOCKET.NEXTVAL,'" + emp.UserID + "','" + BP.WF.Dev2Interface.EmpWorksNums(emp.UserID) + "','0')"; + DBAccess.RunSQL(sql2); + //处理移交后发送的消息事件,发送消息. PushMsgs pms1 = new PushMsgs(); pms1.Retrieve(PushMsgAttr.NodeID, nd.NodeID, PushMsgAttr.EventNo, EventListNode.ShitAfter); @@ -310,6 +328,12 @@ namespace BP.WF Glo.AddToTrack(ActionType.Shift, nd.FlowNo, workID, gwf.FID, nd.NodeID, nd.Name, WebUser.No, WebUser.Name, nd.NodeID, nd.Name, toEmps, "移交给多个人", msg, null); + //移交后写入最新待办 移交人@BKGY + string sql = ""; + sql = "INSERT INTO WEB_SOCKET (ID,USER_NO,EmpWorksNums,Flag) "; + sql += "VALUES(S_WEB_SOCKET.NEXTVAL,'" + WebUser.No + "','" + BP.WF.Dev2Interface.Todolist_EmpWorks + "','0')"; + DBAccess.RunSQL(sql); + //移交后事件. string atPara = "@SendToEmpIDs=" + toEmps; WorkNode wn = new WorkNode(work, nd); diff --git a/CCFlow/Components/BP.WF/WF/WorkFlow.cs b/CCFlow/Components/BP.WF/WF/WorkFlow.cs index 288b0731..52ce48a3 100644 --- a/CCFlow/Components/BP.WF/WF/WorkFlow.cs +++ b/CCFlow/Components/BP.WF/WF/WorkFlow.cs @@ -193,6 +193,18 @@ namespace BP.WF string sql = "UPDATE " + this.HisFlow.PTable + " SET WFState=" + (int)WFState.Delete + " WHERE OID=" + this.WorkID; DBAccess.RunSQL(sql); + sql = "SELECT WorkID ,FK_Emp FROM WF_GenerWorkerlist WHERE WorkID=" + this.WorkID; + DataTable dtNum = DBAccess.RunSQLReturnTable(sql); + foreach (DataRow dr in dtNum.Rows) + { + //流程删除前写入最新待办@BKGY + string sql2 = ""; + sql2 = "INSERT INTO WEB_SOCKET (ID,USER_NO,EmpWorksNums,Flag) "; + sql2 += "VALUES(S_WEB_SOCKET.NEXTVAL,'" + dr[1] + "','" + BP.WF.Dev2Interface.EmpWorksNums(dr[1].ToString()) + "','0')"; + DBAccess.RunSQL(sql2); + + } + //删除他的工作者,不让其有待办. sql = "DELETE FROM WF_GenerWorkerlist WHERE WorkID=" + this.WorkID; DBAccess.RunSQL(sql); @@ -201,6 +213,8 @@ namespace BP.WF gwf.WFState = BP.WF.WFState.Delete; gwf.Update(); + + //调用结束后事件. ExecEvent.DoFlow(EventListFlow.AfterFlowDel, wn, null); } @@ -597,6 +611,18 @@ namespace BP.WF pm.DoSendMessage(pnd, work, null, null, null, toEmps); } + string sql = "SELECT WorkID ,FK_Emp FROM WF_GenerWorkerlist WHERE WorkID=" + workid; + DataTable dtNum = DBAccess.RunSQLReturnTable(sql); + foreach (DataRow dr in dtNum.Rows) + { + //流程删除前写入最新待办@BKGY + string sql2 = ""; + sql2 = "INSERT INTO WEB_SOCKET (ID,USER_NO,EmpWorksNums,Flag) "; + sql2 += "VALUES(S_WEB_SOCKET.NEXTVAL,'" + dr[1] + "','" + BP.WF.Dev2Interface.EmpWorksNums(dr[1].ToString()) + "','0')"; + DBAccess.RunSQL(sql2); + + } + //删除它的工作. DBAccess.RunSQL("DELETE FROM WF_GenerWorkFlow WHERE (WorkID=" + workid + " OR FID=" + workid + " ) AND FK_Flow='" + gwf.FlowNo + "'"); DBAccess.RunSQL("DELETE FROM WF_GenerWorkerlist WHERE (WorkID=" + workid + " OR FID=" + workid + " ) AND FK_Flow='" + gwf.FlowNo + "'"); @@ -1281,6 +1307,7 @@ namespace BP.WF DBAccess.RunSQL(ps); } + // 清除工作者. ps = new Paras(); ps.SQL = "DELETE FROM WF_GenerWorkerlist WHERE WorkID=" + dbstr + "WorkID1 OR FID=" + dbstr + "WorkID2 "; @@ -1327,7 +1354,15 @@ namespace BP.WF this.GenerSKeyWords(gwf, wn.rptGe); //流程发送成功事件 string sendSuccess = ExecEvent.DoNode(EventListNode.SendSuccess, wn); - + + + //流程结束后写入最新待办@BKGY + string sql = ""; + sql = "INSERT INTO WEB_SOCKET (ID,USER_NO,EmpWorksNums,Flag) "; + sql += "VALUES(S_WEB_SOCKET.NEXTVAL,'" + WebUser.No + "','" + BP.WF.Dev2Interface.Todolist_EmpWorks + "','0')"; + DBAccess.RunSQL(sql); + + //调用结束后事件. string result = ExecEvent.DoFlow(EventListFlow.FlowOverAfter, wn, null); if (result != null) diff --git a/CCFlow/Components/BP.WF/WF/WorkNode.cs b/CCFlow/Components/BP.WF/WF/WorkNode.cs index ed429086..d383867d 100644 --- a/CCFlow/Components/BP.WF/WF/WorkNode.cs +++ b/CCFlow/Components/BP.WF/WF/WorkNode.cs @@ -1130,6 +1130,13 @@ namespace BP.WF } String msg = this.HisWorkFlow.DoFlowOver(ActionType.FlowOver, "流程已经走到最后一个节点,流程成功结束。", mynd, this.rptGe, 0, Executor, ExecutorName); + + //流程结束后写入最新待办@BKGY + string sql = ""; + sql = "INSERT INTO WEB_SOCKET (ID,USER_NO,EmpWorksNums,Flag) "; + sql += "VALUES(S_WEB_SOCKET.NEXTVAL,'" + WebUser.No + "','" + BP.WF.Dev2Interface.Todolist_EmpWorks + "','0')"; + DBAccess.RunSQL(sql); + this.addMsg(SendReturnMsgFlag.End, msg); this.addMsg(SendReturnMsgFlag.IsStopFlow, "1", BP.WF.Glo.multilingual("流程已经结束", "WorkNode", "wf_end_success"), SendReturnMsgType.Info); @@ -2180,6 +2187,36 @@ namespace BP.WF this.HisWork.DirectUpdate(); } + //若当前待办是被授权的 + Auths aths = new Auths(); + aths.Retrieve(AuthAttr.AutherToEmpNo, this.Execer); + foreach (Auth ath in aths) + { + string todata = ath.TakeBackDT.Replace("-", ""); + if (DataType.IsNullOrEmpty(ath.TakeBackDT) == false) + { + int mydt = int.Parse(todata); + int nodt = int.Parse(DateTime.Now.ToString("yyyyMMdd")); + if (mydt > nodt) + { + ps.SQL = "SELECT count(WorkID) as Num FROM WF_GenerWorkerlist WHERE IsPass=0 AND FK_Node=" + dbStr + "FK_Node AND WorkID=" + dbStr + "WorkID AND FK_Emp = '" + ath.Auther + "'"; + ps.Clear(); + ps.Add("FK_Node", this.HisNode.NodeID); + ps.Add("WorkID", this.WorkID); + int num = DBAccess.RunSQLReturnValInt(ps, 0); + if (num > 0) + { + ps.SQL = "UPDATE WF_GenerWorkerlist SET IsPass=1,IsRead=1 WHERE WorkID=" + dbStr + "WorkID AND FK_Emp='" + ath.Auther + "' AND FK_Node=" + dbStr + "FK_Node"; + ps.Clear(); + ps.Add("FK_Node", this.HisNode.NodeID); + ps.Add("WorkID", this.WorkID); + DBAccess.RunSQL(ps); + } + + } + } + } + #region 2014-08-02 删除了其他人员的待办,增加了 IsPass=0 参数. if (this.town != null && this.town.HisNode.NodeID == this.HisNode.NodeID) { @@ -2242,6 +2279,9 @@ namespace BP.WF this.HisGenerWorkFlow.Update(); return BP.WF.Glo.multilingual("@流程已经完成.", "WorkNode", "workflow_completed"); } + + + #endregion 附属功能 /// /// 普通节点到普通节点 @@ -5604,6 +5644,8 @@ namespace BP.WF //处理会签问题 this.addMsg(SendReturnMsgFlag.OverCurr, BP.WF.Glo.multilingual("@您已经完成签完工作. 当前未处理会签工作的人还有:{0}.", "WorkNode", "you_have_finished_1", todoEmps), null, SendReturnMsgType.Info); + this.addMsg("UnDo", "@撤销本次发送."); + return true; } @@ -7066,6 +7108,22 @@ namespace BP.WF this.rptGe.FlowDaySpan = DataType.GeTimeLimits(this.rptGe.GetValStringByKey(GERptAttr.FlowStartRDT), DataType.CurrentDateTime); this.rptGe.Update(); + //协作时入待办数量@BKGY + string sql = ""; + sql = "INSERT INTO WEB_SOCKET (ID,USER_NO,EmpWorksNums,Flag) "; + sql += "VALUES(S_WEB_SOCKET.NEXTVAL,'" + WebUser.No + "','" + BP.WF.Dev2Interface.Todolist_EmpWorks + "','0')"; + DBAccess.RunSQL(sql); + + //@BKGY + sql = "select FK_Emp from WF_GENERWORKERLIST where workid ='" + WorkID + "' and ISPASS='0'"; + DataTable dt2 = DBAccess.RunSQLReturnTable(sql); + foreach (DataRow dr in dt2.Rows) + { + sql = "INSERT INTO WEB_SOCKET (ID,USER_NO,EmpWorksNums,Flag) "; + sql += "VALUES(S_WEB_SOCKET.NEXTVAL,'" + dr[0].ToString() + "','" + BP.WF.Dev2Interface.EmpWorksNums(dr[0].ToString()) + "','0')"; + DBAccess.RunSQL(sql); + } + return this.HisMsgObjs; } this.HisGenerWorkFlow.HuiQianTaskSta = HuiQianTaskSta.None; diff --git a/CCFlow/Components/BP.WF/WF/WorkUnSend.cs b/CCFlow/Components/BP.WF/WF/WorkUnSend.cs index cd8d959a..d26eebd9 100644 --- a/CCFlow/Components/BP.WF/WF/WorkUnSend.cs +++ b/CCFlow/Components/BP.WF/WF/WorkUnSend.cs @@ -519,6 +519,7 @@ namespace BP.WF DBAccess.RunSQL("UPDATE WF_GenerWorkerlist SET IsPass=0 WHERE WorkID=" + this.WorkID + " AND FK_Node=" + gwf.NodeID + " AND FK_Emp='" + WebUser.No + "'"); return "撤销成功"; } + } //如果启用了对方已读,就不能撤销. @@ -534,11 +535,14 @@ namespace BP.WF if (i >= 1) return "err@当前待办已经有[" + i + "]个工作人员打开了该工作,您不能撤销."; } - //对方已审批就不能撤销 - int count = DBAccess.RunSQLReturnValInt("SELECT SUM(IsPass) AS Num FROM WF_GenerWorkerlist WHERE IsPass=1 AND (WorkID=" + this.WorkID + " OR WorkID=" + this.FID + ") AND FK_Node=" + gwf.NodeID + " AND FK_Emp!='" + WebUser.No + "'", 0); - if (count >= 1) - { - return "err@当前待办已经有[" + count + "]个工作人员处理了该工作,您不能撤销."; + if (this.UnSendToNode != nd.NodeID) { + //对方已审批就不能撤销 + int count = DBAccess.RunSQLReturnValInt("SELECT SUM(IsPass) AS Num FROM WF_GenerWorkerlist WHERE IsPass=1 AND (WorkID=" + this.WorkID + " OR WorkID=" + this.FID + ") AND FK_Node=" + gwf.NodeID + " AND FK_Emp!='" + WebUser.No + "'", 0); + if (count >= 1) + { + return "err@当前待办已经有[" + count + "]个工作人员处理了该工作,您不能撤销."; + } + } #region 如果是越轨流程状态 . @@ -658,6 +662,14 @@ namespace BP.WF cancelToNodeID, WebUser.No); gwl.PassInt = 0; gwl.Update(); + + + //撤销后后写入最新待办数量@BKGY + sql = ""; + sql = "INSERT INTO WEB_SOCKET (ID,USER_NO,EmpWorksNums,Flag) "; + sql += "VALUES(S_WEB_SOCKET.NEXTVAL,'" + WebUser.No + "','" + BP.WF.Dev2Interface.Todolist_EmpWorks + "','0')"; + DBAccess.RunSQL(sql); + return "@协作模式下,撤销成功."; } @@ -943,6 +955,13 @@ namespace BP.WF break; } } + + //撤销后后写入最新待办数量@BKGY + sql = ""; + sql = "INSERT INTO WEB_SOCKET (ID,USER_NO,EmpWorksNums,Flag) "; + sql += "VALUES(S_WEB_SOCKET.NEXTVAL,'" + WebUser.No + "','" + BP.WF.Dev2Interface.Todolist_EmpWorks + "','0')"; + DBAccess.RunSQL(sql); + return "工作已经被您撤销到:" + cancelToNode.Name; } ///