public object GetProblemInfo(string json) { string res = string.Empty; //json.Value<string>("json"); dynamic dy = JsonConvert.DeserializeObject <ExpandoObject>(json); if (null == curUser) { curUser = GetOperator(dy.userid); if (curUser == null) { return(new { code = -1, count = 0, info = "当前用户不存在,请核对用户信息!" }); } } string hiddenid = dy.data.hiddenid; //隐患主键 //var baseInfo = htbaseinfobll.GetHiddenByKeyValue(hiddenid); string sql = string.Format(@"select hidname,hiddescribe,changemeasure,changedeadine,changepersonname from v_basehiddeninfo where id='{0}'", hiddenid); DataTable dt = new OperticketmanagerBLL().GetDataTable(sql); //HiddenEntity entity = new HiddenEntity(); //if (dt.Rows.Count > 0) //{ // entity.hidname = dt.Rows[0][0].ToString(); // entity.hiddescribe = dt.Rows[0][1].ToString(); // entity.changemeasure = dt.Rows[0][2].ToString(); // entity.Changedeadine = dt.Rows[0][3].ToString(); // entity.changepersonname = dt.Rows[0][4].ToString(); //} return(new { code = 0, count = 0, info = "获取成功", data = dt.ToJson() }); }
public ActionResult Refuse(string keyvalue, int type) { if (type == 0) {//拜访车辆(有车) VisitcarEntity car = visitcarbll.GetEntity(keyvalue); car.State = 99; visitcarbll.SaveForm(keyvalue, car); } else if (type == 3) {//拜访人员 CarUserEntity car = CarUserbll.GetEntity(keyvalue); car.State = 99; CarUserbll.SaveForm(keyvalue, car, null); } else if (type == 1) {//物料车 OperticketmanagerBLL obll = new OperticketmanagerBLL(); OperticketmanagerEntity op = obll.GetEntity(keyvalue); op.ExamineStatus = 99; obll.SaveForm(keyvalue, op); } else {//2危化品车 HazardouscarBLL hbll = new HazardouscarBLL(); HazardouscarEntity ha = hbll.GetEntity(keyvalue); ha.State = 99; hbll.Update(keyvalue, ha); } return(Success("操作成功。")); }
public ActionResult GetUserListJson(string queryJson) { string sql = string.Format("select id,username,baseid from BIS_USERCARFILEIMG d where d.baseid='{0}' order by d.ordernum asc", queryJson); var dt = new OperticketmanagerBLL().GetDataTable(sql); return(ToJsonResult(dt)); }
public ActionResult GetEntity(string keyValue, int type) { if (type == 0) { var data = visitcarbll.GetEntity(keyValue); return(ToJsonResult(data)); } else if (type == 1) { OperticketmanagerBLL operbll = new OperticketmanagerBLL(); var data = operbll.GetEntity(keyValue); return(ToJsonResult(data)); } else if (type == 3) {//拜访人员 CarUserBLL CarUserbll = new CarUserBLL(); var data = CarUserbll.GetEntity(keyValue); return(ToJsonResult(data)); } else { HazardouscarBLL haza = new HazardouscarBLL(); var data = haza.GetEntity(keyValue); return(ToJsonResult(data)); } }
/// <summary> /// 完善司机信息 /// </summary> /// <param name="keyValue"></param> /// <param name="entity1"></param> /// <returns></returns> public ActionResult SaveDriverInfo(string keyValue, OperticketmanagerEntity entity1) { try { OperticketmanagerEntity entity = new OperticketmanagerBLL().GetEntity(keyValue); if (entity != null) { entity.DriverName = entity1.DriverName; entity.DriverTel = entity1.DriverTel; entity.ExamineStatus = 1; entity.JsImgpath = entity1.JsImgpath; entity.ISwharf = entity1.ISwharf; entity.XsImgpath = entity1.XsImgpath; entity.IdentitetiImg = entity1.IdentitetiImg; entity.HzWeight = entity1.HzWeight; //new OperticketmanagerBLL().SaveForm(keyValue, entity); } return(Success("操作成功。")); } catch (Exception) { return(Success("操作失败!")); } }
public ActionResult QueryLllegalNumberLineKm(string queryJson) { List <object> dic = new List <object>(); Operator user = ERCHTMS.Code.OperatorProvider.Provider.Current(); queryJson = "{'deptCode':'" + user.DeptCode + "','year':'" + DateTime.Now.Year + "','levelGroups':'一般违章,较严重违章,严重违章','DepartmentName':''}"; var dt = legbll.GetLllegalTrendData(queryJson); var list = GetLllegalTrendTotal(dt, queryJson); List <int> Clist = new List <int>(); if (list.Count > 3) { //发现违章数量集 LllegalNumberEntity entity = JsonConvert.DeserializeObject <LllegalNumberEntity>(list[3].ToJson()); //发现违章数 dic.Add(new { name = "发现违章数", type = "spline", yAxis = 1, data = entity.data }); Clist = entity.data; } var queryParam = queryJson.ToJObject(); string deptCode = queryParam["deptCode"].ToString(); //部门 string year = queryParam["year"].ToString(); //年度 string sql = string.Format(@"select u.month, (select count(1) from v_lllegalbaseinfo where 1 = 1 and lllegalteamcode like '{0}%' and lllegalteamcode in (select encode from base_department where encode like '{0}%') and to_char(lllegaltime, 'yyyy') = {1} and extract(month from lllegaltime) = u.month and flowstate ! = '流程结束') as 未闭环违章 from (select rownum as month from dual connect by rownum <= 12) u", deptCode, year); List <decimal> list1 = new List <decimal>(); List <decimal> list2 = new List <decimal>(); DataTable opdt = new OperticketmanagerBLL().GetDataTable(sql); for (int i = 0; i < opdt.Rows.Count; i++) { decimal str1 = Convert.ToDecimal(opdt.Rows[i][1].ToString()); //未闭环违章数 decimal str2 = Clist[i]; //违章总数 list1.Add(str1); if (str2 == 0) { list2.Add(0); } else { list2.Add(Math.Round((str2 - str1) / str2 * 100, 2)); } //违章整改率 } dic.Add(new { name = "未闭环违章数", type = "spline", yAxis = 1, data = list1 }); dic.Add(new { name = "违章整改率%", type = "spline", yAxis = 0, data = list2 }); return(Content(dic.ToJson())); }
public ActionResult CarOut(string keyValue, string Note, int type, List <PersongpsEntity> pergps) { //根据危化品类型添加二级节点 var data = dataItemDetailBLL.GetDataItemListByItemCode("'SocketUrl'"); string IP = ""; int Port = 0; foreach (var item in data) { if (item.ItemName == "IP") { IP = item.ItemValue; } else if (item.ItemName == "Port") { Port = Convert.ToInt32(item.ItemValue); } } visitcarbll.CarOut(keyValue, Note, type, pergps); CarAlgorithmEntity Car = new CarAlgorithmEntity(); Car.ID = keyValue; Car.State = 1; SocketHelper.SendMsg(Car.ToJson(), IP, Port); DataItemDetailBLL pdata = new DataItemDetailBLL(); string key = string.Empty; // "21049470"; string sign = string.Empty; // "4gZkNoh3W92X6C66Rb6X"; var pitem = pdata.GetItemValue("Hikappkey"); //海康服务器密钥 var url = pdata.GetItemValue("HikBaseUrl"); //海康服务器地址 if (!string.IsNullOrEmpty(pitem)) { key = pitem.Split('|')[0]; sign = pitem.Split('|')[1]; } if (type == 0) { VisitcarEntity car = visitcarbll.GetEntity(keyValue); HikOut(url, key, sign, car.CarNo); } else if (type == 1) { OperticketmanagerBLL obll = new OperticketmanagerBLL(); OperticketmanagerEntity op = obll.GetEntity(keyValue); HikOut(url, key, sign, op.Platenumber); } else if (type == 2) { HazardouscarBLL hbll = new HazardouscarBLL(); HazardouscarEntity ha = hbll.GetEntity(keyValue); HikOut(url, key, sign, ha.CarNo); } return(Success("操作成功。")); }
/// <summary> /// 三维车辆定位 /// </summary> /// <returns></returns> public ActionResult CarLocation() { string sql = string.Format("select t.itemname,t.itemvalue,t.itemcode from base_dataitem d join BASE_DATAITEMDETAIL t on d.itemid=t.itemid where d.itemcode='KmConfigure' order by t.sortcode asc"); DataTable dt = new OperticketmanagerBLL().GetDataTable(sql); if (dt.Rows.Count > 1) { //可门配置信息 ViewBag.SDmanager = dt.Rows[3][1].ToString(); //三维图数据包路径 dt.Dispose(); } return(View()); }
public ActionResult VisitRoute() { string sql = string.Format("select t.itemname,t.itemvalue,t.itemcode from base_dataitem d join BASE_DATAITEMDETAIL t on d.itemid=t.itemid where d.itemcode='KmConfigure' order by t.sortcode asc"); DataTable dt = new OperticketmanagerBLL().GetDataTable(sql); for (int i = 0; i < dt.Rows.Count; i++) { if (dt.Rows[i][0].ToString() == "RouteConfig") { ViewBag.Url = dt.Rows[i][1].ToString(); } } dt.Dispose(); return(View()); }
public object GetEarlyWarning([FromBody] JObject json) { string res = json.Value <string>("json"); dynamic dy = JsonConvert.DeserializeObject <ExpandoObject>(res); var type = dy.type; if (null == curUser) { curUser = GetOperator(dy.userid); if (curUser == null) { return(new { code = -1, count = 0, info = "当前用户不存在,请核对用户信息!" }); } } string sql = string.Format("select d.changedeadine,d.hidpointname,changemeasure,d.workstream from v_basehiddeninfo d where 1=1 "); //组织机构 if (curUser != null && !string.IsNullOrEmpty(curUser.OrganizeCode)) { //省级单位 if (curUser.RoleName.Contains("省级用户")) { sql += string.Format(@" and deptcode like '{0}%' ", curUser.NewDeptCode); } else { sql += string.Format(@" and hiddepart = '{0}' ", curUser.OrganizeId); } } //时间筛选 if (!string.IsNullOrEmpty(type) && type == "1") {//当天预警信息 sql += string.Format(" and Changedeadine > to_date('{0}', 'yyyy-MM-dd HH24:mi:ss') and Changedeadine < to_date('{1}', 'yyyy-MM-dd HH24:mi:ss') ", DateTime.Now.ToString("yyyy-MM-dd"), DateTime.Now.AddDays(1)); } //流程状态 if (!string.IsNullOrEmpty(res)) { sql += string.Format(@" and workstream != '整改结束'"); } DataTable dt = new OperticketmanagerBLL().GetDataTable(sql); return(new { code = 0, info = "获取数据成功", count = 1, data = dt.ToJson() }); }
/// <summary> /// 获取按照风险等级统计数据 /// </summary> /// <param name="user"></param> /// <returns></returns> public GrandEntity GetGradeCount(Operator user, string areaCode) { string sql = string.Format(@"select rownum, (select count(1) from bis_riskassess d where d.grade='重大风险' and status=1 and deletemark=0 and enabledmark=0 and (risktype='设备' or risktype='管理' or risktype='区域') and deptcode like '{0}%' and areacode like '{1}%'), (select count(1) from bis_riskassess d where d.grade='较大风险'and status=1 and deletemark=0 and enabledmark=0 and (risktype='设备' or risktype='管理' or risktype='区域') and deptcode like '{0}%' and areacode like '{1}%'), (select count(1) from bis_riskassess d where d.grade='一般风险'and status=1 and deletemark=0 and enabledmark=0 and (risktype='设备' or risktype='管理' or risktype='区域') and deptcode like '{0}%' and areacode like '{1}%') , (select count(1) from bis_riskassess d where d.grade='低风险' and status=1 and deletemark=0 and enabledmark=0 and (risktype='设备' or risktype='管理' or risktype='区域') and deptcode like '{0}%' and areacode like '{1}%') from bis_riskassess t where rownum=1 ", user.OrganizeCode, areaCode); DataTable dt = new OperticketmanagerBLL().GetDataTable(sql); GrandEntity entity = new GrandEntity(); if (dt.Rows.Count > 0) { entity.Grade1 = dt.Rows[0][1].ToString(); entity.Grade2 = dt.Rows[0][2].ToString(); entity.Grade3 = dt.Rows[0][3].ToString(); entity.Grade4 = dt.Rows[0][4].ToString(); } dt.Dispose(); return(entity); }
/// <summary> /// 未考勤人员统计 /// </summary> /// <returns></returns> public ActionResult GetComNameUserCount(string queryJson) { string where = ""; string qc = string.Empty; var queryParam = queryJson.ToJObject(); string startTime = queryParam["startTime"].ToString(); string ComType = queryParam["ComType"].ToString(); startTime = Convert.ToDateTime(startTime).ToString("yyyy-MM-dd") + " 00:00:00"; if (!string.IsNullOrEmpty(startTime)) { string endTime = queryParam["startTime"].ToString(); qc = string.Format(" and TO_CHAR(CREATEDATE,'yyyy-MM-dd HH24:mm:ss') >= '{0}' and TO_CHAR(CREATEDATE,'yyyy-MM-dd HH24:mm:ss') <= '{1}' ", startTime, endTime); where = string.Format(@" and d.userid not in (select userid from bis_hikinoutlog s where 1=1 {0} ) ", qc); } if (!string.IsNullOrEmpty(ComType)) { ComType = queryParam["ComType"].ToString() == "长协单位" ? "长协" : "临时"; where += string.Format(" and t.depttype='{0}' ", ComType); } string sql = string.Format(" select count(1) from base_user d join base_department t on d.departmentid = t.departmentid and d.IsEpiboly='1' {0} ", where); var dt = new OperticketmanagerBLL().GetDataTable(sql); return(Content(dt.Rows[0][0].ToString())); }
// 有关 Bundling 的详细信息,请访问 http://go.microsoft.com/fwlink/?LinkId=254725 public static void RegisterBundles(BundleCollection bundles) { //jqgrid表格组件 bundles.Add(new StyleBundle("~/Content/scripts/plugins/jqgrid/css").Include( "~/Content/scripts/plugins/jqgrid/jqgrid.css")); bundles.Add(new ScriptBundle("~/Content/scripts/plugins/jqgrid/js").Include( "~/Content/scripts/plugins/jqgrid/grid.locale-cn.js", "~/Content/scripts/plugins/jqgrid/jqgrid.js")); //树形组件 bundles.Add(new StyleBundle("~/Content/scripts/plugins/tree/css").Include( "~/Content/scripts/plugins/tree/tree.css")); bundles.Add(new ScriptBundle("~/Content/scripts/plugins/tree/js").Include( "~/Content/scripts/plugins/tree/tree.js")); //表单验证 bundles.Add(new ScriptBundle("~/Content/scripts/plugins/validator/js").Include( "~/Content/scripts/plugins/validator/validator.js")); //日期控件 bundles.Add(new StyleBundle("~/Content/scripts/plugins/datetime/css").Include( "~/Content/scripts/plugins/datetime/pikaday.css")); bundles.Add(new ScriptBundle("~/Content/scripts/plugins/datepicker/js").Include( "~/Content/scripts/plugins/datetime/pikaday.js")); //导向组件 bundles.Add(new StyleBundle("~/Content/scripts/plugins/wizard/css").Include( "~/Content/scripts/plugins/wizard/wizard.css")); bundles.Add(new ScriptBundle("~/Content/scripts/plugins/wizard/js").Include( "~/Content/scripts/plugins/wizard/wizard.js")); bundles.Add(new StyleBundle("~/Content/styles/framework-ui.css").Include( "~/Content/styles/framework-ui.css")); bundles.Add(new ScriptBundle("~/Content/scripts/utils/js").Include( "~/Content/scripts/utils/framework-ui.js", "~/Content/scripts/utils/framework-form.js")); bundles.Add(new ScriptBundle("~/Content/scripts/plugins/printTable/js").Include( "~/Content/scripts/plugins/printTable/jquery.printTable.js")); //工作流 bundles.Add(new StyleBundle("~/Content/styles/framework-flowall.css").Include( "~/Content/styles/framework-ckbox-radio.css", "~/Content/styles/framework-applayout.css", "~/Content/styles/framework-flow.css")); bundles.Add(new ScriptBundle("~/Content/scripts/flow/js").Include( "~/Content/scripts/utils/framework-applayout.js", "~/Content/scripts/plugins/flow-ui/flow.js", "~/Content/scripts/utils/framework-flowlayout.js")); //风险统计 bundles.Add(new ScriptBundle("~/Content/scripts/business/stat").Include( "~/Content/scripts/business/Common.js", "~/Content/scripts/business/RiskStat.js")); //车辆管理 bundles.Add(new ScriptBundle("~/Content/scripts/business/CarInLog").Include( "~/Content/scripts/business/Common.js", "~/Content/scripts/business/CarInLog.js")); //根据数据字典路线配置三维 string sql = string.Format("select t.itemname,t.itemvalue,t.itemcode from base_dataitem d join BASE_DATAITEMDETAIL t on d.itemid=t.itemid where d.itemcode='KmConfigure' order by t.sortcode asc"); DataTable dt = new OperticketmanagerBLL().GetDataTable(sql); for (int i = 0; i < dt.Rows.Count; i++) { if (dt.Rows[i][0].ToString() == "RouteConfig") { bundles.Add(new ScriptBundle("~/Content/scripts/3D/RouteConfig").Include( "~/Content/scripts/3D/" + dt.Rows[i][1] + "/TemplateData/UnityProgress.js", "~/Content/scripts/3D/" + dt.Rows[i][1] + "/Build/UnityLoader.js")); } } dt.Dispose(); //登录 bundles.Add(new ScriptBundle("~/Content/scripts/business/login").Include( "~/Content/scripts/utils/framework-ui.js", "~/Content/scripts/plugins/crypto/crypto.min.js", "~/Content/scripts/business/login.js", "~/Content/scripts/business/qrlogin.js" )); //即时通讯 bundles.Add(new ScriptBundle("~/Content/scripts/business/webim").Include( //"~/Content/scripts/layim/layui.js", "~/Content/scripts/layim/webchat.js")); }
public ActionResult ChangeState(string keyvalue, int type, int state) { //根据危化品类型添加二级节点 #region 获取编码管理配置信息 var data = dataItemDetailBLL.GetDataItemListByItemCode("'SocketUrl'"); string IP = ""; int Port = 0; foreach (var item in data) { if (item.ItemName == "IP") { IP = item.ItemValue; } else if (item.ItemName == "Port") { Port = Convert.ToInt32(item.ItemValue); } } DataItemDetailBLL pdata = new DataItemDetailBLL(); string key = string.Empty; // "21049470"; string sign = string.Empty; // "4gZkNoh3W92X6C66Rb6X"; var pitem = pdata.GetItemValue("Hikappkey"); //海康服务器密钥 var baseurl = pdata.GetItemValue("HikBaseUrl"); //海康服务器地址 if (!string.IsNullOrEmpty(pitem)) { key = pitem.Split('|')[0]; sign = pitem.Split('|')[1]; } #endregion state++; if (type == 0) {//拜访车辆 VisitcarEntity car = visitcarbll.GetEntity(keyvalue); car.State = state; car.InTime = DateTime.Now; visitcarbll.SaveForm(keyvalue, car); CarAlgorithmEntity Car = new CarAlgorithmEntity(); Car.CarNo = car.CarNo; Car.GPSID = car.GPSID; Car.GPSName = car.GPSNAME; Car.ID = car.ID; Car.Type = 3; Car.State = 0; Car.LineName = car.LineName; Car.GoodsName = ""; SocketHelper.SendMsg(Car.ToJson(), IP, Port); //车辆放行 (疫情期间此功能暂时屏蔽) //AddCarpermission(baseurl, key, sign, car.CarNo, car.Phone, car.Dirver); var baselist = CarUserbll.addUserJurisdiction(keyvalue, state, baseurl, key, sign); return(Content(baselist.ToJson())); } else if (type == 3) {//拜访人员 CarUserEntity car = CarUserbll.GetEntity(keyvalue); car.State = type; car.InTime = DateTime.Now; CarUserbll.SaveForm(keyvalue, car, null); //人员添加出入权限 var baselist = CarUserbll.addUserJurisdiction(keyvalue, state, baseurl, key, sign); return(Content(baselist.ToJson())); } else if (type == 1) {//物料车辆 string parkNames = "1号岗,二号地磅"; OperticketmanagerBLL obll = new OperticketmanagerBLL(); OperticketmanagerEntity op = obll.GetEntity(keyvalue); op.ExamineStatus = state; if (state == 3) { op.Getdata = DateTime.Now; } obll.SaveForm(keyvalue, op); CarAlgorithmEntity Car = new CarAlgorithmEntity(); Car.CarNo = op.Platenumber; Car.GPSID = op.GpsId; Car.GPSName = op.GpsName; Car.ID = op.ID; Car.State = 0; Car.Type = 4; string Dress = op.Dress; Car.GoodsName = Dress; int ISwharf = op.ISwharf; string Transporttype = op.Transporttype; if (Transporttype == "提货") { Car.LineName = op.Dress + Transporttype; if (ISwharf == 1) { Car.LineName += "(码头)"; parkNames += ",码头岗"; } } else { if (ISwharf == 1) { Car.LineName = "物料转运(码头)"; parkNames += ",码头岗"; } else { Car.LineName = "转运(纯称重)"; } } SocketHelper.SendMsg(Car.ToJson(), IP, Port); //车辆放行 AddCarpermission(baseurl, key, sign, op.Platenumber, op.DriverName, op.DriverTel, parkNames); return(Success("操作成功。")); } else {//危化品车辆 HazardouscarBLL hbll = new HazardouscarBLL(); HazardouscarEntity ha = hbll.GetEntity(keyvalue); ha.State = state; ha.InTime = DateTime.Now; hbll.Update(keyvalue, ha); CarAlgorithmEntity Car = new CarAlgorithmEntity(); Car.CarNo = ha.CarNo; Car.GPSID = ha.GPSID; Car.GPSName = ha.GPSNAME; Car.ID = ha.ID; Car.Type = 5; Car.State = 0; Car.LineName = ha.HazardousName; Car.GoodsName = ha.HazardousName; SocketHelper.SendMsg(Car.ToJson(), IP, Port); //车辆放行 CarIn(baseurl, key, sign, ha.CarNo, ha.Phone, ha.Dirver); //人员添加出入权限 var baselist = CarUserbll.addUserJurisdiction(keyvalue, state, baseurl, key, sign); return(Content(baselist.ToJson())); } }