Exemple #1
0
        /// <summary>
        /// 退回当前流程
        /// </summary>
        /// <param name="context"></param>
        /// <param name="msg"></param>
        /// <param name="P1"></param>
        /// <param name="P2"></param>
        /// <param name="UserInfo"></param>
        public void REBACKWF(JObject context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo)
        {
            try
            {
                int        PID = int.Parse(P1);
                Yan_WF_PIB PIB = new Yan_WF_PIB();
                if (PIB.isCanSP(UserInfo.User.UserName, PID) == "Y")            //先判断用户能不能处理此流程
                {
                    new Yan_WF_PIB().REBACKLC(UserInfo.User.UserName, PID, P2); //结束任务
                    string ModeCode = context.Request("formcode") ?? "LCSP";

                    if (!string.IsNullOrEmpty(ModeCode))
                    {
                        Yan_WF_PI PI = new Yan_WF_PIB().GetEntity(d => d.ID == PID);


                        //消息提醒
                        SZHL_TXSX TX = new SZHL_TXSX();
                        TX.Date               = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                        TX.APIName            = "FORMBI";
                        TX.ComId              = UserInfo.User.ComId;
                        TX.FunName            = "LCSPCHECK";
                        TX.intProcessStanceid = PID;
                        TX.CRUserRealName     = UserInfo.User.UserRealName;
                        TX.MsgID              = PID.ToString();
                        TX.TXContent          = UserInfo.User.UserRealName + "退回了" + new Yan_WF_PDB().GetEntity(d => d.ID == PI.PDID.Value).ProcessName + ",请您查阅";
                        TX.TXUser             = PI.CRUser;
                        TX.TXMode             = ModeCode;
                        TX.CRUser             = UserInfo.User.UserName;
                        TXSXAPI.AddALERT(TX); //时间为发送时间
                    }
                }
                else
                {
                    msg.ErrorMsg = "该流程已被处理,您已无法处理此流程";
                }
            }
            catch (Exception ex)
            {
                msg.ErrorMsg = ex.Message;
            }
        }
Exemple #2
0
        public void MANAGEWF(JObject context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo)
        {
            try
            {
                string strShUser  = context.Request("SHUser") ?? "";
                string strCSUser  = context.Request("csr") ?? "";
                string modelcode  = context.Request("formcode") ?? "";
                string strContent = context.Request("content") ?? "";

                int PID = int.Parse(P1);



                Yan_WF_PIB PIB = new Yan_WF_PIB();
                if (PIB.isCanSP(UserInfo.User.UserName, PID) == "Y")//先判断用户能不能处理此流程
                {
                    List <string> ListNextUser = new List <string>();
                    PIB.MANAGEWF(UserInfo.User.UserName, PID, P2, ref ListNextUser, strShUser);//处理任务
                    Yan_WF_PI PI = PIB.GetEntity(d => d.ID == PID);
                    //更新抄送人
                    PI.ChaoSongUser = strCSUser;
                    PIB.Update(PI);
                    //更新抄送人

                    Yan_WF_PD PD = new Yan_WF_PDB().GetEntity(d => d.ID == PI.PDID.Value);

                    string content   = PI.CRUserName + "发起了" + PD.ProcessName + "表单,等待您审阅";
                    string strTXUser = ListNextUser.ListTOString(',');
                    string funName   = "LCSPCHECK";
                    //添加消息提醒
                    string strIsComplete = ListNextUser.Count() == 0 ? "Y" : "N"; //结束流程,找不到人了
                    if (strIsComplete == "Y")                                     //找不到下家就结束流程,并且给流程发起人发送消息
                    {
                        PIB.ENDWF(PID);
                        msg.Result = "Y";//已结束
                        content    = UserInfo.User.UserRealName + "审批完成了您发起的" + PD.ProcessName + "表单";
                        strTXUser  = PI.CRUser;
                        funName    = "LCSPCHECK";
                        //发送消息给抄送人
                        if (!string.IsNullOrEmpty(PI.ChaoSongUser))
                        {
                            SZHL_TXSX CSTX = new SZHL_TXSX();
                            CSTX.Date               = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                            CSTX.APIName            = "FORMBI";
                            CSTX.ComId              = UserInfo.User.ComId;
                            CSTX.FunName            = "LCSPCHECK";
                            CSTX.intProcessStanceid = PID;
                            CSTX.CRUserRealName     = UserInfo.User.UserRealName;
                            CSTX.MsgID              = PID.ToString();
                            CSTX.TXContent          = new JH_Auth_UserB().GetEntity(p => p.ComId == PI.ComId && p.UserName == PI.CRUser).UserRealName + "抄送一个" + PD.ProcessName + ",请您查阅接收";
                            CSTX.ISCS               = "Y";
                            CSTX.TXUser             = PI.ChaoSongUser;
                            CSTX.TXMode             = modelcode;
                            CSTX.CRUser             = UserInfo.User.UserName;
                            TXSXAPI.AddALERT(CSTX); //时间为发送时间
                        }
                    }
                    SZHL_TXSX TX = new SZHL_TXSX();
                    TX.Date               = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                    TX.APIName            = "FORMBI";
                    TX.ComId              = UserInfo.User.ComId;
                    TX.FunName            = funName;
                    TX.intProcessStanceid = PID;
                    TX.CRUser             = PI.CRUser;
                    TX.CRUserRealName     = UserInfo.User.UserRealName;
                    TX.MsgID              = PID.ToString();
                    TX.TXContent          = content;
                    TX.TXUser             = strTXUser;
                    TX.TXMode             = modelcode;
                    TXSXAPI.AddALERT(TX); //时间为发送时间
                }
                else
                {
                    msg.ErrorMsg = "该流程已被处理,您已无法处理此流程";
                }
            }
            catch (Exception ex)
            {
                msg.ErrorMsg = ex.Message;
            }
        }