/// <summary> /// 获取样品信息 /// </summary> /// <returns></returns> private string getSampleGridInfo(string strTaskID, string strSubTaskID) { //huangjinjun add 2016.1.26 如果REMARK3等于true,将ph值、电导率、溶解氧设为分析项目 TMisMonitorTaskVo tm = new TMisMonitorTaskVo(); TMisMonitorSubtaskVo tmsub = new TMisMonitorSubtaskVo(); tmsub = new TMisMonitorSubtaskLogic().Details(strSubTaskID); tm.ID = tmsub.TASK_ID; DataTable dtRemark = new TMisMonitorTaskLogic().SelectByTable(tm); if (dtRemark.Rows[0]["REMARK3"].ToString() == "true") { bool bl = new TBaseItemInfoLogic().EditItemTypeFX(); } else { bool bl = new TBaseItemInfoLogic().EditItemTypeXC(); } var strCCflowWorkId = Request.QueryString["strCCflowWorkId"]; var identification = CCFlowFacade.GetFlowIdentification(LogInfo.UserInfo.USER_NAME, Convert.ToInt64(strCCflowWorkId)); var sampleIdList = identification.Split(new string[] { "|" }, StringSplitOptions.RemoveEmptyEntries).ToList(); if (sampleIdList.Count > 0) { sampleIdList.RemoveAt(0); } if (sampleIdList.Count == 0) { DataTable dt = new TMisMonitorResultLogic().getSampleCodeInAlloction_MAS(strTaskID, strSubTaskID); string strJson = CreateToJson(dt, 0); return(strJson); } else { DataTable dt = new TMisMonitorResultLogic().getSampleCodeInAlloction_MAS(strTaskID, strSubTaskID); var newDT = new DataTable(); foreach (DataColumn column in dt.Columns) { newDT.Columns.Add(column.ColumnName); } for (int i = 0; i < dt.Rows.Count; i++) { if (!sampleIdList.Contains(dt.Rows[i]["ID"].ToString())) { continue; } newDT.Rows.Add(dt.Rows[i].ItemArray); } string strJson = CreateToJson(newDT, 0); return(strJson); } }
/// <summary> /// 获得包含现场项目的点位信息 /// </summary> /// <returns>Json</returns> protected string GetPointInfo() { var strCCflowWorkId = Request.QueryString["strCCflowWorkId"]; var identification = CCFlowFacade.GetFlowIdentification(LogInfo.UserInfo.USER_NAME, Convert.ToInt64(strCCflowWorkId)); var sampleIdList = identification.Split(new string[] { "|" }, StringSplitOptions.RemoveEmptyEntries).ToList(); if (sampleIdList.Count > 0) { sampleIdList.RemoveAt(0); } DataTable dt = new TMisMonitorTaskPointLogic().SelectSampleDeptPoint(this.SUBTASK_ID.Value, "1,2", sampleIdList: sampleIdList); int intTotalCount = dt.Rows.Count; for (int i = 0; i < dt.Rows.Count; i++) { TMisMonitorSampleInfoVo objSample = new TMisMonitorSampleInfoVo(); objSample.POINT_ID = dt.Rows[i]["ID"].ToString(); objSample.SUBTASK_ID = this.SUBTASK_ID.Value; objSample = new TMisMonitorSampleInfoLogic().Details(objSample); dt.Rows[i]["REMARK1"] = objSample.SAMPLE_CODE; dt.Rows[i]["REMARK2"] = objSample.SAMPLE_NAME; } string strJson = CreateToJson(dt, intTotalCount); return(strJson); }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { //定义结果 string strResult = ""; if (Request.QueryString["WorkID"] != null) { var workID = Convert.ToInt64(Request.QueryString["WorkID"]); var identification = CCFlowFacade.GetFlowIdentification(LogInfo.UserInfo.USER_NAME, workID); this.SUBTASK_ID.Value = identification; } //任务信息 if (Request["type"] != null && Request["type"].ToString() == "getOneGridInfo") { strResult = getOneGridInfo(Request["strSample"].ToString()); Response.Write(strResult); Response.End(); } //获取监测类别信息 if (Request["type"] != null && Request["type"].ToString() == "getTwoGridInfo") { strResult = getTwoGridInfo(Request["oneGridId"].ToString(), Request["strSample"].ToString()); Response.Write(strResult); Response.End(); } //获取样品信息 if (Request["type"] != null && Request["type"].ToString() == "getThreeGridInfo") { strResult = getThreeGridInfo(Request["twoGridId"].ToString()); Response.Write(strResult); Response.End(); } //获取监测项目信息 if (Request["type"] != null && Request["type"].ToString() == "getFourGridInfo") { strResult = getFourGridInfo(Request["threeGridId"].ToString(), Request["strSample"].ToString()); Response.Write(strResult); Response.End(); } //获取实验室质控信息 if (Request["type"] != null && Request["type"].ToString() == "getFiveGridInfo") { strResult = getFiveGridInfo(Request["fourGridId"].ToString()); Response.Write(strResult); Response.End(); } //获取现场复核人信息 if (Request["type"] != null && Request["type"].ToString() == "GetCheckUser") { strResult = GetCheckUser(Request["strSubTaskID"].ToString()); Response.Write(strResult); Response.End(); } } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { //定义结果 string strResult = ""; if (Request.QueryString["WorkID"] != null) { var FID = Convert.ToInt64(Request.QueryString["FID"]); //获取主流程ID TMisContractPlanVo objPlanVo = new TMisContractPlanVo(); objPlanVo.CCFLOW_ID1 = FID.ToString(); objPlanVo = new TMisContractPlanLogic().Details(objPlanVo); if (objPlanVo.ID.Length > 0 && objPlanVo.REAMRK1 == "1") { //当前流程属于送样的 this.TASK_ID.Value = new TMisMonitorTaskLogic().Details(new TMisMonitorTaskVo { PLAN_ID = objPlanVo.ID }).ID; this.SUBTASK_ID.Value = ""; } else { //当前流程属于采样的 var workID = Convert.ToInt64(Request.QueryString["WorkID"]); //获取子流程ID var identification = CCFlowFacade.GetFlowIdentification(LogInfo.UserInfo.USER_NAME, workID).Split('|')[0]; this.SUBTASK_ID.Value = identification; this.TASK_ID.Value = ""; } } //任务信息 if (Request["type"] != null && Request["type"].ToString() == "getOneGridInfo") { strResult = getOneGridInfo(Request["strTaskID"].ToString(), Request["strSubTaskID"].ToString()); Response.Write(strResult); Response.End(); } //监测项目类别 if (Request["type"] != null && Request["type"].ToString() == "getTwoGridInfo") { strResult = getTwoGridInfo(Request["oneGridId"].ToString(), Request["strSubTaskID"].ToString()); Response.Write(strResult); Response.End(); } //监测项目信息 if (Request["type"] != null && Request["type"].ToString() == "getThreeGridInfo") { strResult = getThreeGridInfo(Request["twoGridId"].ToString(), Request["TaskID"].ToString()); Response.Write(strResult); Response.End(); } } }
/// <summary> /// 获取样品信息 /// </summary> /// <returns></returns> private string getThreeGridInfo(string strTwoGridId) { string strSortname = Request.Params["sortname"]; string strSortorder = Request.Params["sortorder"]; //当前页面 int intPageIndex = Convert.ToInt32(Request.Params["page"]); //每页记录数 int intPageSize = Convert.ToInt32(Request.Params["pagesize"]); var strCCflowWorkId = Request.QueryString["strCCflowWorkId"]; var subFlowId = CCFlowFacade.GetFatherThreadIDOfSubFlow(LogInfo.UserInfo.USER_NAME, Convert.ToInt64(strCCflowWorkId)); var subFlowIdentification = CCFlowFacade.GetFlowIdentification(LogInfo.UserInfo.USER_NAME, subFlowId); var sampleIdList = subFlowIdentification.Split(new string[] { "|" }, StringSplitOptions.RemoveEmptyEntries).ToList(); if (sampleIdList.Count > 0) { sampleIdList.RemoveAt(0); } DataTable dt = new DataTable(); int intTotalCount = 0; dt = new TMisMonitorSampleInfoLogic().SelectSampleSitePoint(strTwoGridId); intTotalCount = new TMisMonitorSampleInfoLogic().SelectSampleSitePointCount(strTwoGridId); var newDT = new DataTable(); foreach (DataColumn column in dt.Columns) { newDT.Columns.Add(column.ColumnName); } foreach (DataRow row in dt.Rows) { if (sampleIdList.Count > 0 && !sampleIdList.Contains(row["ID"].ToString())) { intTotalCount--; continue; } newDT.Rows.Add(row.ItemArray); } //dt = new TMisMonitorSampleInfoLogic().getSamplingForSampleItemOne_MAS(strTwoGridId, intPageIndex, intPageSize); //intTotalCount = new TMisMonitorSampleInfoLogic().getSamplingCountForSampleItemOne_MAS(strTwoGridId); //dt = new TMisMonitorTaskPointLogic().SelectSampleDeptPoint(strTwoGridId); //intTotalCount = dt.Rows.Count; string strJson = CreateToJson(newDT, intTotalCount); return(strJson); }
public static string isSendToCheck(string strSubTaskID, string strCCFlowID = "", string strUserNo = "") { var sampleIdList = CCFlowFacade.GetFlowIdentification(strUserNo, Convert.ToInt64(strCCFlowID)).Split(new string[] { "|" }, StringSplitOptions.RemoveEmptyEntries).ToList(); if (sampleIdList.Count > 0) { sampleIdList.RemoveAt(0); } DataTable dtSampleItem = new TMisMonitorResultLogic().SelectSampleItemWithSubtaskID(strSubTaskID, sampleIdList: sampleIdList); return(dtSampleItem.Rows.Count > 0 ? "1" : "0"); }
private string isSendToCheck2() { string strSubTaskID = Request.QueryString["strSubTaskID"]; string strCCFlowID = Request.QueryString["strCCflowWorkId"]; var sampleIdList = CCFlowFacade.GetFlowIdentification(base.LogInfo.UserInfo.USER_NAME, Convert.ToInt64(strCCFlowID)).Split(new string[] { "|" }, StringSplitOptions.RemoveEmptyEntries).ToList(); if (sampleIdList.Count > 0) { sampleIdList.RemoveAt(0); } DataTable dtSampleItem = new TMisMonitorResultLogic().SelectSampleItemWithSubtaskID(strSubTaskID, sampleIdList: sampleIdList); return(dtSampleItem.Rows.Count > 0 ? "1" : "0"); }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { if (Request.QueryString["type"] == "check") { Response.ContentEncoding = Encoding.GetEncoding("gb2312"); //Response.Write("false分析负责人信息没有选择完整,请检查"); ////Response.ContentEncoding = Encoding.UTF8 ; //Response.ContentEncoding = Encoding.GetEncoding("GB2312"); //Response.ContentType = "text/plain"; //Response.End(); var strTaskID = ""; var strSubTaskID = ""; var FID = Convert.ToInt64(Request.QueryString["FID"]); var UserNo = Request.QueryString["UserNo"]; UserNo = UserNo.Split(',').Count() > 1 ? UserNo.Split(',')[1] : UserNo; var workID = Convert.ToInt32(Request.QueryString["OID"]);//OID为流程ID TMisContractPlanVo objPlanVo = new TMisContractPlanVo(); objPlanVo.CCFLOW_ID1 = FID.ToString(); objPlanVo = new TMisContractPlanLogic().Details(objPlanVo); if (objPlanVo.ID.Length > 0 && objPlanVo.REAMRK1 == "1") { //当前流程属于送样的 strTaskID = new TMisMonitorTaskLogic().Details(new TMisMonitorTaskVo { PLAN_ID = objPlanVo.ID }).ID; strSubTaskID = ""; } else { strTaskID = ""; strSubTaskID = CCFlowFacade.GetFlowIdentification(UserNo, workID).Split('|')[0]; } var flowId = Request.QueryString["FK_Flow"]; var nodeId = Convert.ToInt32(Request.QueryString["FK_Node"]); var fid = Convert.ToInt32(Request.QueryString["FID"]); var identification = CCFlowFacade.GetFlowIdentification(UserNo, Convert.ToInt64(workID)); var sampleIdList = identification.Split(new string[] { "|" }, StringSplitOptions.RemoveEmptyEntries).ToList(); if (sampleIdList.Count > 0) { sampleIdList.RemoveAt(0); } DataTable dtInfo = new TMisMonitorResultLogic().getItemInfoBySubTaskID_MAS(strTaskID, strSubTaskID, true); var newDT = new DataTable(); foreach (DataColumn column in dtInfo.Columns) { newDT.Columns.Add(column.ColumnName); } foreach (DataRow row in dtInfo.Rows) { if (sampleIdList.Count == 0) { newDT.Rows.Add(row.ItemArray); } else if (sampleIdList.Contains(row["SampleID"].ToString())) { newDT.Rows.Add(row.ItemArray); } } for (int i = 0; i < newDT.Rows.Count; i++) { if (dtInfo.Rows[i]["USER_NAME"].ToString() == "") { Response.Write("false分析负责人信息没有选择完整,请检查"); Response.ContentType = "text/plain"; Response.End(); } } Response.Write("true"); Response.ContentType = "text/plain"; Response.End(); } if (Request.QueryString["type"] == "checkAfter") { Response.ContentEncoding = Encoding.GetEncoding("gb2312"); var strTaskID = ""; var strSubTaskID = ""; var FID = Convert.ToInt64(Request.QueryString["FID"]); var UserNo = Request.QueryString["UserNo"]; UserNo = UserNo.Split(',').Count() > 1 ? UserNo.Split(',')[1] : UserNo; UserNo = UserNo.Trim(','); var workID = Convert.ToInt32(Request.QueryString["OID"]);//OID为流程ID TMisContractPlanVo objPlanVo = new TMisContractPlanVo(); objPlanVo.CCFLOW_ID1 = FID.ToString(); objPlanVo = new TMisContractPlanLogic().Details(objPlanVo); if (objPlanVo.ID.Length > 0 && objPlanVo.REAMRK1 == "1") { //当前流程属于送样的 strTaskID = new TMisMonitorTaskLogic().Details(new TMisMonitorTaskVo { PLAN_ID = objPlanVo.ID }).ID; strSubTaskID = ""; } else { strTaskID = ""; strSubTaskID = CCFlowFacade.GetFlowIdentification(UserNo, workID).Split('|')[0]; } var flowId = Request.QueryString["FK_Flow"].Trim(','); var nodeId = Convert.ToInt32(Request.QueryString["FK_Node"]); var fid = Convert.ToInt32(Request.QueryString["FID"]); var childFlowID = System.Configuration.ConfigurationManager.AppSettings["FXSSH"].ToString().Trim(','); var childNodeID = Convert.ToInt32(System.Configuration.ConfigurationManager.AppSettings["FXSSHJNode"]); var childFlowID2 = System.Configuration.ConfigurationManager.AppSettings["FXLXCXM"].ToString().Trim(','); var childNodeID2 = Convert.ToInt32(System.Configuration.ConfigurationManager.AppSettings["FXLXCXMJNode"]); var identification = CCFlowFacade.GetFlowIdentification(UserNo, Convert.ToInt64(workID)); var sampleIdList = identification.Split(new string[] { "|" }, StringSplitOptions.RemoveEmptyEntries).ToList(); if (sampleIdList.Count > 0) { sampleIdList.RemoveAt(0); } DataTable dtInfo = new TMisMonitorResultLogic().getItemInfoBySubTaskID_MAS(strTaskID, strSubTaskID, true); var newDT = new DataTable(); foreach (DataColumn column in dtInfo.Columns) { newDT.Columns.Add(column.ColumnName); } foreach (DataRow row in dtInfo.Rows) { if (sampleIdList.Count == 0) { newDT.Rows.Add(row.ItemArray); } else if (sampleIdList.Contains(row["SampleID"].ToString())) { newDT.Rows.Add(row.ItemArray); } } for (int i = 0; i < newDT.Rows.Count; i++) { if (dtInfo.Rows[i]["USER_NAME"].ToString() == "") { Response.Write("false分析负责人信息没有选择完整,请检查"); Response.ContentType = "text/plain"; Response.End(); } var itemVo = new TBaseItemInfoLogic().Details(dtInfo.Rows[i]["ITEM_ID"].ToString()); var sampleVo = new TMisMonitorSampleInfoLogic().Details(dtInfo.Rows[i]["SAMPLE_ID"].ToString()); var subtaskVO = new TMisMonitorSubtaskLogic().Details(sampleVo.SUBTASK_ID); var taskVo = new TMisMonitorTaskLogic().Details(subtaskVO.TASK_ID); long workid = 0; var title = string.Format("{0} {1}", taskVo.PROJECT_NAME, itemVo.ITEM_NAME); if (dtInfo.Rows[i]["IS_ANYSCENE_ITEM"].ToString() == "1") //分析类现场项目 { //在采样实施环节创建 //workid = CCFlowFacade.Node_CreateBlankWork(UserNo, childFlowID2, UserNo, null, workID, fid, flowId, nodeId, UserNo, childNodeID2, dtInfo.Rows[i]["USER_NAME"].ToString().Trim(','), "@GroupMark=" + dtInfo.Rows[i]["RESULTID"].ToString().Trim(',')); //CCFlowFacade.SetFlowTitle(Request["UserNo"].ToString(), childFlowID2, workid, title); } else { workid = CCFlowFacade.Node_CreateBlankWork(UserNo, childFlowID, UserNo, null, workID, fid, flowId, nodeId, UserNo, childNodeID, dtInfo.Rows[i]["USER_NAME"].ToString().Trim(','), "@GroupMark=" + dtInfo.Rows[i]["RESULTID"].ToString().Trim(',')); CCFlowFacade.SetFlowTitle(Request["UserNo"].ToString(), childFlowID, workid, title); } } Response.Write("发送成功"); Response.ContentType = "text/plain"; Response.End(); } //定义结果 string strResult = ""; if (Request.QueryString["WorkID"] != null) { var FID = Convert.ToInt64(Request.QueryString["FID"]); TMisContractPlanVo objPlanVo = new TMisContractPlanVo(); objPlanVo.CCFLOW_ID1 = FID.ToString(); objPlanVo = new TMisContractPlanLogic().Details(objPlanVo); this.PLAN_ID.Value = objPlanVo.ID; if (objPlanVo.ID.Length > 0 && objPlanVo.REAMRK1 == "1") { //当前流程属于送样的 this.TASK_ID.Value = new TMisMonitorTaskLogic().Details(new TMisMonitorTaskVo { PLAN_ID = objPlanVo.ID }).ID; this.SUBTASK_ID.Value = ""; } else { //当前流程属于采样的 var workID = Convert.ToInt64(Request.QueryString["WorkID"]); var identification = CCFlowFacade.GetFlowIdentification(LogInfo.UserInfo.USER_NAME, workID).Split('|')[0]; this.SUBTASK_ID.Value = identification; this.TASK_ID.Value = ""; } } //样品号信息 if (Request["type"] != null && Request["type"].ToString() == "getSampleGridInfo") { strResult = getSampleGridInfo(Request["strTaskID"].ToString(), Request["strSubTaskID"].ToString()); Response.Write(strResult); Response.End(); } //监测项目信息 if (Request["type"] != null && Request["type"].ToString() == "getItemGridInfo") { strResult = getItemGridInfo(Request["SampleID"].ToString()); Response.Write(strResult); Response.End(); } } }
/// <summary> /// 获取监测项目信息 /// </summary> /// <returns></returns> private string getThreeGridInfo(string strTwoGridId, string strTaskID) { string strSortname = Request.Params["sortname"]; string strSortorder = Request.Params["sortorder"]; //当前页面 int intPageIndex = Convert.ToInt32(Request.Params["page"]); //每页记录数 int intPageSize = Convert.ToInt32(Request.Params["pagesize"]); var strCCflowWorkId = Request.QueryString["strCCflowWorkId"]; var identification = CCFlowFacade.GetFlowIdentification(LogInfo.UserInfo.USER_NAME, Convert.ToInt64(strCCflowWorkId)); var sampleIdList = identification.Split(new string[] { "|" }, StringSplitOptions.RemoveEmptyEntries).ToList(); if (sampleIdList.Count > 0) { sampleIdList.RemoveAt(0); } DataTable dt = new TMisMonitorSampleInfoLogic().getSamplingAllocationSheet_MAS(strTaskID, strTwoGridId, "1,2"); var newDT = new DataTable(); foreach (DataColumn column in dt.Columns) { newDT.Columns.Add(column.ColumnName); } //样品编号生成 for (int i = 0; i < dt.Rows.Count; i++) { if (sampleIdList.Count > 0 && !sampleIdList.Contains(dt.Rows[i]["ID"].ToString())) { continue; } TMisMonitorSampleInfoVo objSample = new TMisMonitorSampleInfoLogic().Details(dt.Rows[i]["ID"].ToString()); TMisMonitorSubtaskVo objSubtask = new TMisMonitorSubtaskLogic().Details(objSample.SUBTASK_ID); TMisMonitorTaskVo objTask = new TMisMonitorTaskLogic().Details(objSubtask.TASK_ID); if (objSample.SAMPLE_CODE.Length == 0) { //objSample.SAMPLE_CODE = GetSampleCode_QHD(dt.Rows[i]["ID"].ToString()); TBaseSerialruleVo objSerial = new TBaseSerialruleVo(); objSerial.SAMPLE_SOURCE = objTask.SAMPLE_SOURCE; objSerial.SERIAL_TYPE = "2"; objSample.SAMPLECODE_CREATEDATE = DateTime.Now.ToString("yyyy-MM-dd"); if (objTask.TASK_TYPE == "1") { objSample.SAMPLE_CODE = objSample.SAMPLE_NAME; } else { objSample.SAMPLE_CODE = CreateBaseDefineCodeForSample(objSerial, objTask, objSubtask); } new TMisMonitorSampleInfoLogic().Edit(objSample); dt.Rows[i]["SAMPLE_CODE"] = objSample.SAMPLE_CODE; } //样品状态,外委除外(废水、地表水) if (objTask.CONTRACT_TYPE != "04") { DataTable dtAtt = new DataTable(); string strAttValue = string.Empty; string strAttID = "''"; if (objSubtask.MONITOR_ID == "000000001" || objSubtask.MONITOR_ID == "EnvDrinkingSource") { strAttID = "'000000017'"; } if (objSubtask.MONITOR_ID == "EnvRiver") { strAttID = "'000000211'"; } dtAtt = new i3.BusinessLogic.Channels.Base.DynamicAttribute.TBaseAttributeInfoLogic().GetAttValue(strAttID, dt.Rows[i]["POINT_ID"].ToString()); for (int j = 0; j < dtAtt.Rows.Count; j++) { strAttValue += dtAtt.Rows[j]["ATTRBUTE_TEXT"].ToString() + "、"; } dt.Rows[i]["SAMPLE_STATUS"] = strAttValue.TrimEnd('、'); } newDT.Rows.Add(dt.Rows[i].ItemArray); } int intTotalCount = newDT.Rows.Count; string strJson = CreateToJson(newDT, intTotalCount); return(strJson); }
protected void Page_Load(object sender, EventArgs e) { //定义结果 string strResult = ""; if (!IsPostBack) { if (Request.QueryString["type"] == "check") { var UserNo = Request.QueryString["UserNo"];//有两个UserNo???等解决 UserNo = UserNo.Split(',').Count() > 1 ? UserNo.Split(',')[1] : UserNo; UserNo = UserNo.Trim(','); var workID = Convert.ToInt32(Request.QueryString["OID"]);//OID为流程ID var strSubTaskID = CCFlowFacade.GetFlowIdentification(UserNo, workID).Split('|')[0]; //获取现场项目 DataTable dtSampleItem = new TMisMonitorResultLogic().SelectSampleItemWithSubtaskID(strSubTaskID); if (dtSampleItem.Rows.Count > 0) { TMisMonitorSubtaskAppVo objSubtaskAppVo = new TMisMonitorSubtaskAppVo(); objSubtaskAppVo.SUBTASK_ID = strSubTaskID; objSubtaskAppVo = new TMisMonitorSubtaskAppLogic().Details(objSubtaskAppVo); //objSubtaskAppVo.SAMPLING_CHECK = "administrator";//临时测试 if (!string.IsNullOrEmpty(objSubtaskAppVo.SAMPLING_CHECK)) { //TSysUserVo objUserVo = new TSysUserLogic().Details(objSubtaskAppVo.SAMPLING_CHECK); //var childFlowID = System.Configuration.ConfigurationManager.AppSettings["XCSSH"].ToString().Trim(','); //var childNodeID = Convert.ToInt32(System.Configuration.ConfigurationManager.AppSettings["XCSSHJNode"]); //CCFlowFacade.Node_CreateBlankWork(UserNo, childFlowID, UserNo, null, workID, fid, flowId, nodeId, UserNo, childNodeID, objUserVo.USER_NAME.Trim(','), "@GroupMark=" + strSubTaskID); } else { Response.Write("false没有指定现场项目复核人,不能发送"); Response.ContentType = "text/plain"; Response.ContentEncoding = Encoding.UTF8; Response.End(); } //yinchengyi 2015-4-24 打开页面时 记录ccflow流程ID信息到业务系统数据库 //TMisMonitorSubtaskVo objSubtaskVo = new TMisMonitorSubtaskVo(); //objSubtaskVo.ID = strSubTaskID; //objSubtaskVo.CCFLOW_ID1 = workID.ToString(); //objSubtaskVo.CCFLOW_ID2 = fid.ToString(); //if (!new TMisMonitorSubtaskLogic().Edit(objSubtaskVo)) //{ // Response.Write("false流程ID更新失败,不能发送"); // Response.ContentType = "text/plain"; // Response.ContentEncoding = Encoding.UTF8; // Response.End(); //} } //分析类现场项目判断 var strTaskID = ""; var FID = Convert.ToInt64(Request.QueryString["FID"]); TMisContractPlanVo objPlanVo = new TMisContractPlanVo(); objPlanVo.CCFLOW_ID1 = FID.ToString(); objPlanVo = new TMisContractPlanLogic().Details(objPlanVo); if (objPlanVo.ID.Length > 0 && objPlanVo.REAMRK1 == "1") { //当前流程属于送样的 strTaskID = new TMisMonitorTaskLogic().Details(new TMisMonitorTaskVo { PLAN_ID = objPlanVo.ID }).ID; strSubTaskID = ""; } else { strTaskID = ""; strSubTaskID = CCFlowFacade.GetFlowIdentification(UserNo, workID).Split('|')[0]; } DataTable dtInfo = new TMisMonitorResultLogic().getItemInfoBySubTaskID_MAS(strTaskID, strSubTaskID, true); for (int i = 0; i < dtInfo.Rows.Count; i++) { if (dtInfo.Rows[i]["IS_ANYSCENE_ITEM"].ToString() == "1") { if (dtInfo.Rows[i]["USER_NAME"].ToString() == "") { Response.Write("false分析负责人信息没有选择完整,请检查"); Response.ContentType = "text/plain"; Response.End(); } } } Response.Write("true"); Response.ContentEncoding = Encoding.UTF8; Response.ContentType = "text/plain"; Response.End(); } if (Request.QueryString["type"] == "AfterSuccessSend") { Response.ContentEncoding = Encoding.GetEncoding("gb2312"); var UserNo = Request.QueryString["UserNo"];//有两个UserNo???等解决 UserNo = UserNo.Split(',').Count() > 1 ? UserNo.Split(',')[1] : UserNo; var workID = Convert.ToInt32(Request.QueryString["OID"]);//OID为流程ID var flowId = Request.QueryString["FK_Flow"]; var nodeId = Convert.ToInt32(Request.QueryString["FK_Node"]); var fid = Convert.ToInt32(Request.QueryString["FID"]); var strSubTaskID = CCFlowFacade.GetFlowIdentification(UserNo, workID).Split('|')[0]; //获取现场项目 DataTable dtSampleItem = new TMisMonitorResultLogic().SelectSampleItemWithSubtaskID(strSubTaskID); if (dtSampleItem.Rows.Count > 0) { TMisMonitorSubtaskAppVo objSubtaskAppVo = new TMisMonitorSubtaskAppVo(); objSubtaskAppVo.SUBTASK_ID = strSubTaskID; objSubtaskAppVo = new TMisMonitorSubtaskAppLogic().Details(objSubtaskAppVo); if (!string.IsNullOrEmpty(objSubtaskAppVo.SAMPLING_CHECK)) { TSysUserVo objUserVo = new TSysUserLogic().Details(objSubtaskAppVo.SAMPLING_CHECK); var childFlowID = System.Configuration.ConfigurationManager.AppSettings["XCSSH"].ToString(); var childNodeID = Convert.ToInt32(System.Configuration.ConfigurationManager.AppSettings["XCSSHJNode"]); var subTaskVo = new TMisMonitorSubtaskLogic().Details(strSubTaskID); var taskVo = new TMisMonitorTaskLogic().Details(subTaskVo.TASK_ID); var tempID = CCFlowFacade.Node_CreateBlankWork(UserNo, childFlowID, UserNo, null, workID, fid, flowId, nodeId, UserNo, childNodeID, objUserVo.USER_NAME, "@GroupMark=" + strSubTaskID); CCFlowFacade.SetFlowTitle(UserNo, childFlowID, tempID, taskVo.PROJECT_NAME); } } //创建分析类现场项目 var strTaskID = ""; var FID = Convert.ToInt64(Request.QueryString["FID"]); UserNo = UserNo.Split(',').Count() > 1 ? UserNo.Split(',')[1] : UserNo; UserNo = UserNo.Trim(','); TMisContractPlanVo objPlanVo = new TMisContractPlanVo(); objPlanVo.CCFLOW_ID1 = FID.ToString(); objPlanVo = new TMisContractPlanLogic().Details(objPlanVo); if (objPlanVo.ID.Length > 0 && objPlanVo.REAMRK1 == "1") { //当前流程属于送样的 strTaskID = new TMisMonitorTaskLogic().Details(new TMisMonitorTaskVo { PLAN_ID = objPlanVo.ID }).ID; strSubTaskID = ""; } else { strTaskID = ""; strSubTaskID = CCFlowFacade.GetFlowIdentification(UserNo, workID).Split('|')[0]; } var childFlowID3 = System.Configuration.ConfigurationManager.AppSettings["FXLXCXM"].ToString().Trim(','); var childNodeID3 = Convert.ToInt32(System.Configuration.ConfigurationManager.AppSettings["FXLXCXMJNode"]);//配置为跳转到分析室审核流程的第三个节点by lhm DataTable dtInfo = new TMisMonitorResultLogic().getItemInfoBySubTaskID_MAS(strTaskID, strSubTaskID, true); for (int i = 0; i < dtInfo.Rows.Count; i++) { if (dtInfo.Rows[i]["USER_NAME"].ToString() == "") { Response.Write("false分析负责人信息没有选择完整,请检查"); Response.ContentType = "text/plain"; Response.End(); } var itemVo = new TBaseItemInfoLogic().Details(dtInfo.Rows[i]["ITEM_ID"].ToString()); var sampleVo = new TMisMonitorSampleInfoLogic().Details(dtInfo.Rows[i]["SAMPLE_ID"].ToString()); var subtaskVO = new TMisMonitorSubtaskLogic().Details(sampleVo.SUBTASK_ID); var taskVo = new TMisMonitorTaskLogic().Details(subtaskVO.TASK_ID); long workid = 0; var title = string.Format("{0} {1}", taskVo.PROJECT_NAME, itemVo.ITEM_NAME); if (dtInfo.Rows[i]["IS_ANYSCENE_ITEM"].ToString() == "1") //分析类现场项目 { workid = CCFlowFacade.Node_CreateBlankWork(UserNo, childFlowID3, UserNo, null, workID, fid, flowId, nodeId, UserNo, childNodeID3, dtInfo.Rows[i]["USER_NAME"].ToString().Trim(','), "@GroupMark=" + dtInfo.Rows[i]["RESULTID"].ToString().Trim(',')); CCFlowFacade.SetFlowTitle(Request["UserNo"].ToString(), childFlowID3, workid, title); } } Response.Write("发送成功"); Response.ContentType = "text/plain"; Response.End(); } if (!string.IsNullOrEmpty(Request.QueryString["DirectionType"])) { var type = Request.QueryString["DirectionType"]; var direction = Request.QueryString["Direction"]; var UserNo = Request.QueryString["UserNo"]; var workID = Request.QueryString["WorkId"]; var strSubTaskID = CCFlowFacade.GetFlowIdentification(UserNo, Convert.ToInt64(workID)).Split('|')[0]; switch (type) { case "type1": //分析类现场项目在该环节创建时,该逻辑需要更改为是否存在分析类项目 by lhm //DataTable dtSampleDept = new TMisMonitorResultLogic().SelectSampleDeptWithSubtaskID(strSubTaskID);//存在分析类项目和分析类现场项目 DataTable dtSampleDept = new TMisMonitorResultLogic().SelectSampleDeptWithSubtaskID2(strSubTaskID); //存在分析类项目 if (direction == "d1") { if (dtSampleDept.Rows.Count == 0) { Response.Write("1"); } else { Response.Write("0"); } } else if (direction == "d2") { if (dtSampleDept.Rows.Count > 0) { Response.Write("1"); } else { Response.Write("0"); } } Response.End(); break; default: Response.Write("0"); Response.End(); break; } } if (Request.QueryString["WorkID"] != null) { var workID = Convert.ToInt64(Request.QueryString["WorkID"]); ccflowWorkId = workID.ToString(); ccflowFid = Request.QueryString["FID"]; var identification = CCFlowFacade.GetFlowIdentification(LogInfo.UserInfo.USER_NAME, workID).Split('|')[0]; this.SUBTASK_ID.Value = identification; strSubTaskID = identification; strSourceID = identification; TMisMonitorSubtaskVo objSubtaskVo = new TMisMonitorSubtaskLogic().Details(strSubTaskID); strMonitorID = objSubtaskVo.MONITOR_ID; this.MONITOR_ID.Value = strMonitorID; TMisMonitorTaskVo objTask = new TMisMonitorTaskLogic().Details(objSubtaskVo.TASK_ID); this.PLAN_ID.Value = objTask.PLAN_ID; //yinchengyi 2015-4-24 打开页面时 记录ccflow流程ID信息到业务系统数据库 //TMisMonitorSubtaskVo objSubtaskVo = new TMisMonitorSubtaskVo(); //objSubtaskVo.ID = strSubTaskID; objSubtaskVo.CCFLOW_ID1 = workID.ToString(); objSubtaskVo.CCFLOW_ID2 = ccflowFid.ToString(); if (!new TMisMonitorSubtaskLogic().Edit(objSubtaskVo)) { //todo_yinchengyi: } } if (!string.IsNullOrEmpty(Request.QueryString["strSubtaskID"])) { //监测子任务ID this.SUBTASK_ID.Value = Request.QueryString["strSubtaskID"].ToString(); } //点位动态属性信息拷贝 AttributeValueCopy(); //样品编号 //SetSampleCode(); //委托书信息 if (!string.IsNullOrEmpty(Request.QueryString["type"]) && Request.QueryString["type"] == "getContractInfo") { strResult = GetContractInfo(); Response.Write(strResult); Response.End(); } //获取现场复核人信息 if (Request["type"] != null && Request["type"].ToString() == "GetCheckUser") { strResult = GetCheckUser(Request.QueryString["MonitorID"].ToString()); Response.Write(strResult); Response.End(); } } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { if (!string.IsNullOrEmpty(Request.QueryString["DirectionType"])) { var type = Request.QueryString["DirectionType"]; var direction = Request.QueryString["Direction"]; var workID = Request.QueryString["WorkId"]; TMisMonitorTaskVo objTaskVo = new TMisMonitorTaskVo(); objTaskVo.CCFLOW_ID1 = workID; objTaskVo = new TMisMonitorTaskLogic().Details(objTaskVo); switch (type) { case "type1": bool isHasOuterQcSample = new TMisMonitorResultLogic().CheckTaskHasOuterQcSample(objTaskVo.ID, ""); if (direction == "d1") { if (isHasOuterQcSample) { Response.Write("1"); } else { Response.Write("0"); } } else if (direction == "d2") { if (!isHasOuterQcSample) { Response.Write("1"); } else { Response.Write("0"); } } Response.End(); break; default: Response.Write("0"); Response.End(); break; } } if (Request.QueryString["WorkIDs"] != null || Request.QueryString["WorkID"] != null) { string strWorkIDs = Request.QueryString["WorkIDs"]; if (string.IsNullOrEmpty(strWorkIDs)) { strWorkIDs = Request.QueryString["WorkID"]; } string[] strarr = strWorkIDs.Split(','); for (int i = 0; i < strarr.Length; i++) { if (strarr[i] != "" || !string.IsNullOrEmpty(strarr[i])) { var workID = Convert.ToInt64(strarr[i]); var identification = CCFlowFacade.GetFlowIdentification(LogInfo.UserInfo.USER_NAME, workID); this.RESULT_ID.Value = this.RESULT_ID.Value + "," + identification; } } } //定义结果 string strResult = ""; //获取样品信息 if (Request["type"] != null && Request["type"].ToString() == "getSampleGridInfo") { strResult = getSampleGridInfo(Request["strResultID"].ToString()); Response.Write(strResult); Response.End(); } //获取监测项目信息 if (Request["type"] != null && Request["type"].ToString() == "getItemGridInfo") { strResult = getItemGridInfo(Request["SampleGridId"].ToString(), Request["strResultID"].ToString()); Response.Write(strResult); Response.End(); } //获取现场质控信息 if (Request["type"] != null && Request["type"].ToString() == "getQCGrid1Info") { strResult = getQCGrid1Info(Request["ResultId"].ToString(), Request["strItemID"].ToString()); Response.Write(strResult); Response.End(); } //获取实验室质控信息 if (Request["type"] != null && Request["type"].ToString() == "getQCGrid2Info") { strResult = getQCGrid2Info(Request["ResultId"].ToString()); Response.Write(strResult); Response.End(); } } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { // ccflow结点发送前事件 if (Request["type"] != null && Request["type"].ToString() == "check") { var workID = Convert.ToInt64(Request.QueryString["OID"]); var flowId = Request.QueryString["FK_Flow"]; var nodeId = Convert.ToInt32(Request.QueryString["FK_Node"]); var fid = Convert.ToInt32(Request.QueryString["FID"]); var identification = CCFlowFacade.GetFlowIdentification(Request["UserNo"], workID); //// yinchengyi 2015-4-2 记录monistor_result对应的子流程ID和父线程ID //TMisMonitorResultVo objMomRstVo = new TMisMonitorResultVo(); //objMomRstVo.ID = identification; //objMomRstVo.CCFLOW_ID1 = workID.ToString(); //objMomRstVo.CCFLOW_ID2 = fid.ToString(); //if (!new TMisMonitorResultLogic().Edit(objMomRstVo)) //{ // Response.Write("false流程ID更新失败,不能发送"); //} Response.ContentType = "text/plain"; Response.ContentEncoding = Encoding.UTF8; Response.Write("true"); Response.End(); } //黄飞 20150916 监测分析 批处理 if (Request.QueryString["WorkIDs"] != null || Request.QueryString["WorkID"] != null) { string strWorkIDs = Request.QueryString["WorkIDs"]; if (string.IsNullOrEmpty(strWorkIDs)) { strWorkIDs = Request.QueryString["WorkID"]; } string[] strarr = strWorkIDs.Split(','); for (int i = 0; i < strarr.Length; i++) { if (strarr[i] != "" || !string.IsNullOrEmpty(strarr[i])) { var workID = Convert.ToInt64(strarr[i]); var identification = CCFlowFacade.GetFlowIdentification(LogInfo.UserInfo.USER_NAME, workID); this.RESULT_ID.Value = this.RESULT_ID.Value + "," + identification; // yinchengyi 2015-4-2 记录monistor_result对应的子流程ID和父线程ID TMisMonitorResultVo objMomRstVo = new TMisMonitorResultVo(); objMomRstVo.ID = identification; var fatherID = CCFlowFacade.GetFatherThreadIDOfSubFlow(LogInfo.UserInfo.USER_NAME, workID); objMomRstVo.CCFLOW_ID1 = workID.ToString(); objMomRstVo.CCFLOW_ID2 = fatherID.ToString(); if (!new TMisMonitorResultLogic().Edit(objMomRstVo)) { //todo-yinchengyi } } } } //定义结果 string strResult = ""; //任务信息 if (Request["type"] != null && Request["type"].ToString() == "getOneGridInfo") { strResult = getOneGridInfo(Request["strResultID"].ToString()); Response.Write(strResult); Response.End(); } //监测项目信息 if (Request["type"] != null && Request["type"].ToString() == "getTwoGridInfo") { strResult = getTwoGridInfo(Request["oneGridId"].ToString(), Request["strResultID"].ToString()); Response.Write(strResult); Response.End(); } //监测项目实验室质控信息 if (Request["type"] != null && Request["type"].ToString() == "getThreeGridInfo") { strResult = getThreeGridInfo(Request["twoGridId"].ToString()); Response.Write(strResult); Response.End(); } //监测项目信息 if (Request["type"] != null && Request["type"].ToString() == "getAnalysisByItemId") { strResult = getAnalysisByItemId(Request["strItemId"].ToString()); Response.Write(strResult); Response.End(); } //监测项目信息 if (Request["type"] != null && Request["type"].ToString() == "getSampleInfor") { strResult = getSampleInfor(Request["strSampleId"].ToString()); Response.Write(strResult); Response.End(); } //获取样品编号及结果值 if (Request["type"] != null && Request["type"].ToString() == "getItemInfo") { strResult = getItemInfo(Request["resultids"].ToString()); Response.Write(strResult); Response.End(); } } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { if (Request.QueryString["WorkID"] != null) { var workID = Convert.ToInt64(Request.QueryString["WorkID"]); var identification = CCFlowFacade.GetFlowIdentification(LogInfo.UserInfo.USER_NAME, workID); this.RESULT_ID.Value = identification; } //定义结果 string strResult = ""; //任务信息 if (Request["type"] != null && Request["type"].ToString() == "getOneGridInfo") { strResult = getOneGridInfo(Request["strResultID"].ToString()); Response.Write(strResult); Response.End(); } //获取监测类别信息 if (Request["type"] != null && Request["type"].ToString() == "getTwoGridInfo") { strResult = getTwoGridInfo(Request["oneGridId"].ToString(), Request["strResultID"].ToString()); Response.Write(strResult); Response.End(); } //获取样品信息 if (Request["type"] != null && Request["type"].ToString() == "getThreeGridInfo") { strResult = getThreeGridInfo(Request["twoGridId"].ToString(), Request["strResultID"].ToString()); Response.Write(strResult); Response.End(); } //获取监测项目信息 if (Request["type"] != null && Request["type"].ToString() == "getFourGridInfo") { strResult = getFourGridInfo(Request["threeGridId"].ToString(), Request["strResultID"].ToString()); Response.Write(strResult); Response.End(); } //获取实验室质控信息 if (Request["type"] != null && Request["type"].ToString() == "getFiveGridInfo") { strResult = getFiveGridInfo(Request["fourGridId"].ToString()); Response.Write(strResult); Response.End(); } //按动态列更新列值 if (Request["type"] != null && Request["type"].ToString() == "UpdateCellValue") { string strCellName = Request["strUpdateCell"].ToString(); string strCellValue = Request["strUpdateCellValue"].ToString(); string strInforId = Request["strInfor_Id"].ToString(); Response.Write(UpdateCellValue(strCellName, strCellValue, strInforId)); Response.End(); } //按动态列更新列值 if (Request["type"] != null && Request["type"].ToString() == "setResultStatus") { string strInforId = Request["strInfor_Id"].ToString(); Response.Write(setResultStatus(strInforId)); Response.End(); } } }
public string UpdateSubTaskInfo(string workID, string strUser, string JsonSubTask, string JsonPoint, string JsonItem) { string strResult = "false"; var identification = CCFlowFacade.GetFlowIdentification(strUser, long.Parse(workID)); TMisMonitorSubtaskVo objSubtaskVo = new TMisMonitorSubtaskLogic().Details(identification); TMisMonitorTaskVo objTaskVo = new TMisMonitorTaskLogic().Details(objSubtaskVo.TASK_ID); DataTable dtSubTask = JSONToDataTable2(JsonSubTask); DataTable dtPoint = JSONToDataTable2(JsonPoint); DataTable dtItem = JSONToDataTable2(JsonItem); //更新任务的现状信息 if (dtSubTask.Rows.Count > 0) { objSubtaskVo.SAMPLE_ASK_DATE = dtSubTask.Rows[0]["SAMPLE_ASK_DATE"].ToString(); new TMisMonitorSubtaskLogic().Edit(objSubtaskVo); for (int i = 0; i < dtSubTask.Columns.Count; i++) { if (dtSubTask.Columns[i].ColumnName != "TICKET_NUM" && dtSubTask.Columns[i].ColumnName != "SAMPLE_ASK_DATE") { TMisMonitorSampleSkyVo objSampleSky = new TMisMonitorSampleSkyVo(); objSampleSky.SUBTASK_ID = objSubtaskVo.ID; objSampleSky.WEATHER_ITEM = dtSubTask.Columns[i].ColumnName; objSampleSky = new TMisMonitorSampleSkyLogic().Details(objSampleSky); if (objSampleSky.ID.Length > 0) { objSampleSky.WEATHER_INFO = dtSubTask.Rows[0][i].ToString(); new TMisMonitorSampleSkyLogic().Edit(objSampleSky); } else { objSampleSky.ID = GetSerialNumber("TMisMonitorSampleSky"); objSampleSky.SUBTASK_ID = objSubtaskVo.ID; objSampleSky.WEATHER_ITEM = dtSubTask.Columns[i].ColumnName; objSampleSky.WEATHER_INFO = dtSubTask.Rows[0][i].ToString(); new TMisMonitorSampleSkyLogic().Create(objSampleSky); } } } strResult = "true"; } //更新监测点位信息 if (dtPoint.Rows.Count > 0) { for (int i = 0; i < dtPoint.Rows.Count; i++) { TMisMonitorSampleInfoVo objSampleInfoVo = new TMisMonitorSampleInfoVo(); objSampleInfoVo.SUBTASK_ID = objSubtaskVo.ID; objSampleInfoVo.SAMPLE_NAME = dtPoint.Rows[i]["SAMPLE_NAME"].ToString(); objSampleInfoVo = new TMisMonitorSampleInfoLogic().Details(objSampleInfoVo); if (objSampleInfoVo.ID.Length > 0) { objSampleInfoVo.SAMPLE_COUNT = dtPoint.Rows[i]["SAMPLE_COUNT"].ToString(); new TMisMonitorSampleInfoLogic().Edit(objSampleInfoVo); #region 更新点位图 if (dtPoint.Rows[i]["photo"].ToString().Length > 0) { string strImage = dtPoint.Rows[i]["photo"].ToString(); int tag = 0; FileStream out1 = null; byte[] bs = Convert.FromBase64String(strImage); //获取主文件路径 string mastPath = System.Configuration.ConfigurationManager.AppSettings["AttPath"].ToString(); //获取业务Id string strBusinessId = objSampleInfoVo.ID; //获取业务类型 string strBusinessType = "PointPoto"; //获取完整文件名称 string strFullName = strBusinessId + ".png"; //获取文件扩展名称 string strExtendName = strFullName.Substring(strFullName.LastIndexOf(".")); string strSerialNumber = GetSerialNumber("attFileId"); //文件夹路径 string strfolderPath = strBusinessType + "\\" + DateTime.Now.ToString("yyyyMMdd"); //新命名的文件名称 string strNewFileName = DateTime.Now.ToString("yyyyMMddHHmm") + "-" + strSerialNumber + strExtendName; //上传的完整路径 string strResultPath = mastPath + "\\" + strfolderPath + "\\" + strNewFileName; //开始上传附件 try { //判断文件夹是否存在,如果不存在则创建 if (Directory.Exists(mastPath + "\\" + strfolderPath) == false) { Directory.CreateDirectory(mastPath + "\\" + strfolderPath); } //判断原来是否已经上传过文件,如果有的话则获取原来已经上传的文件路径 TOaAttVo TOaAttVo = new TOaAttVo(); TOaAttVo.BUSINESS_TYPE = strBusinessType; TOaAttVo.BUSINESS_ID = strBusinessId; //TOaAttVo.ATTACH_NAME = this.ATTACH_NAME.Text.Trim(); DataTable objTable = new TOaAttLogic().SelectByTable(TOaAttVo); if (objTable.Rows.Count > 0) { //如果存在记录 //获取该记录的ID string strId = objTable.Rows[0]["ID"].ToString(); //获取原来文件的路径 string strOldFilePath = objTable.Rows[0]["UPLOAD_PATH"].ToString(); //如果存在的话,删除原来的文件 if (File.Exists(mastPath + "\\" + strOldFilePath)) { File.Delete(mastPath + "\\" + strOldFilePath); } //将新的信息写入数据库 TOaAttVo TOaAttVoTemp = new TOaAttVo(); TOaAttVoTemp.ID = strId; TOaAttVoTemp.ATTACH_NAME = "点位图"; TOaAttVoTemp.ATTACH_TYPE = strExtendName; TOaAttVoTemp.UPLOAD_PATH = strfolderPath + "\\" + strNewFileName; TOaAttVoTemp.UPLOAD_DATE = DateTime.Now.ToString("yyyy-MM-dd"); TOaAttVoTemp.UPLOAD_PERSON = strUser; TOaAttVoTemp.DESCRIPTION = "点位图"; TOaAttVoTemp.REMARKS = bs.Length + "KB";//文件的大小 new TOaAttLogic().Edit(TOaAttVoTemp); } else { //如果不存在记录 TOaAttVo TOaAttVoTemp = new TOaAttVo(); TOaAttVoTemp.ID = strSerialNumber; TOaAttVoTemp.BUSINESS_ID = strBusinessId; TOaAttVoTemp.BUSINESS_TYPE = strBusinessType; TOaAttVoTemp.ATTACH_NAME = "点位图"; TOaAttVoTemp.ATTACH_TYPE = strExtendName; TOaAttVoTemp.UPLOAD_PATH = strfolderPath + "\\" + strNewFileName; TOaAttVoTemp.UPLOAD_DATE = DateTime.Now.ToString("yyyy-MM-dd"); TOaAttVoTemp.UPLOAD_PERSON = strUser; TOaAttVoTemp.DESCRIPTION = "点位图"; TOaAttVoTemp.REMARKS = bs.Length + "KB";//文件的大小 new TOaAttLogic().Create(TOaAttVoTemp); } if (tag == 0) { out1 = new FileStream(strResultPath, FileMode.CreateNew, FileAccess.Write); } else { out1 = new FileStream(strResultPath, FileMode.Append, FileAccess.Write); } out1.Write(bs, 0, bs.Length); if (out1 != null) { try { out1.Close(); } catch (IOException e) { // TODO Auto-generated catch block } } } catch (Exception ex) { } } #endregion for (int j = 0; j < dtPoint.Columns.Count; j++) { if (dtPoint.Columns[j].ColumnName != "SAMPLE_NAME" && dtPoint.Columns[j].ColumnName != "SAMPLE_COUNT" && dtPoint.Columns[j].ColumnName != "photo") { TBaseAttributeInfoVo objAttributeInfoVo = new TBaseAttributeInfoVo(); objAttributeInfoVo.IS_DEL = "0"; objAttributeInfoVo.ATTRIBUTE_NAME = dtPoint.Columns[j].ColumnName; objAttributeInfoVo = new TBaseAttributeInfoLogic().Details(objAttributeInfoVo); if (objAttributeInfoVo.ID.Length > 0) { string Attribute_Code = objAttributeInfoVo.ID; TBaseAttrbuteValue3Vo objAttValue = new TBaseAttrbuteValue3Vo(); objAttValue.OBJECT_ID = objSampleInfoVo.POINT_ID; objAttValue.ATTRBUTE_CODE = Attribute_Code; objAttValue.IS_DEL = "0"; objAttValue = new TBaseAttrbuteValue3Logic().Details(objAttValue); if (objAttValue.ID == "") { objAttValue.ID = GetSerialNumber("t_base_attribute_value3_id"); objAttValue.IS_DEL = "0"; objAttValue.OBJECT_ID = objSampleInfoVo.POINT_ID; objAttValue.OBJECT_TYPE = objAttributeInfoVo.CONTROL_NAME; objAttValue.ATTRBUTE_CODE = Attribute_Code; objAttValue.ATTRBUTE_VALUE = dtPoint.Rows[i][dtPoint.Columns[j].ColumnName.ToString()].ToString(); new TBaseAttrbuteValue3Logic().Create(objAttValue); } else { objAttValue.ATTRBUTE_VALUE = dtPoint.Rows[i][dtPoint.Columns[j].ColumnName.ToString()].ToString(); new TBaseAttrbuteValue3Logic().Edit(objAttValue); } } } } } } strResult = "true"; } //更新监测项目的信息 if (dtItem.Rows.Count > 0) { for (int i = 0; i < dtItem.Rows.Count; i++) { TMisMonitorSampleInfoVo objSampleInfoVo = new TMisMonitorSampleInfoVo(); objSampleInfoVo.SUBTASK_ID = objSubtaskVo.ID; objSampleInfoVo.SAMPLE_NAME = dtItem.Rows[i]["SAMPLE_NAME"].ToString(); objSampleInfoVo = new TMisMonitorSampleInfoLogic().Details(objSampleInfoVo); if (objSampleInfoVo.ID.Length > 0) { TBaseItemInfoVo objItemInfoVo = new TBaseItemInfoVo(); objItemInfoVo.ITEM_NAME = dtItem.Rows[i]["ITEM_NAME"].ToString(); objItemInfoVo.IS_DEL = "0"; objItemInfoVo = new TBaseItemInfoLogic().Details(objItemInfoVo); TMisMonitorResultVo objResultVo = new TMisMonitorResultVo(); objResultVo.SAMPLE_ID = objSampleInfoVo.ID; objResultVo.ITEM_ID = objItemInfoVo.ID; TMisMonitorResultVo objResultSetVo = new TMisMonitorResultVo(); objResultSetVo.ITEM_RESULT = dtItem.Rows[i]["ITEM_RESULT"].ToString(); new TMisMonitorResultLogic().Edit(objResultSetVo, objResultVo); } } strResult = "true"; } return(strResult); }
public string getSubTaskInfo(string workID, string strUser) { string strJson = ""; var identification = CCFlowFacade.GetFlowIdentification(strUser, long.Parse(workID)); TMisMonitorSubtaskVo objSubtaskVo = new TMisMonitorSubtaskLogic().Details(identification); TMisMonitorTaskVo objTaskVo = new TMisMonitorTaskLogic().Details(objSubtaskVo.TASK_ID); strJson += "'任务编号':'" + objTaskVo.TICKET_NUM + "','监测类别':'" + new TBaseMonitorTypeInfoLogic().Details(objSubtaskVo.MONITOR_ID).MONITOR_TYPE_NAME + "'"; TMisMonitorSampleInfoVo objSampleVo = new TMisMonitorSampleInfoVo(); objSampleVo.SUBTASK_ID = objSubtaskVo.ID; List <TMisMonitorSampleInfoVo> listSample = new List <TMisMonitorSampleInfoVo>(); listSample = new TMisMonitorSampleInfoLogic().SelectByObject(objSampleVo, 0, 0); strJson += ",'监测点位':["; for (int i = 0; i < listSample.Count; i++) { if (i == 0) { strJson += "{"; } else { strJson += ",{"; } strJson += "'点位名称':'" + listSample[i].SAMPLE_NAME + "','样品编号':'" + listSample[i].SAMPLE_CODE + "','条码':'" + listSample[i].SAMPLE_BARCODE + "'"; strJson += ",'监测项目':["; TMisMonitorResultVo objResultVo = new TMisMonitorResultVo(); objResultVo.SAMPLE_ID = listSample[i].ID; List <TMisMonitorResultVo> listResult = new TMisMonitorResultLogic().SelectByObject(objResultVo, 0, 0); for (int j = 0; j < listResult.Count; j++) { if (j == 0) { strJson += "{"; } else { strJson += ",{"; } strJson += "'项目名称':'" + new TBaseItemInfoLogic().Details(listResult[j].ITEM_ID).ITEM_NAME + "','现场项目':'" + new TBaseItemInfoLogic().Details(listResult[j].ITEM_ID).IS_SAMPLEDEPT + "'"; strJson += "}"; } strJson += "]}"; } strJson += "]"; strJson = "[{" + strJson + "}]"; return(strJson); }