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.
97 lines
3.3 KiB
97 lines
3.3 KiB
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Web;
|
|
using System.Data;
|
|
using Newtonsoft.Json;
|
|
using System.IO;
|
|
using Spire.Doc;
|
|
using Spire.Doc.Documents;
|
|
using System.Drawing;
|
|
using Spire.Doc.Fields;
|
|
using MySql.Data.MySqlClient;
|
|
using System.Text.RegularExpressions;
|
|
using FangYar.WebUI.WorkFlow.Platform.WorkFlowArchives;
|
|
|
|
namespace FangYar.WebUI.ashx
|
|
{
|
|
/// <summary>
|
|
/// PoliticalInterfaceHandler 党建接口
|
|
/// </summary>
|
|
public class PoliticalInterfaceHandler : IHttpHandler
|
|
{
|
|
public void ProcessRequest(HttpContext context)
|
|
{
|
|
|
|
// 记录操作日志
|
|
BLL.SysOperationLogHelp.AddSysOperationLog(context, Common.EnumOperationLogType.Other, "党建接口操作请求", "");
|
|
|
|
context.Response.ContentType = "text/plain";
|
|
string action = context.Request.Params["Action"];
|
|
string returnstr = "";
|
|
|
|
switch (action)
|
|
{
|
|
// 根据手机号获取营区对应的人员
|
|
case "getEmpListByUsersUids":
|
|
returnstr = getEmpListByUsersUids(context);
|
|
break;
|
|
}
|
|
|
|
context.Response.Write(returnstr);
|
|
}
|
|
/// <summary>
|
|
/// 根据手机号获取营区对应的人员
|
|
/// </summary>
|
|
/// <param name="context"></param>
|
|
/// <returns></returns>
|
|
private string getEmpListByUsersUids(HttpContext context)
|
|
{
|
|
string returnstr = "";
|
|
try
|
|
{
|
|
string usersUids = context.Request.Params["usersUids"];
|
|
if (string.IsNullOrEmpty(usersUids))
|
|
{
|
|
return "{\"code\":\"-1\",\"msg\":\"请求异常,请联系平台管理员。\",\"error\":\"phones参数不能为空!\",\"data\":[]}";
|
|
}
|
|
|
|
string sql = "select e.users_uid from tbl_sys_emp e inner join tbl_sys_users u on e.users_uid = u.users_uid where e.users_uid in (" + usersUids + ") ";
|
|
|
|
DataTable dt = FangYar.Common.MySqlHelper.QueryTable(sql);
|
|
|
|
String resUids = "";
|
|
for (int i = 0; i < dt.Rows.Count; i++)
|
|
{
|
|
if (i == 0)
|
|
{
|
|
resUids = "\"" + dt.Rows[i]["USERS_UID"].ToString() + "\"";
|
|
}
|
|
else
|
|
{
|
|
resUids += ",\"" + dt.Rows[i]["USERS_UID"].ToString() + "\"";
|
|
}
|
|
}
|
|
returnstr = "{\"code\":\"200\",\"msg\":\"操作成功!\",\"data\":[" + resUids + "]}";
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
var a = Regex.Replace(e.Message, @"\r", "");
|
|
var b = Regex.Replace(a, @"\n", "");
|
|
// 记录操作日志
|
|
BLL.SysOperationLogHelp.AddSysOperationLog(context, Common.EnumOperationLogType.Error, "党建接口操作请求", "根据手机号获取营区对应的人员异常:" + e);
|
|
returnstr = "{\"code\":\"-2\",\"msg\":\"请求异常,请联系平台管理员!\",\"error\":\"" + b + "\",\"data\":[]}";
|
|
}
|
|
return returnstr;
|
|
}
|
|
|
|
|
|
public bool IsReusable
|
|
{
|
|
get
|
|
{
|
|
return false;
|
|
}
|
|
}
|
|
}
|
|
}
|