123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298 |
- using ICSharpCode.TextEditor.Actions;
- using PMS.BusinessModels.ExternalManage;
- using PMS.EntityModels.ExternalManage;
- using PMS.Interface;
- using PMS.Interface.ExternalManage;
- using System;
- using System.Collections.Generic;
- using System.Configuration;
- using System.Drawing.Printing;
- using System.Linq;
- using System.Runtime.InteropServices;
- using System.Web;
- using System.Web.Mvc;
- using System.Web.Razor.Tokenizer.Symbols;
- namespace PMS.WebUI.Controllers
- {
- [CheckLogin(true)]
- public class ExternalManageController : BaseController
- {
- private string url = ConfigurationManager.AppSettings["External"].ToStringEx();
-
- IExternalManage externalManage = InterfaceFactory.CreateBusinessInstance<IExternalManage>();
- // GET: ExternalManage
- public ActionResult ExternalManage()
- {
- ViewBag.RYXZ = GetCurrentUser().PersonProperty;
- return View();
- }
-
- public ActionResult ExternalAccredit()
- {
- ViewBag.baseUrl = url;
- ViewBag.userName = GetCurrentUser().Name;
- return View();
- }
- public ActionResult ExternalRecords()
- {
- ViewBag.baseUrl = url;
- ViewBag.userName = GetCurrentUser().Name;
- return View();
- }
- /// <summary>
- /// 关键字查询外部服务分类
- /// </summary>
- /// <param name="keyword">关键字</param>
- /// <returns></returns>
- [HttpPost]
- public ActionResult GetMenu(string keyword, string productId, int type)
- {
- var json = externalManage.GetMenu(keyword, productId, type);
- return Content(json, "application/json");
- }
- /// <summary>
- /// 产品ID查询分类
- /// </summary>
- /// <param name="keyword">关键字</param>
- /// <returns></returns>
- [HttpPost]
- public ActionResult GetMenuByProduct(List<string> productIds)
- {
- var json = externalManage.GetMenuByProduct(productIds);
- return Content(json, "application/json");
- }
- /// <summary>
- /// 获取编码
- /// </summary>
- /// <param name="tableName">表名</param>
- /// <returns></returns>
- [HttpPost]
- public ActionResult GetMaxClassCode(string parent_id, int type, string productId)
- {
- var json = externalManage.GetMaxClassCode( parent_id, type, productId);
- return Content(json);
- }
- /// <summary>
- /// 保存服务分类
- /// </summary>
- /// <param name="model"></param>
- /// <returns></returns>
- [HttpPost]
- public ActionResult SaveExternalClass(ExternalClass model)
- {
- var json = externalManage.SaveExternalClass(model);
- if (json)
- {
- return this.ResponseJson(System.Net.HttpStatusCode.OK, "保存成功");
- }
- else
- {
- return this.ResponseJson(System.Net.HttpStatusCode.InternalServerError, "保存失败");
- }
- }
- /// <summary>
- /// 删除服务分类
- /// </summary>
- /// <param name="id"></param>
- /// <returns></returns>
- [HttpPost]
- public ActionResult DeleteClass(string id)
- {
- var res = externalManage.DeleteClass(id);
- if (res)
- {
- return this.ResponseJson(System.Net.HttpStatusCode.OK, "删除成功");
- }
- else
- {
- return this.ResponseJson(System.Net.HttpStatusCode.InternalServerError, "删除失败");
- }
- }
- /// <summary>
- /// 获取服务目录
- /// </summary>
- /// <param name="class_id">分类id</param>
- /// <param name="keyword">关键字</param>
- /// <returns></returns>
- [HttpPost]
- public ActionResult GetExternal(string class_id, string keyword, int pageSize, int pageNum)
- {
- var json = externalManage.GetExternal(class_id, keyword, pageSize, pageNum);
- return Content(json, "application/json");
- }
- /// <summary>
- /// 保存服务
- /// </summary>
- /// <param name="model"></param>
- /// <returns></returns>
- [HttpPost]
- public ActionResult SaveExternal(External model)
- {
- var json = externalManage.SaveExternal(model);
- if(json)
- {
- return this.ResponseJson(System.Net.HttpStatusCode.OK, "保存成功");
- }else
- {
- return this.ResponseJson(System.Net.HttpStatusCode.InternalServerError, "保存失败");
- }
- }
- /// <summary>
- /// 获取参数
- /// </summary>
- /// <param name="type"></param>
- /// <param name="id"></param>
- /// <returns></returns>
- [HttpPost]
- public ActionResult GetParameter(string type, string id)
- {
- var json = externalManage.GetParameter(type, id);
- return Content(json, "application/json");
- }
- /// <summary>
- /// 参数设置
- /// </summary>
- /// <param name="id"></param>
- /// <returns></returns>
- [HttpPost]
- public ActionResult GetExternalParameter(string id)
- {
- var json = externalManage.GetExternalParameter(id);
- return Content(json, "application/json");
- }
- /// <summary>
- /// 保存参数设置
- /// </summary>
- /// <param name="model"></param>
- /// <returns></returns>
- [HttpPost]
- public ActionResult SavaExternalSet(v_parameter model)
- {
- var json = externalManage.SavaExternalSet(model);
- if (json)
- {
- return this.ResponseJson(System.Net.HttpStatusCode.OK, "保存成功");
- }
- else
- {
- return this.ResponseJson(System.Net.HttpStatusCode.InternalServerError, "保存失败");
- }
- }
- /// <summary>
- /// 删除服务和出入参信息
- /// </summary>
- /// <param name="id"></param>
- /// <returns></returns>
- [HttpPost]
- public ActionResult deleteExternal(string id)
- {
- var res = externalManage.deleteExternal(id);
- if (res)
- {
- return this.ResponseJson(System.Net.HttpStatusCode.OK, "删除成功");
- }
- else
- {
- return this.ResponseJson(System.Net.HttpStatusCode.InternalServerError, "删除失败");
- }
- }
-
- /// <summary>
- /// 复制
- /// </summary>
- /// <param name="model"></param>
- /// <returns></returns>
- [HttpPost]
- public ActionResult CopyExternalByClass(dto_copy_class model)
- {
- var res = externalManage.CopyExternalByClass(model);
- if (res)
- {
- return this.ResponseJson(System.Net.HttpStatusCode.OK, "成功");
- }
- else
- {
- return this.ResponseJson(System.Net.HttpStatusCode.InternalServerError, "失败");
- }
- }
- /// <summary>
- /// 复制
- /// </summary>
- /// <param name="model"></param>
- /// <returns></returns>
- [HttpPost]
- public ActionResult CopyExternal(dto_copy_external model)
- {
- var res = externalManage.CopyExternal(model);
- if (res)
- {
- return this.ResponseJson(System.Net.HttpStatusCode.OK, "成功");
- }
- else
- {
- return this.ResponseJson(System.Net.HttpStatusCode.InternalServerError, "失败");
- }
- }
- /// <summary>
- /// 查询授权接口
- /// </summary>
- /// <param name="keyword"></param>
- /// <param name="pageSize"></param>
- /// <param name="pageNum"></param>
- /// <returns></returns>
- [HttpPost]
- public ActionResult GetAccredit(string keyword, int pageSize, int pageNum, int is_stop)
- {
- var json = externalManage.GetAccredit(keyword, pageSize, pageNum, is_stop);
- return Content(json, "application/json");
- }
- /// <summary>
- /// 保存授权信息
- /// </summary>
- /// <param name="model"></param>
- /// <returns></returns>
- [HttpPost]
- public ActionResult SavaAccredit(ExternalAccredit model)
- {
- var res = externalManage.SavaAccredit(model);
- if (res)
- {
- return this.ResponseJson(System.Net.HttpStatusCode.OK, "成功");
- }
- else
- {
- return this.ResponseJson(System.Net.HttpStatusCode.InternalServerError, "失败");
- }
- }
- /// <summary>
- /// 授权信息
- /// </summary>
- /// <param name="id"></param>
- /// <param name="channel_id"></param>
- /// <param name="project_id"></param>
- /// <param name="pageSize"></param>
- /// <param name="pageNum"></param>
- /// <returns></returns>
- [HttpPost]
- public ActionResult GetAccredView(string id, string channel_id, string project_id, int pageSize, int pageNum, int is_stop)
- {
- var json = externalManage.GetAccredView(id, channel_id, project_id, pageSize, pageNum, is_stop);
- return Content(json, "application/json");
- }
- [HttpPost]
- public ActionResult GetRecords(dto_records_in model)
- {
- var json = externalManage.GetRecords(model);
- return Content(json, "application/json");
- }
- }
- }
|