From 698b7e98e7a4ec7d9031970fa77ffc529039bc0d Mon Sep 17 00:00:00 2001 From: 15689705887 <396341246@qq.com> Date: Tue, 8 Oct 2024 17:14:09 +0800 Subject: [PATCH] 1 --- .../ashx/AppHandler.ashx.cs | 87 +++++++++++++++++++ .../ashx/OaPerformanceRecordHandler.ashx.cs | 12 +++ 2 files changed, 99 insertions(+) diff --git a/Code/智慧营区/DOCManageAPP(阿克苏)/ashx/AppHandler.ashx.cs b/Code/智慧营区/DOCManageAPP(阿克苏)/ashx/AppHandler.ashx.cs index fd2ba70..e5f7558 100644 --- a/Code/智慧营区/DOCManageAPP(阿克苏)/ashx/AppHandler.ashx.cs +++ b/Code/智慧营区/DOCManageAPP(阿克苏)/ashx/AppHandler.ashx.cs @@ -107,6 +107,12 @@ namespace FangYar.WebUI.ashx case "AppUpdateAlarmEmpStateByOrgId": returnstr = AppUpdateAlarmEmpStateByOrgId(context); break; + case "AppGetAlarmCarListByOrgIdApprovalState": + returnstr = AppGetAlarmCarListByOrgIdApprovalState(context); + break; + case "AppUpdateAlarmCarStateByOrgId": + returnstr = AppUpdateAlarmCarStateByOrgId(context); + break; case "AppGetAlarmCarListByOrgId": returnstr = AppGetAlarmCarListByOrgId(context); break; @@ -2503,6 +2509,87 @@ namespace FangYar.WebUI.ashx BLL.SysOperationLogHelp.AddSysOperationLog(context, Common.EnumOperationLogType.Query, "APP操作请求", "车辆报警列表查询"); return returnstr; } + + + //车辆报警列表查询(待审批) + private string AppGetAlarmCarListByOrgIdApprovalState(HttpContext context) + { + string returnstr = ""; + try + { + FangYar.BLL.TBL_ALARMDATA alarmBll = new FangYar.BLL.TBL_ALARMDATA(); + + string OrgId = context.Request.Params["orgId"]; + string keywords = context.Request.Params["keywords"]; + string page = context.Request.Params["page"]; + string limit = context.Request.Params["limit"]; + int pageIndex = 1; + int pageSize = 10; + if (!string.IsNullOrEmpty(page)) { pageIndex = int.Parse(page); } + if (!string.IsNullOrEmpty(limit)) { pageSize = int.Parse(limit); } + string where = " ALARM_TYPE='2' and state = '0' "; + if (!string.IsNullOrEmpty(OrgId)) + { + where += " and (ORG_ID ='" + OrgId + "' or ORG_ID in (select o.org_id from fire_org o where o.pid = '" + OrgId + "') )"; + } + if (!string.IsNullOrEmpty(keywords)) + { + where += " and CAR_NUM like '%" + keywords + "%'"; + } + returnstr = "{\"code\":0,\"msg\":\"\","; + int count = alarmBll.GetRecordCount(where); + returnstr += "\"count\":" + count + ",\"data\":"; + if (count == 0) + { + returnstr += "[]"; + } + else + { + DataTable dt = alarmBll.GetListByPage(where, " TIME desc ", (pageIndex - 1) * pageSize, pageSize).Tables[0]; + returnstr += FangYar.Common.JsonHelper.ToJson(dt); + } + returnstr += "}"; + } + catch (Exception e) + { + returnstr = "{\"code\":-1,\"msg\":\"error\",\"count\":0,\"data\":[]}"; + // 记录操作日志 + BLL.SysOperationLogHelp.AddSysOperationLog(context, Common.EnumOperationLogType.Error, "APP操作请求", "车辆报警列表查询异常:" + e); + } + // 记录操作日志 + BLL.SysOperationLogHelp.AddSysOperationLog(context, Common.EnumOperationLogType.Query, "APP操作请求", "车辆报警列表查询"); + return returnstr; + } + + //审批车辆报警 + private string AppUpdateAlarmCarStateByOrgId(HttpContext context) + {string returnstr = "", msg = "审批失败!"; + int code = 0; + try + { + string id = context.Request.Params["id"]; + string OPINION = context.Request.Params["OPINION"]; + + string sql = " update tbl_alarmdata set state='1',OPINION='"+ OPINION + "' where id='" + id + "' "; + var n1 = FangYar.Common.MySqlHelper.Execute(sql); + if (n1 > 0) + { + msg = "审批成功!"; + code = 1; + } + else + { + msg = "审批失败!"; + } + } + catch(Exception e) + { + + } + returnstr = "{\"code\":" + code + ",\"msg\":\"" + msg + "\"}"; + return returnstr; + + } #endregion #region 访客登记列表 diff --git a/Code/智慧营区/DOCManageAPP(阿克苏)/ashx/OaPerformanceRecordHandler.ashx.cs b/Code/智慧营区/DOCManageAPP(阿克苏)/ashx/OaPerformanceRecordHandler.ashx.cs index fee22a8..89dae22 100644 --- a/Code/智慧营区/DOCManageAPP(阿克苏)/ashx/OaPerformanceRecordHandler.ashx.cs +++ b/Code/智慧营区/DOCManageAPP(阿克苏)/ashx/OaPerformanceRecordHandler.ashx.cs @@ -121,6 +121,7 @@ namespace FangYar.WebUI.ashx string startDate = context.Request.Params["startDate"]; string endDate = context.Request.Params["endDate"]; string is_content = context.Request.Params["is_content"]; + string state = context.Request.Params["state"]; string page = context.Request.Params["page"]; string limit = context.Request.Params["limit"]; int pageIndex = 1; @@ -153,6 +154,15 @@ namespace FangYar.WebUI.ashx { where += " and date_format(TIME, '%Y-%m-%d') < date_format('" + endDate + "-01', '%Y-%m-%d') "; } + if (!string.IsNullOrEmpty(state)) + { + if (!string.IsNullOrEmpty(where)) + { + where += "and"; + } + where += " state = '" + state + "' "; + } + returnstr = "{\"code\":0,\"msg\":\"\","; int count = bll.GetRecordCount(where); returnstr += "\"count\":" + count + ",\"data\":"; @@ -198,6 +208,7 @@ namespace FangYar.WebUI.ashx string DEPT_ID = context.Request.Params["DEPT_ID"]; string DEPT_NAME = context.Request.Params["DEPT_NAME"]; string TYPE = context.Request.Params["TYPE"]; + string TITLE = context.Request.Params["TITLE"]; FangYar.Model.OA.OA_PERFORMANCE_RECORD model = new Model.OA.OA_PERFORMANCE_RECORD(); model.ID = ID; @@ -228,6 +239,7 @@ namespace FangYar.WebUI.ashx model.DEPT_NAME = DEPT_NAME; } model.TYPE = TYPE; + model.TITLE = TITLE; if (bll.Add(model)) { FangYar.BLL.OA.OA_PERFORMANCE_PUBLISH pbll = new FangYar.BLL.OA.OA_PERFORMANCE_PUBLISH();