| | |
| | | using Newtonsoft.Json.Linq; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Data; |
| | | using System.IO; |
| | | using System.Linq; |
| | | using System.Net; |
| | |
| | | { |
| | | [RoutePrefix(prefix: "api/BasicSetting")] |
| | | [ControllerGroup("基础设置","在线接口")] |
| | | [ChannelActionFilter] |
| | | public class BasicSettingController : ApiController |
| | | { |
| | | //定义全局信息返回变量 |
| | |
| | | string OrganName = obj["OrganName"].ToString(); //组织名称 |
| | | string Operator = obj["Operator"].ToString(); //操作人员 |
| | | int SupUnit = Convert.ToInt32(obj["SupUnit"].ToString());//上级单位 |
| | | string RightCode = obj["RightCode"].ToString(); //菜单功能编码 |
| | | string numvalue = obj["numvalue"].ToString(); //流水号 |
| | | string OperType = obj["OperType"].ToString(); //操作类型 |
| | | mes = BasicSettingBLL.AddUpdateOrganization(OrganType, OrganCode, OrganName, Operator, SupUnit, OperType); |
| | | mes = BasicSettingBLL.AddUpdateOrganization(OrganType, OrganCode, OrganName, Operator, SupUnit, RightCode, numvalue, OperType); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | |
| | | } |
| | | #endregion |
| | | |
| | | #region[用户所属班组] |
| | | /// <summary> |
| | | /// 用户所属班组 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [Route(template: "UserGroup")] |
| | | [HttpGet] |
| | | public HttpResponseMessage UserGroup() |
| | | { |
| | | mes = BasicSettingBLL.UserGroup(); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[用户清单新增编辑] |
| | | /// <summary> |
| | | /// 用户清单新增编辑 |
| | |
| | | string Password = obj["Password"].ToString(); //密码 |
| | | string Enable = obj["Enable"].ToString(); //在职状态 |
| | | string StuOrg = obj["StuOrg"].ToString(); //选择组织编码 |
| | | string groupcode= obj["groupcode"].ToString(); //所属班组编码 |
| | | string wagetype = obj["wagetype"].ToString(); //工资类型 |
| | | string Mobile = obj["Mobile"].ToString(); //联系方式 |
| | | string Email = obj["Email"].ToString(); //电子邮箱 |
| | | string Operator = obj["Operator"].ToString(); //操作人员 |
| | | string OperType = obj["OperType"].ToString(); //操作类型 |
| | | mes = BasicSettingBLL.AddUpdateUser(UserId, UserCode, UserName, Password, Enable, StuOrg, wagetype, Mobile, Email, Operator, OperType); |
| | | mes = BasicSettingBLL.AddUpdateUser(UserId, UserCode, UserName, Password, Enable, StuOrg, groupcode, wagetype, Mobile, Email, Operator, OperType); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | |
| | | /// <returns></returns> |
| | | [Route(template: "ImportUserExcel")] |
| | | [HttpPost] |
| | | public HttpResponseMessage ImportUserExcel(HttpPostedFileBase files) |
| | | public HttpResponseMessage ImportUserExcel(HttpPostedFileBase files,string username) |
| | | { |
| | | string savePath; |
| | | if (files == null || files.ContentLength <= 0) |
| | |
| | | } |
| | | else |
| | | { |
| | | var username = HttpContext.Current.Request.Cookies["admin"].Value.ToString(); //登录用户名 |
| | | string filename = Path.GetFileName(files.FileName); |
| | | int filesize = files.ContentLength;//获取上传文件的大小单位为字节byte |
| | | string fileEx = System.IO.Path.GetExtension(filename);//获取上传文件的扩展名 |
| | |
| | | #endregion |
| | | |
| | | |
| | | |
| | | #region[角色类型查询] |
| | | #region[用户组列表查询] |
| | | /// <summary> |
| | | /// 角色类型查询 |
| | | /// 用户组列表查询 |
| | | /// </summary> |
| | | /// <param name="page">页码</param> |
| | | /// <param name="rows">每页显示条数</param> |
| | | /// <param name="prop">排序字段</param> |
| | | /// <param name="order">排序规则</param> |
| | | /// <returns></returns> |
| | | [Route(template: "UserGroupSearch")] |
| | | [HttpGet] |
| | | public HttpResponseMessage UserGroupSearch(int page = 0, int rows = 0, string prop = null, string order = null) |
| | | { |
| | | int startNum = rows * (page - 1) + 1; //起始记录rowNum |
| | | int endNum = rows * page; //结束记录 rowNum |
| | | mes = BasicSettingBLL.UserGroupSearch(startNum, endNum, prop, order); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[用户组新增] |
| | | /// <summary> |
| | | /// 用户组新增 |
| | | /// </summary> |
| | | /// <param name="json">用户组新增提交数据</param> |
| | | /// <returns></returns> |
| | | [Route(template: "UserGroupAdd")] |
| | | [HttpPost] |
| | | public HttpResponseMessage UserGroupAdd(List<StepDefect> json) |
| | | { |
| | | var username = HttpContext.Current.Request.Cookies["admin"].Value.ToString(); |
| | | mes = BasicSettingBLL.UserGroupAdd(json, username); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[用户组删除] |
| | | /// <summary> |
| | | /// 用户组删除 |
| | | /// </summary> |
| | | /// <param name="UserGrupCode">用户组编码</param> |
| | | /// <returns></returns> |
| | | [Route(template: "UserGroupDelete")] |
| | | [HttpPost] |
| | | public HttpResponseMessage UserGroupDelete(string UserGrupCode) |
| | | { |
| | | mes = BasicSettingBLL.UserGroupDelete(UserGrupCode); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | |
| | | #region[角色类型列表查询] |
| | | /// <summary> |
| | | /// 角色类型列表查询 |
| | | /// </summary> |
| | | /// <param name="page">页码</param> |
| | | /// <param name="rows">每页显示条数</param> |
| | |
| | | public HttpResponseMessage RoleTypeDelete(string RoleTypeCode) |
| | | { |
| | | mes = BasicSettingBLL.RoleTypeDelete(RoleTypeCode); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[角色类型下拉接口] |
| | | /// <summary> |
| | | /// 角色类型下拉接口 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [Route(template: "RoleTypeSelect")] |
| | | [HttpGet] |
| | | public HttpResponseMessage RoleTypeSelect() |
| | | { |
| | | try |
| | | { |
| | | mes = BasicSettingBLL.RoleTypeSelect(); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | mes.code = "300"; |
| | | mes.Message = e.Message; |
| | | } |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | |
| | | } |
| | | #endregion |
| | | |
| | | #region[角色清单关联用户查询1] |
| | | /// <summary> |
| | | /// 角色清单关联用户查询1 |
| | | /// </summary> |
| | | /// <param name="rolecode">角色编码</param> |
| | | /// <returns></returns> |
| | | [Route(template: "RoleAssociationUserTwo")] |
| | | [HttpGet] |
| | | [HiddenApi] |
| | | public HttpResponseMessage RoleAssociationUserTwo(string rolecode = null) |
| | | { |
| | | mes = BasicSettingBLL.RoleAssociationUserTwo(rolecode); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[角色清单关联用户保存] |
| | | /// <summary> |
| | | /// 角色清单关联用户保存 |
| | |
| | | |
| | | #region[角色清单关联功能查询] |
| | | /// <summary> |
| | | /// 用户清单关联功能查询 |
| | | /// 角色清单关联功能查询 |
| | | /// </summary> |
| | | /// <param name="rolecode">角色编码</param> |
| | | /// <param name="type">操作端分类编码</param> |
| | | /// <returns></returns> |
| | | [Route(template: "RoleAssociationRight")] |
| | | [HttpGet] |
| | | public HttpResponseMessage RoleAssociationRight(string rolecode,string type) |
| | | public HttpResponseMessage RoleAssociationRight(string rolecode,string type=null) |
| | | { |
| | | mes = BasicSettingBLL.RoleAssociationRight(rolecode,type); |
| | | return TJson.toJson(mes); |
| | |
| | | string unitid = obj["id"].ToString(); //往来单位id(主键) |
| | | string unitcode = obj["unitcode"].ToString(); //往来单位编码编码 |
| | | string unitname = obj["unitname"].ToString(); //往来单位名称 |
| | | string unitattr = obj["unitattr"].ToString(); //往来单属性 |
| | | string mtypecode = obj["mtypecode"].ToString(); //外购供方编码 |
| | | string btypecode = obj["btypecode"].ToString(); //外协供方编码 |
| | | string htypecode = obj["htypecode"].ToString(); //客户编码 |
| | | string person = obj["person"].ToString(); //联系人 |
| | | string contact = obj["contact"].ToString(); //联系方式 |
| | | string description = obj["description"].ToString(); //补充描述 |
| | | var usercode = HttpContext.Current.Request.Cookies["navTabId"].Value.ToString(); |
| | | var usercode = HttpContext.Current.Request.Cookies["admin"].Value.ToString(); |
| | | string OperType = obj["OperType"].ToString(); //操作类型 |
| | | mes = BasicSettingBLL.AddUpdateCurrentUnit(unitid, unitcode, unitname, unitattr, person, contact, description, usercode, OperType); |
| | | mes = BasicSettingBLL.AddUpdateCurrentUnit(unitid, unitcode, unitname, mtypecode, btypecode,htypecode, person, contact, description, usercode, OperType); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | |
| | | /// <summary> |
| | | /// 往来单位删除 |
| | | /// </summary> |
| | | /// <param name="unitid">往来单位ID</param> |
| | | /// <param name="unitcode">往来单位编码</param> |
| | | /// <returns></returns> |
| | | [Route(template: "DeleteCurrentUnit")] |
| | | [HttpPost] |
| | | public HttpResponseMessage DeleteCurrentUnit(string unitid) |
| | | public HttpResponseMessage DeleteCurrentUnit(string unitcode) |
| | | { |
| | | mes = BasicSettingBLL.DeleteCurrentUnit(unitid); |
| | | mes = BasicSettingBLL.DeleteCurrentUnit(unitcode); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | #region[安灯系统/自定义安灯呼叫类型查询] |
| | | /// <summary> |
| | | /// 安灯系统/自定义安灯呼叫类型查询 |
| | | /// </summary> |
| | | /// <param name="page">页码</param> |
| | | /// <param name="rows">每页显示条数</param> |
| | | /// <param name="prop">排序字段</param> |
| | | /// <param name="order">排序规则</param> |
| | | /// <returns></returns> |
| | | [Route(template: "AnDengTypeSearch")] |
| | | [HttpGet] |
| | | public HttpResponseMessage AnDengTypeSearch(int page = 0, int rows = 0, string prop = null, string order = null) |
| | | { |
| | | int startNum = rows * (page - 1) + 1; //起始记录rowNum |
| | | int endNum = rows * page; //结束记录 rowNum |
| | | mes = BasicSettingBLL.AnDengTypeSearch(startNum, endNum, prop, order); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[安灯系统/自定义安灯呼叫类型新增] |
| | | /// <summary> |
| | | /// 安灯系统/自定义安灯呼叫类型新增 |
| | | /// </summary> |
| | | /// <param name="json">提交数据对象</param> |
| | | /// <returns></returns> |
| | | [Route(template: "AddUpdateAnDengType")] |
| | | [HttpPost] |
| | | public HttpResponseMessage AddUpdateAnDengType(List<ObjectData> json) |
| | | { |
| | | var username = HttpContext.Current.Request.Cookies["admin"].Value.ToString(); |
| | | mes = BasicSettingBLL.AddUpdateAnDengType(json, username); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[安灯系统/自定义安灯呼叫类型删除] |
| | | /// <summary> |
| | | /// 安灯系统/自定义安灯呼叫类型删除 |
| | | /// </summary> |
| | | /// <param name="andengtypecode">安灯呼叫类型编码</param> |
| | | /// <returns></returns> |
| | | [Route(template: "DeleteAnDengType")] |
| | | [HttpPost] |
| | | public HttpResponseMessage DeleteAnDengType(string andengtypecode) |
| | | { |
| | | mes = BasicSettingBLL.DeleteAnDengType(andengtypecode); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[安灯系统/查询绑定的响应人员] |
| | | /// <summary> |
| | | /// 安灯系统/查询绑定的响应人员 |
| | | /// </summary> |
| | | /// <param name="wkshopcode">选中的车间编码</param> |
| | | /// <param name="calltypecode">选中的呼叫类型编码</param> |
| | | /// <returns></returns> |
| | | [Route(template: "AnDengResponUserSearch")] |
| | | [HttpGet] |
| | | public HttpResponseMessage AnDengResponUserSearch(string wkshopcode,string calltypecode) |
| | | { |
| | | mes = BasicSettingBLL.AnDengResponUserSearch(wkshopcode, calltypecode); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[安灯系统/新增响应人员查询已绑定的响应人员] |
| | | /// <summary> |
| | | /// 安灯系统/新增响应人员查询已绑定的响应人员 |
| | | /// </summary> |
| | | /// <param name="wkshopcode">选中的车间编码</param> |
| | | /// <param name="calltypecode">选中的呼叫类型编码</param> |
| | | /// <returns></returns> |
| | | [Route(template: "AnDengDigoResponUserSearch")] |
| | | [HttpGet] |
| | | public HttpResponseMessage AnDengDialogResponUserSearch(string wkshopcode, string calltypecode) |
| | | { |
| | | mes = BasicSettingBLL.AnDengDialogResponUserSearch(wkshopcode, calltypecode); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[安灯系统/新增响应人员提交] |
| | | /// <summary> |
| | | /// 安灯系统/新增响应人员提交 |
| | | /// </summary> |
| | | /// <param name="wkshopcode">选中的车间编码</param> |
| | | /// <param name="calltypecode">选中的呼叫类型编码</param> |
| | | /// <param name="enable">允许关闭</param> |
| | | /// <param name="json">响应人员数据</param> |
| | | /// <returns></returns> |
| | | [Route(template: "AnDengDigoResponUserSeave")] |
| | | [HttpPost] |
| | | public HttpResponseMessage AnDengDigoResponUserSeave(string wkshopcode, string calltypecode,string enable,DataTable json) |
| | | { |
| | | var usercode = HttpContext.Current.Request.Cookies["admin"].Value.ToString(); |
| | | mes = BasicSettingBLL.AnDengDigoResponUserSeave(wkshopcode, calltypecode, enable, usercode,json); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[安灯系统/响应人员允许关闭] |
| | | /// <summary> |
| | | /// 安灯系统/响应人员允许关闭 |
| | | /// </summary> |
| | | /// <param name="wkshopcode">选中的车间编码</param> |
| | | /// <param name="calltypecode">选中的呼叫类型编码</param> |
| | | /// <param name="enable">允许关闭</param> |
| | | /// <returns></returns> |
| | | [Route(template: "AnDengResponUserCloseSeave")] |
| | | [HttpPost] |
| | | public HttpResponseMessage AnDengResponUserCloseSeave(string wkshopcode, string calltypecode, string enable) |
| | | { |
| | | var usercode = HttpContext.Current.Request.Cookies["admin"].Value.ToString(); |
| | | mes = BasicSettingBLL.AnDengResponUserCloseSeave(wkshopcode, calltypecode, enable, usercode); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[安灯系统/响应人员删除] |
| | | /// <summary> |
| | | /// 安灯系统/响应人员删除 |
| | | /// </summary> |
| | | /// <param name="id">子id</param> |
| | | /// <param name="ando_cogfigid">主id</param> |
| | | /// <returns></returns> |
| | | [Route(template: "AnDengResponUserDeleteSeave")] |
| | | [HttpPost] |
| | | public HttpResponseMessage AnDengResponUserDeleteSeave(string id, string ando_cogfigid) |
| | | { |
| | | mes = BasicSettingBLL.AnDengResponUserDeleteSeave(id, ando_cogfigid); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |