You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
236 lines
11 KiB
236 lines
11 KiB
using System;
|
|
using System.Collections;
|
|
using System.Configuration;
|
|
using System.Data;
|
|
using System.Drawing;
|
|
using System.Web;
|
|
using System.Web.Security;
|
|
using System.Web.UI;
|
|
using System.Web.UI.HtmlControls;
|
|
using System.Web.UI.WebControls;
|
|
using System.Web.UI.WebControls.WebParts;
|
|
using hyplat.bean.workflat;
|
|
using hyplat.biz.service.workflat;
|
|
using hyplat.biz;
|
|
using System.Collections.Generic;
|
|
using hyplat.utilities;
|
|
using hyplat.biz.service.organization;
|
|
using hyplat.biz.service.user;
|
|
using System.Text;
|
|
using hyplat.bean.plat.workflow;
|
|
using hyplat.biz.service.plat.workflow;
|
|
using hyplat.bean.SMSremind;
|
|
using hyplat.biz.service.SMSremind;
|
|
using hyplat.bean.user;
|
|
|
|
public partial class office_workflow_OAjfw_JFWEdit : System.Web.UI.Page
|
|
{
|
|
|
|
public string fileName;
|
|
//public DataTable dt = new DataTable();
|
|
private ProcessInstanceService processInstanceService = ServiceManager.getServiceBean("ProcessInstanceService") as ProcessInstanceService;
|
|
private UserCaService userCaS = ServiceManager.getServiceBean("UserCaService") as UserCaService;
|
|
//当前环节的所有的action
|
|
public DataTable dtAction = null;
|
|
//流程定义
|
|
public DataTable dtPro = null;
|
|
//表单中的流程实例
|
|
public DataTable dtProcessInstance = null;
|
|
|
|
public string iDBody1Display;
|
|
public string iDBody2Display;
|
|
public string iDBody3Display;
|
|
public string iDBody4Display;
|
|
public string iDBody5Display;
|
|
|
|
|
|
//签名定义
|
|
protected string documentid = ""; //formid
|
|
protected string signatureid = ""; //instanceid
|
|
|
|
protected string caName = "";
|
|
protected string isqzbool = "";
|
|
protected string issignature = "none";
|
|
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
//是否签章验证
|
|
isqzbool = DictionaryClass.getIsSignature(Session["RoleID"].ToString());
|
|
if (isqzbool == "true")
|
|
{
|
|
issignature = "";
|
|
//电子签名
|
|
if (Session["UserId"] != null && Session["UserId"].ToString() != "")
|
|
{
|
|
DataTable dtca = userCaS.GetByUserId(Session["UserId"].ToString());
|
|
if (dtca != null && dtca.Rows.Count > 0)
|
|
{
|
|
caName = dtca.Rows[0]["ca"].ToString();
|
|
}
|
|
}
|
|
//签章,流程记录id
|
|
signatureid = hidRecordid.Value;
|
|
|
|
}
|
|
|
|
|
|
//先判断是否session过期
|
|
LoginLogic.reloadSession();
|
|
HiddenFieldUserName.Value = Session["UserName"].ToString();
|
|
//流程实例Table
|
|
dtProcessInstance = processInstanceService.getProcessInstanceByID(Request.QueryString["instanceId"].ToString());
|
|
//动作Table
|
|
NodeActionService nodeActionService = ServiceManager.getServiceBean("NodeActionService") as NodeActionService;
|
|
dtAction = nodeActionService.getActionsByNodeIDAndProcessID(dtProcessInstance.Rows[0]["currentNodeID"].ToString(), dtProcessInstance.Rows[0]["processID"].ToString());
|
|
iDBody2Display = "none";
|
|
iDBody3Display = "none";
|
|
iDBody4Display = "none";
|
|
|
|
|
|
|
|
if (!IsPostBack)
|
|
{
|
|
change.Value = "0";
|
|
HiddenField1.Value = DateTime.Now.ToString();
|
|
txthide.Text = SIDWrapper.getSID("FilesId");//生成表单主键
|
|
documentid = txthide.Text; //签章的documentid
|
|
|
|
//签章
|
|
hidRecordid.Value = SIDWrapper.getSID("InstanceRecord"); //审批记录ID
|
|
signatureid = hidRecordid.Value;
|
|
|
|
}
|
|
|
|
#region
|
|
this.TxtTitle.Text = Server.UrlDecode(Request.QueryString["Title"].ToString());
|
|
fileName = dtProcessInstance.Rows[0]["docpath"].ToString();
|
|
hiddenFieldFileName.Value = fileName;
|
|
SOAOfficeX.SOAOfficeCtrl SOACtrl = new SOAOfficeX.SOAOfficeCtrl();
|
|
|
|
SOACtrl.ServerURL = "../soaservice/soaserv.aspx";
|
|
SOACtrl.MainStyle = SOAOfficeX.soaMainStyle.VistaBlue;
|
|
SOACtrl.Caption = "编辑或查看正文";
|
|
SOACtrl.BorderStyle = SOAOfficeX.soaBorderStyle.BorderNone;
|
|
SOACtrl.MenubarStyle = SOAOfficeX.soaMenubarStyle.Center1;
|
|
SOACtrl.MenubarColor = Color.FromArgb(236, 233, 216);
|
|
SOACtrl.TitlebarTextColor = Color.FromArgb(80, 192, 72);
|
|
SOACtrl.TitlebarColor = Color.ForestGreen;
|
|
|
|
HiddenFieldShiLi.Value = Request.QueryString["instanceId"].ToString();//实例ID
|
|
HiddenFieldLiuCheng.Value = Request.QueryString["processId"].ToString();//流程ID
|
|
ProcessDefinitionService processDefinitionService = ServiceManager.getServiceBean("ProcessDefinitionService") as ProcessDefinitionService;
|
|
dtPro = processDefinitionService.getProcessDefinitionByID(HiddenFieldLiuCheng.Value);
|
|
|
|
SDepartmentService deptService = (SDepartmentService)ServiceManager.getServiceBean("SDepartmentService");
|
|
DataTable dtDept = deptService.getSDepartmentByID(Session["DeptID"].ToString());
|
|
TxtFilesDraftOffice.Text = dtDept.Rows[0]["DeptName"].ToString();
|
|
TxtFilesDraftPerson.Text = Session["UserName"].ToString();
|
|
|
|
SOACtrl.SaveDocURL = "SaveDoc/SaveDoc2.aspx";
|
|
SOACtrl.FileTitle = StringHandler.replaceIllegalCharacter(TxtTitle.Text.Trim());
|
|
SOACtrl.WebOpen(fileName, SOAOfficeX.soaWorkMode.docAdmin, Session["UserName"].ToString(), "Word.Document");
|
|
|
|
#endregion
|
|
string[] manageDept = new OrgTool().getManageDeptByID(Session["DeptID"].ToString()).Split(',');
|
|
//套红doc表头
|
|
docHead.Value = manageDept[1];
|
|
}
|
|
|
|
protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
|
|
{
|
|
//先判断是否session过期
|
|
LoginLogic.reloadSession();
|
|
//DataTable dtInstance = processInstanceService.getProcessInstanceByID(HiddenFieldShiLi.Value);
|
|
//判断瞬间重复多次提交
|
|
if (dtProcessInstance.Rows[0]["currentProcesserID"].ToString() != Request.Form["hh"].ToString() || dtProcessInstance.Rows[0]["currentActionID"].ToString() != HiddenField4.Value)
|
|
{
|
|
//更新的流程实例
|
|
ProcessInstance processInstance = new ProcessInstance();
|
|
processInstance.instanceID = HiddenFieldShiLi.Value;
|
|
processInstance.processID = dtProcessInstance.Rows[0]["processID"].ToString();
|
|
processInstance.drafterID = dtProcessInstance.Rows[0]["drafterID"].ToString();
|
|
processInstance.drafterTime = (DateTime)dtProcessInstance.Rows[0]["drafterTime"];
|
|
//需要修改的字段
|
|
//当前处理人ID=====>下一步处理人的ID
|
|
processInstance.currentProcesserID = Request.Form["hh"].ToString();
|
|
//当前动作=========选择的下一步处理动作
|
|
processInstance.currentActionID = HiddenField4.Value;//当前处理动作
|
|
//当前环节=========>所选择的动作的环节ID
|
|
processInstance.currentNodeID = Request.Form["hiddenradio"].ToString();
|
|
//当前状态
|
|
processInstance.instanceStatus = "00";
|
|
//表单ID
|
|
processInstance.formID = txthide.Text;
|
|
//表单标题
|
|
processInstance.formTitleName = TxtTitle.Text;
|
|
processInstance.docPath = hiddenFieldFileName.Value;
|
|
processInstance.workType = dtPro.Rows[0]["processName"].ToString();
|
|
/*上一步处理人信息*/
|
|
processInstance.priorProcesserID = dtProcessInstance.Rows[0]["currentProcesserID"].ToString();
|
|
processInstance.priorNodeID = dtProcessInstance.Rows[0]["currentNodeID"].ToString();
|
|
processInstance.priorActionID = dtProcessInstance.Rows[0]["currentActionID"].ToString();
|
|
///发起部门
|
|
processInstance.CreateDept = dtProcessInstance.Rows[0]["CreateDept"].ToString();
|
|
processInstance.CreateDeptId = dtProcessInstance.Rows[0]["CreateDeptId"].ToString();
|
|
//审批记录
|
|
InstanceRecord instanceRecord = new InstanceRecord();
|
|
instanceRecord.recordID = hidRecordid.Value;
|
|
instanceRecord.instanceID = HiddenFieldShiLi.Value;//实例ID
|
|
instanceRecord.processID = HiddenFieldLiuCheng.Value;//流程ID
|
|
instanceRecord.currentProcesserID = Session["UserId"].ToString();//当前处理人
|
|
instanceRecord.currentProcessTime = DateTime.Now;//当前处理时间
|
|
instanceRecord.currentNodeID = processInstance.currentNodeID;//当前处理环节
|
|
instanceRecord.currentNodeActionID = processInstance.currentActionID;//当前处理动作
|
|
instanceRecord.nextProcesserID = Request.Form["hh"].ToString();//Request.Form["hh"].ToString();下一步处理人
|
|
instanceRecord.nextNodeID = processInstance.currentNodeID;//修改通过查询得到
|
|
instanceRecord.status = "00";
|
|
///当前处理人的部门
|
|
instanceRecord.currentDeptName = Session["DeptName"].ToString();
|
|
instanceRecord.currentDeptId = Session["DeptID"].ToString();
|
|
|
|
//处理意见
|
|
|
|
InstanceOpinion instanceOpinion = new InstanceOpinion();
|
|
instanceOpinion.recordID = instanceRecord.recordID;
|
|
instanceOpinion.instanceID = processInstance.instanceID;//流程实例ID
|
|
instanceOpinion.processID = instanceRecord.processID;
|
|
instanceOpinion.opinion = txtTransactMessage.Text;
|
|
instanceOpinion.isRemind = this.CheckBox6.Checked == true ? "01" : "00";
|
|
|
|
|
|
//如果选择了消息提醒,在消息提醒表中添加一条记录
|
|
if (this.CheckBox6.Checked == true)
|
|
{
|
|
//添加一条消息提醒记录,多个接受者添加多条记录
|
|
//string receiveID = txtuserIDs.Text.Trim();
|
|
string receiveUserID = Request.Form["hh"].ToString();
|
|
|
|
SMS sms = new SMS();
|
|
sms.msgContent = dtProcessInstance.Rows[0]["formTitleName"].ToString();
|
|
sms.msgID = dtProcessInstance.Rows[0]["formID"].ToString();
|
|
sms.msgSource = "工作流_" + dtPro.Rows[0]["processName"].ToString();
|
|
sms.senderID = Session["UserID"].ToString();
|
|
sms.sendTime = DateTime.Now.ToString();
|
|
sms.status = "00";
|
|
//添加一个消息提醒记录
|
|
SMSService smsService = ServiceManager.getServiceBean("SMSService") as SMSService;
|
|
smsService.addSMS(sms, receiveUserID);
|
|
#region 发送短信
|
|
MsgWs msgWs = new MsgWs();
|
|
msgWs.SendWaitWorkMsg(Session["UserId"].ToString(), Request.Form["hh"].ToString(), dtProcessInstance.Rows[0]["formTitleName"].ToString(), dtPro.Rows[0]["processName"].ToString(), "", "");
|
|
#endregion
|
|
|
|
}
|
|
ProcessManagerService processManagerService = ServiceManager.getServiceBean("ProcessManagerService") as ProcessManagerService;
|
|
processManagerService.nextProcess(instanceRecord, instanceOpinion, processInstance);
|
|
}
|
|
Response.Write("<script>alert('操作成功');window.location.href='../Transact.aspx'</script>");
|
|
}
|
|
|
|
//打印表单
|
|
protected void imgBtnPrint_Click(object sender, ImageClickEventArgs e)
|
|
{
|
|
string url = "Print.aspx?shiliID=" + HiddenFieldShiLi.Value;
|
|
Page.ClientScript.RegisterStartupScript(this.GetType(), "", " <script type='text/JavaScript'>window.open('" + url + "'); </script>");
|
|
}
|
|
}
|
|
|