12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436 |
- using Newtonsoft.Json;
- using Newtonsoft.Json.Linq;
- using PMS.BusinessModels;
- using PMS.BusinessModels.Account;
- using PMS.BusinessModels.ComplaintManage;
- using PMS.BusinessModels.Product;
- using PMS.BusinessModels.Project;
- using PMS.BusinessModels.Search;
- using PMS.EntityModels.ProManager;
- using PMS.Interface;
- using PMS.Interface.MedicalRecordManager;
- using PMS.Interface.ProManager;
- using PMS.Interface.SysManager;
- using PMS.Plugins.PluginsModels;
- using QWPlatform.SystemLibrary;
- using QWPlatform.SystemLibrary.Utils;
- using System;
- using System.Collections.Generic;
- using System.Configuration;
- using System.Data;
- using System.IO;
- using System.Linq;
- using System.Net.Http;
- using System.Security.Policy;
- using System.Text;
- using System.Web;
- using System.Web.Helpers;
- using System.Web.Mvc;
- using System.Web.Razor.Tokenizer.Symbols;
- using System.Web.Services.Description;
- namespace PMS.WebUI.Controllers
- {
- /// <summary>
- /// 创建人:王璐
- /// 创建日期:2018/12/30
- /// 模块功能:项目信息
- /// </summary>
- public class ProManagerController : BaseController
- {
- /// <summary>
- /// 实例接口
- /// </summary>
- IProModule ProModule = InterfaceFactory.CreateBusinessInstance<IProModule>();
- IAccount Acount = InterfaceFactory.CreateBusinessInstance<IAccount>();
- public static string ZLPMSAPI = ConfigurationManager.AppSettings["ZLPMSAPI"].ToStringEx();//问题管理系统webAPI
- [HttpGet]
- public ActionResult Index()
- {
- return View();
- }
- /// <summary>
- /// 项目表单主页
- /// </summary>
- /// <returns></returns>
- [HttpGet]
- public ActionResult ProjectForm()
- {
- return View();
- }
-
- #region 信息显示
- /// <summary>
- /// 获取全部渠道信息
- /// </summary>
- /// <param name="UserID"></param>
- /// <returns></returns>
- public ActionResult Datagrid()
- {
- string json = ProModule.GetAll_Channel(GetAuthDats().Channel);
- return Content(json, "application/json");
- }
- /// <summary>
- /// 根据数据权限获取项目
- /// </summary>
- /// <param name="ChannelID"></param>
- /// <param name="UserID"></param>
- /// <returns></returns>
- public ActionResult BingProData(string ChannelID, string Search)
- {
- string json = ProModule.Get_Pro_NoAuthor(ChannelID, Search);
- return Content(json, "application/json");
- }
- /// <summary>
- /// 根据项目ID获取机构信息
- /// </summary>
- /// <param name="ChannelID"></param>
- /// <param name="UserID"></param>
- /// <returns></returns>
- [HttpGet]
- public ActionResult BingStationData(string id, int page, int rows, string Search)
- {
- string json = ProModule.Get_Station_ById(id, page, rows, Search);
- return Content(json, "application/json");
- }
- /// <summary>
- /// 根据项目ID获取服务器信息
- /// </summary>
- /// <param name="id"></param>
- /// <param name="page"></param>
- /// <param name="rows"></param>
- /// <returns></returns>
- public ActionResult BingServerData(string id, int page, int rows)
- {
- string json = ProModule.Get_Server_ById(id, page, rows);
- return Content(json, "application/json");
- }
- /// <summary>
- /// 根据项目ID获取项目人员信息
- /// </summary>
- /// <param name="id"></param>
- /// <param name="page"></param>
- /// <param name="rows"></param>
- /// <returns></returns>
- public ActionResult BingWorkerData(string id, int page, int rows)
- {
- string json = ProModule.Get_Worker_ById(id, page, rows);
- return Content(json, "application/json");
- }
- /// <summary>
- /// 根据项目ID获取项目产品信息
- /// </summary>
- /// <param name="id"></param>
- /// <param name="page"></param>
- /// <param name="rows"></param>
- /// <returns></returns>
- public ActionResult BingProductData(string id)
- {
- string json = ProModule.Get_Product_ById(id);
- return Content(json, "application/json");
- }
- /// <summary>
- /// 返回当前登陆人信息
- /// </summary>
- /// <returns></returns>
- [HttpPost]
- public ActionResult GetFeedbackID()
- {
- var user = GetCurrentUser();
- var obj = new
- {
- jobcode = user.JobCode,
- nature = user.PersonProperty,
- id = user.PersonID
- };
- return Content(Strings.ObjectToJson(obj), "application/json");
- }
- #endregion
- #region 项目添加
- /// <summary>
- /// 添加项目的弹窗
- /// </summary>
- /// <param name="id"></param>
- /// <returns></returns>
- public ActionResult ProjectInfo(string id)
- {
- ViewBag.id = id;
- return View();
- }
- /// <summary>
- /// 添加项目
- /// </summary>
- /// <returns></returns>
- [HttpPost]
- public int Add_Project(ProBusinessModel model)
- {
- //获取登录者信息
- var user = this.GetCurrentUser();
- Session["identifyID"] = "null";
- //创建项目
- string projectID = ProModule.Add_Project(model, user);
- //判断创建是否成功
- if (projectID == "NO")
- {
- return -1;
- }
- else if (projectID == null || projectID.Length == 0)
- {
- return 0;
- }
- else
- {
- //将创建的项目自动分配给创建者
- if (Acount.AuthProjectToAccount(user.ID, user.CompanyID, projectID))
- {
- Session["channel"] = model.id;
- Session["project"] = projectID;
- return 1;
- }
- }
- return 0;
- }
- /// <summary>
- /// 根据项目ID获取该项目的信息
- /// </summary>
- /// <param name="ID"></param>
- /// <returns></returns>
- public ActionResult Get_Pro_ById(string ID)
- {
- var dt = ProModule.ProInfo_ById(ID);
- return this.ResponseJson(System.Net.HttpStatusCode.OK, "读取成功", dt);
- }
- /// <summary>
- /// 获取项目性质
- /// </summary>
- /// <returns></returns>
- public ActionResult GetNature()
- {
- var dt = ProModule.GetNature();
- return Content(dt, "application/json");
- }
- /// <summary>
- /// 实施方式
- /// </summary>
- /// <returns></returns>
- public ActionResult GetImplementation()
- {
- var dt = ProModule.GetImplementation();
- return Content(dt, "application/json");
- }
- /// <summary>
- /// 项目状态
- /// </summary>
- /// <returns></returns>
- public ActionResult GetState()
- {
- var dt = ProModule.GetState();
- return Content(dt, "application/json");
- }
- #endregion
- #region 项目修改
- /// <summary>
- /// 修改项目弹窗
- /// </summary>
- /// <param name="id"></param>
- /// <returns></returns>
- public ActionResult UpdateProjectInfo(string id)
- {
- ViewBag.id = id;
- return View();
- }
- /// <summary>
- /// 更新操作
- /// </summary>
- /// <returns></returns>
- public int Update_Project(ProBusinessModel model)
- {
- Session["channel"] = model.id;
- Session["project"] = model.PID;
- int r = ProModule.SaveProject(model);
- return r;
- }
- /// <summary>
- /// 根据项目ID获取项目审核流程信息
- /// </summary>
- /// <param name="ID"></param>
- /// <returns></returns>
- public ActionResult GetXMWTLC(string id)
- {
- var dt = ProModule.GetXMWTLC(id);
- return Content(dt, "application/json");
- }
- public ActionResult GetProblem(string XMID, string ID)
- {
- var dt = ProModule.GetProblem(XMID, ID);
- return Content(dt, "application/json");
- }
- public ActionResult GetProInfo(string id)
- {
- var dt = ProModule.GetProInfo(id);
- return this.ResponseJson(System.Net.HttpStatusCode.OK, "读取成功", dt);
- }
- #endregion
- #region 项目删除
- /// <summary>
- /// 根据项目ID删除项目
- /// </summary>
- /// <param name="id"></param>
- /// <returns></returns>
- [HttpPost]
- public int Del_Project(string id)
- {
- int r = ProModule.Del_Project(id);
- return r;
- }
- #endregion
- #region 机构添加
- /// <summary>
- /// 添加机构的弹窗
- /// </summary>
- /// <param name="id"></param>
- /// <returns></returns>
- public ActionResult StationInfo(string id)
- {
- ViewBag.id = id;
- return View();
- }
- /// <summary>
- /// 机构等级
- /// </summary>
- /// <returns></returns>
- public ActionResult GetLevel()
- {
- var dt = ProModule.GetLevel();
- return Content(dt, "application/json");
- }
- /// <summary>
- /// 添加机构
- /// </summary>
- /// <returns></returns>
- [HttpPost]
- public int Add_Station(StationBusinessModel model)
- {
- return ProModule.Add_Station(model);
- }
- /// <summary>
- /// 工作流分组目录
- /// </summary>
- /// <returns></returns>
- public ActionResult GetCatalog(string id)
- {
- return Content(ProModule.GetCatalog(id), "application/json");
- }
- #endregion
- #region 机构修改
- /// <summary>
- /// 添加修改弹窗
- /// </summary>
- /// <param name="id"></param>
- /// <returns></returns>
- public ActionResult UpdatStationInfo(string id)
- {
- ViewBag.id = id;
- return View();
- }
- /// <summary>
- /// 接受渠道ID
- /// </summary>
- /// <param name="id"></param>
- /// <returns></returns>
- [HttpPost]
- public void PostChannelId(string id)
- {
- TempData["ProjectID"] = id;
- }
- /// <summary>
- /// 更新操作
- /// </summary>
- /// <returns></returns>
- public int UpdateStation(StationBusinessModel model)
- {
- int r = ProModule.SaveStation(model);
- return r;
- }
- /// <summary>
- /// 根据ID获取机构信息
- /// </summary>
- /// <returns></returns>
- public ActionResult GetStationInfo(string id)
- {
- var dt = ProModule.GetStationInfo(id);
- return this.ResponseJson(System.Net.HttpStatusCode.OK, "读取成功", dt);
- }
- #endregion
- #region 机构删除
- /// <summary>
- /// 根据项目ID删除项目
- /// </summary>
- /// <param name="id"></param>
- /// <returns></returns>
- [HttpPost]
- public int Del_Station(string id)
- {
- int r = ProModule.Del_Station(id);
- return r;
- }
- #endregion
- #region 服务器添加
- /// <summary>
- /// 添加服务器的弹窗
- /// </summary>
- /// <param name="id"></param>
- /// <returns></returns>
- public ActionResult ServerInfo(string id)
- {
- ViewBag.id = id;
- return View();
- }
- /// <summary>
- /// 服务器类型
- /// </summary>
- /// <returns></returns>
- public ActionResult GetServerType()
- {
- var dt = ProModule.GetServerType();
- return Content(dt, "application/json");
- }
- /// <summary>
- /// 安装服务类型
- /// </summary>
- /// <returns></returns>
- public ActionResult GetInstallServerType()
- {
- var dt = ProModule.GetInstallServerType();
- return Content(dt, "application/json");
- }
- /// <summary>
- /// 数据库类型
- /// </summary>
- /// <returns></returns>
- public ActionResult GetDataBaseType()
- {
- var dt = ProModule.GetDataBaseType();
- return Content(dt, "application/json");
- }
- /// <summary>
- /// 预警类型
- /// </summary>
- /// <returns></returns>
- public ActionResult GetEarlyWarningType()
- {
- var dt = ProModule.GetEarlyWarningType();
- return Content(dt, "application/json");
- }
- /// <summary>
- /// 预警处理状态
- /// </summary>
- /// <returns></returns>
- public ActionResult GetWarningProcessingStatu()
- {
- var dt = ProModule.GetWarningProcessingStatu();
- return Content(dt, "application/json");
- }
- /// <summary>
- /// 项目监控状态
- /// </summary>
- /// <returns></returns>
- public ActionResult GetProjectMonitoringStatus()
- {
- var dt = ProModule.GetProjectMonitoringStatus();
- return Content(dt, "application/json");
- }
- /// <summary>
- /// 指标信息类型
- /// </summary>
- /// <returns></returns>
- public ActionResult GetIndicatorInformationType()
- {
- var dt = ProModule.GetIndicatorInformationType();
- return Content(dt, "application/json");
- }
- /// <summary>
- /// 指标信息状态
- /// </summary>
- /// <returns></returns>
- public ActionResult GetIndicatorInformationStatu()
- {
- var dt = ProModule.GetIndicatorInformationStatu();
- return Content(dt, "application/json");
- }
- /// <summary>
- /// 产品
- /// </summary>
- /// <returns></returns>
- public ActionResult GetProduct()
- {
- var dt = ProModule.GetProduct();
- return Content(dt, "application/json");
- }
- /// <summary>
- /// 添加服务器
- /// </summary>
- /// <returns></returns>
- [HttpPost]
- public int Add_Server(ServerBusinessModel model)
- {
- return ProModule.Add_Server(model);
- }
- #endregion
- #region 服务器修改
- /// <summary>
- /// 服务器修改弹窗
- /// </summary>
- /// <param name="id"></param>
- /// <returns></returns>
- public ActionResult UpdateServerInfo(string id)
- {
- ViewBag.id = id;
- return View();
- }
- /// <summary>
- /// 更新操作
- /// </summary>
- /// <returns></returns>
- public int UpdateServer(ServerBusinessModel model)
- {
- int r = ProModule.UpdateServer(model);
- return r;
- }
- /// <summary>
- /// 根据ID获取机构信息
- /// </summary>
- /// <returns></returns>
- public ActionResult GetServerInfo(string id)
- {
- var dt = ProModule.GetServerInfo(id);
- return this.ResponseJson(System.Net.HttpStatusCode.OK, "读取成功", dt);
- }
- #endregion
- #region 服务器删除
- /// <summary>
- /// 根据服务器ID删除服务器
- /// </summary>
- /// <param name="id"></param>
- /// <returns></returns>
- [HttpPost]
- public int Del_Server(string id)
- {
- int r = ProModule.Del_Server(id);
- return r;
- }
- #endregion
- /// <summary>
- /// 添加服务器数据库的弹窗
- /// </summary>
- /// <param name="id"></param>
- /// <returns></returns>
- public ActionResult ServerDataBaseInfo()
- {
- return View();
- }
- #region 项目人员添加
- /// <summary>
- /// 添加项目人员的弹窗
- /// </summary>
- /// <param name="id"></param>
- /// <returns></returns>
- public ActionResult WorkerInfo(string id)
- {
- ViewBag.id = id;
- TempData["ProID"] = id;
- TempData["ProjectID"] = id;
- return View();
- }
- /// <summary>
- /// 获取渠道对应的人员
- /// </summary>
- /// <returns></returns>
- public ActionResult GetWorkerInfo()
- {
- string id = TempData["ProID"].ToString();
- var dt = ProModule.GetWorkerInfo(id);
- return Content(dt, "application/json");
- }
- /// <summary>
- /// 获取项目对应的人员
- /// </summary>
- /// <returns></returns>
- public ActionResult GetWorker(string id)
- {
- var dt = ProModule.GetWorker(id);
- return Content(dt, "application/json");
- }
- /// <summary>
- /// 添加项目人员
- /// </summary>
- /// <returns></returns>
- [HttpPost]
- public int Add_Worker(WorkerBusinessModel model)
- {
- return ProModule.Add_Worker(model);
- }
- #endregion
- #region 项目人员修改
- /// <summary>
- ///项目人员修改弹窗
- /// </summary>
- /// <param name="id"></param>
- /// <returns></returns>
- public ActionResult UpdateWorkerInfo(string id)
- {
- ViewBag.id = id;
- return View();
- }
- /// <summary>
- /// 更新操作
- /// </summary>
- /// <returns></returns>
- [HttpPost]
- public int UpdateWorker(string id)
- {
- int r = ProModule.UpdateWorker(id);
- return r;
- }
- /// <summary>
- /// 根据ID获取人员信息
- /// </summary>
- /// <returns></returns>
- public ActionResult GetWorkerInfoByID(string id)
- {
- var user = GetCurrentUser();
- var dt = ProModule.GetWorkerInfoByID(user.PersonID);
- return this.ResponseJson(System.Net.HttpStatusCode.OK, "读取成功", dt);
- }
- #endregion
- #region 项目产品添加
- /// <summary>
- /// 添加项目产品的弹窗
- /// </summary>
- /// <param name="id"></param>
- /// <returns></returns>
- public ActionResult ProductInfo(string id)
- {
- ViewBag.id = id;
- return View();
- }
- /// <summary>
- /// 添加项目产品
- /// </summary>
- /// <param name="model"></param>
- /// <returns></returns>
- [HttpPost]
- public int Add_Product(ProductBusinessModel model)
- {
- return ProModule.Add_Product(model);
- }
- /// <summary>
- /// 获取产品名称
- /// </summary>
- /// <returns></returns>
- public ActionResult GetProductByID()
- {
- var dt = ProModule.GetProductByID();
- return Content(dt, "application/json");
- }
- /// <summary>
- /// 根据产品ID获取版本号
- /// </summary>
- /// <returns></returns>
- public ActionResult GetEditionByID(string id)
- {
- var json = ProModule.GetEditionByID(id);
- return Content(json, "text/json");
- }
- #endregion
- #region 项目产品修改
- /// <summary>
- /// 项目产品修改弹窗
- /// </summary>
- /// <param name="id"></param>
- /// <param name="xmid"></param>
- /// <returns></returns>
- public ActionResult UpdateProductInfo(string id, string xmid)
- {
- ViewBag.id = id;
- ViewBag.xmid = xmid;
- return View();
- }
- /// <summary>
- /// 变更产品状态
- /// </summary>
- /// <param name="id"></param>
- /// <param name="xmid"></param>
- /// <param name="qdid"></param>
- /// <param name="type">1新增2修改</param>
- /// <returns></returns>
- public ActionResult UpdateProductStatusChange(string id, string xmid, string qdid,int type)
- {
- ViewBag.id = id;
- ViewBag.xmid = xmid;
- ViewBag.qdid = qdid;
- ViewBag.type = type;
- return View();
- }
- /// <summary>
- /// 调整服务时间
- /// </summary>
- /// <param name="model"></param>
- /// <returns></returns>
- public int AdjustServiceTime(ProjectMainRecordsModel model)
- {
- var user = GetCurrentUser();
- model.DJR= user.Name;
- model.DJRID = user.PersonID;
- int r = ProModule.AdjustServiceTime(model);
- return r;
- } /// <summary>
- /// 修改产品服务时间
- /// </summary>
- /// <param name="model"></param>
- /// <returns></returns>
- public int UpdateAdjustServiceTime(ProjectMainRecordsModel model)
- {
- var user = GetCurrentUser();
- model.DJR = user.Name;
- model.DJRID = user.PersonID;
- int r = ProModule.UpdateAdjustServiceTime(model);
- return r;
- }
- /// <summary>
- /// 删除产品服务记录
- /// </summary>
- /// <param name="ID"></param>
- /// <returns></returns>
- public int DeleteAdjustServiceTime(string ID)
- {
- ProjectMainRecordsModel model= new ProjectMainRecordsModel();
- var user = GetCurrentUser();
- model.ID=ID;
- model.DJR = user.Name;
- model.DJRID = user.PersonID;
- int r = ProModule.DeleteAdjustServiceTime(model);
- return r;
- }
- /// <summary>
- /// 查询单条维保记录
- /// </summary>
- /// <param name="ID"></param>
- /// <returns></returns>
- public ActionResult Get_SingleServiceRecord(string id)
- {
- var json = ProModule.Get_SingleServiceRecord(id);
- return Content(json, "text/json");
- }
- /// <summary>
- /// 根据产品ID获取服务时间
- /// </summary>
- /// <param name="QDID"></param>
- /// <param name="XMID"></param>
- /// <param name="CPID"></param>
- /// <returns></returns>
- public ActionResult Get_ProductAdjustService(string QDID, string XMID, string CPID)
- {
- string json = ProModule.Get_ProductAdjustService(QDID, XMID, CPID).ToJson();
- return Content(json, "application/json");
- }
- /// <summary>
- /// 获取BH客户信息
- /// </summary>
- /// <returns></returns>
- public ActionResult GetBHCustomer(string q)
- {
- var url = ZLPMSAPI+"/api/ProblemManagSystem/GetBHCustomer";
- string data = "{\"name\": \"" + q + "\"}";
- var client = new HttpClient();
- var content = new StringContent(data, Encoding.UTF8, "application/json");
- var statereslut = client.PostAsync(url, content).Result.Content.ReadAsStringAsync().Result;
- JObject jResult = JObject.Parse(statereslut);
- var Result = jResult["data"];
- string strResult = Result.ToString();
- return Content(strResult, "application/json");
- }
- /// <summary>
- /// 更新操作
- /// </summary>
- /// <returns></returns>
- public int UpdateProduct(ProductBusinessModel model)
- {
- int r = ProModule.UpdateProduct(model);
- return r;
- }
- /// <summary>
- /// 产品ID根据ID获取产品名称
- /// </summary>
- /// <returns></returns>
- public ActionResult GetProductInfo(string id)
- {
- var json = ProModule.GetProductInfo(id);
- //return this.ResponseJson(System.Net.HttpStatusCode.OK, "读取成功", dt);
- return Content(json, "text/json");
- }
- //根据项目产品模块ID获取版本和说明
- [HttpPost]
- public ActionResult GetProjectProducct(string id)
- {
- var json = ProModule.GetProjectProducct(id);
- return Content(json, "text/json");
- }
- #endregion
- #region 项目产品删除
- /// <summary>
- /// 根据项目产品ID删除项目产品
- /// </summary>
- /// <param name="id"></param>
- /// <returns></returns>
- [HttpPost]
- public int Del_Product(string id)
- {
- int r = ProModule.Del_Product(id);
- return r;
- }
- #endregion
- #region 批量导入
- public ActionResult Itemupload(string ItemInfoId)
- {
- ViewBag.id = ItemInfoId;
- Session["ProjectID"] = ItemInfoId;
- return View();
- }
- [HttpPost]
- public string ItemSiteBatch()
- {
- var itemInfoId = Session["ProjectID"].ToString();// Request.Form["itemInfoId"];
- try
- {
- if (Request.Files.Count > 0)
- {
- var inputstream = Request.Files[0].InputStream;
- byte[] b = new byte[inputstream.Length];
- inputstream.Read(b, 0, (int)inputstream.Length);
- string inputstr = Encoding.Default.GetString(b);
- var rstr = ProModule.ItemSiteBatch(itemInfoId, inputstr);
- return rstr;
- }
- else
- {
- return "{\"code\":0,\"msg\":\"未获取上传文件\"}";
- }
- }
- catch (Exception)
- {
- return "{\"code\":0,\"msg\":\"调用人员批量录入时发生异常错误,请查看日志!\"}";
- }
- }
- #endregion
- #region 工具上传
- public ActionResult toolupload()
- {
- return View();
- }
- //上传操作
- [HttpPost]
- public string tool()
- {
- var files = this.Request.Files;
- if (this.Request.Files.Count > 0)
- {
- using (BinaryReader br = new BinaryReader(files[0].InputStream))
- {
- byte[] byteData = br.ReadBytes((int)files[0].InputStream.Length);
- var uploadFile = files[0];
- var fileName = uploadFile.FileName;
- var fileLen = uploadFile.ContentLength;
- var fileType = uploadFile.ContentType;
- string _tp = System.IO.Path.GetExtension(fileName);
- var r = UploadFile(byteData, fileName, fileType);
- }
- }
- return "1";
- }
- #endregion
- #region 附件上传/下载/删除
- //项目上传附件
- [HttpPost]
- public ActionResult FileUpload()
- {
- var result = false;
- var files = this.Request.Files;
- if (this.Request.Files.Count > 0)
- {
- using (BinaryReader br = new BinaryReader(files[0].InputStream))
- {
- byte[] byteData = br.ReadBytes((int)files[0].InputStream.Length);
- var uploadFile = files[0];
- var fileName = uploadFile.FileName;
- var fileLen = uploadFile.ContentLength;
- var fileType = uploadFile.ContentType;
- string _tp = System.IO.Path.GetExtension(fileName);
- var r = UploadFile(byteData, fileName, fileType);
- if (r.code == 100)
- {
- ///数据库存储附件ID
- result = ProModule.FileUpload(Session["project"].ToString(), r.data, GetCurrentUser().Name, fileType, Session["identifyID"]==null?"":Session["identifyID"].ToString(), Session["interfaceID"] == null ? "" : Session["interfaceID"].ToString());
- Session["identifyID"] = null;
- Session["interfaceID"] = null;
- }
- }
- }
- return Content(new PmsJsonResoult(result).ToString(), "application/json");
- }
-
- //获取项目附件
- [HttpPost]
- public ActionResult Attachment(string id, string type)
- {
- DataTable dt = ProModule.GetAttachment(id, type);
- List<FTPFileModel> list = new List<FTPFileModel>();
- for (int i = 0; i < dt.Rows.Count; i++)
- {
- var filetype = (dt.Rows[i]["类型"].ToString() == "image/png" || dt.Rows[i]["类型"].ToString() == "image/jpeg") ? 1 : 0;
- var ID = dt.Rows[i]["附件ID"].ToString();
- FtpDownloadResult model = DownloadFileBase64(ID, "o");
- FTPFileModel ftpmodel = new FTPFileModel();
- if (model != null)
- {
- ftpmodel.id = ID;
- ftpmodel.format = model.format;
- ftpmodel.fileName = model.fileName;
- ftpmodel.base64 = model.base64;
- ftpmodel.type = filetype;
- list.Add(ftpmodel);
- }
- }
- return Content(Strings.ObjectToJson(list), "application/json");
- }
- //删除项目附件
- [HttpPost]
- public int Delete_Attachment(string id)
- {
- return ProModule.Delete_Img(id);
- }
- #endregion
- #region 远程方式
- /// <summary>
- /// 根据项目ID获取远程方式
- /// </summary>
- /// <param name="id"></param>
- /// <returns></returns>
- [HttpPost]
- public ActionResult BingRemote(string id)
- {
- string json = ProModule.BingRemote(id);
- return Content(json, "application/json");
- }
- /// <summary>
- /// 弹窗
- /// </summary>
- /// <param name="id"></param>
- /// <returns></returns>
- public ActionResult Remote_Window(string id, int type)
- {
- ViewBag.type = type;
- ViewBag.id = id;
- return View();
- }
- /// <summary>
- /// 添加
- /// </summary>
- /// <returns></returns>
- [HttpPost]
- public int Add_Remote(RemoteBusinessModel model)
- {
- return ProModule.Add_Remote(model);
- }
- /// <summary>
- /// 编辑
- /// </summary>
- /// <returns></returns>
- [HttpPost]
- public int Edit_Remote(RemoteBusinessModel model)
- {
- return ProModule.Edit_Remote(model);
- }
- /// <summary>
- /// 删除
- /// </summary>
- /// <returns></returns>
- [HttpPost]
- public bool Del_Remote(RemoteBusinessModel model)
- {
- return ProModule.Del_Remote(model) != 0;
- }
- #endregion
- #region 个性化修改
- /// <summary>
- /// 根据项目ID获取个性化修改
- /// </summary>
- /// <param name="id"></param>
- /// <returns></returns>
- [HttpPost]
- public ActionResult BingIdentify(string id)
- {
- string json = ProModule.BingIdentify(id);
- return Content(json, "application/json");
- }
- /// <summary>
- /// 编辑获取数据
- /// </summary>
- /// <param name="id"></param>
- /// <returns></returns>
- public ActionResult GetDataById(string id)
- {
- return Content(ProModule.GetDataById(id), "application/json");
- }
- /// <summary>
- /// 弹窗
- /// </summary>
- /// <param name="id"></param>
- /// <returns></returns>
- public ActionResult Identify_Window(string id, int type)
- {
- ViewBag.type = type;
- ViewBag.id = id;
- return View();
- }
- /// <summary>
- /// 添加
- /// </summary>
- /// <returns></returns>
- [HttpPost]
- public string Add_Identify(Identify_Model model)
- {
- model.XGSM = HttpUtility.UrlDecode(model.XGSM);
- var result = ProModule.Add_Identify(model);
- if (result.Length == 36)
- {
- Session["identifyID"] = result;
- Session["project"] = model.XMID;
- }
- else
- {
- Session["identifyID"] = "null";
- }
- return result;
- }
- /// <summary>
- /// 编辑
- /// </summary>
- /// <returns></returns>
- [HttpPost]
- public string Edit_Identify(Identify_Model model)
- {
- model.XGSM =HttpUtility.UrlDecode( model.XGSM);
- var result = ProModule.Edit_Identify(model);
- if (result.Length == 36) {
- Session["identifyID"] = result;
- Session["project"] = model.XMID;
- }
- else
- {
- Session["identifyID"] = "null";
- }
- return result;
- }
- /// <summary>
- /// 删除
- /// </summary>
- /// <returns></returns>
- [HttpPost]
- public int Del_Identify(string id, string type)
- {
- if (type == "1")
- {
- return ProModule.Del_Identify(id);
- }
- else
- {
- return ProModule.Giveup_Identify(id);
- }
- }
- #endregion
- #region 验收仪器
- /// <summary>
- /// 根据项目ID获取验收仪器
- /// </summary>
- /// <param name="id"></param>
- /// <returns></returns>
- [HttpPost]
- public ActionResult Binginstrument(string id)
- {
- string json = ProModule.Binginstrument(id);
- return Content(json, "application/json");
- }
- /// <summary>
- /// 添加验收仪器的弹窗
- /// </summary>
- /// <param name="id"></param>
- /// <returns></returns>
- public ActionResult Instrument_Window(string id)
- {
- ViewBag.id = id;
- return View();
- }
- /// <summary>
- /// 添加验收仪器
- /// </summary>
- /// <returns></returns>
- [HttpPost]
- public int Add_instrument(CheckinstrumentBusinessModel model)
- {
- return ProModule.Add_instrument(model);
- }
- /// <summary>
- /// 删除验收仪器
- /// </summary>
- /// <returns></returns>
- [HttpPost]
- public int Del_instrument(string id)
- {
- return ProModule.Del_instrument(id);
- }
- #endregion
- #region 验收模块
- /// <summary>
- /// 根据项目ID获取验收模块
- /// </summary>
- /// <param name="id"></param>
- /// <returns></returns>
- [HttpPost]
- public ActionResult Bingmodual(string id)
- {
- string json = ProModule.Bingmodual(id);
- return Content(json, "application/json");
- }
- /// <summary>
- /// 添加验收模块的弹窗
- /// </summary>
- /// <param name="id"></param>
- /// <returns></returns>
- public ActionResult Modual_Window(string id)
- {
- ViewBag.id = id;
- return View();
- }
- /// <summary>
- /// 添加验收模块
- /// </summary>
- /// <returns></returns>
- [HttpPost]
- public int Add_modual(CheckModualBusinessModel model)
- {
- return ProModule.Add_modual(model);
- }
- /// <summary>
- /// 删除验收模块
- /// </summary>
- /// <returns></returns>
- [HttpPost]
- public int Del_modual(string id)
- {
- return ProModule.Del_modual(id);
- }
- #endregion
- #region 接口信息
- #region 渠道
- /// <summary>
- /// 根据项目ID获取接口信息
- /// </summary>
- /// <param name="id"></param>
- /// <returns></returns>
- [HttpPost]
- public ActionResult BingInterface(GlobalInte req)
- {
- string json = ProModule.BingInterface(req);
- return Content(json, "application/json");
- }
- /// <summary>
- /// 添加接口信息的弹窗
- /// </summary>
- /// <param name="id"></param>
- /// <returns></returns>
- public ActionResult Interface_Window(string id, int type, string state)
- {
- ViewBag.type = type;
- ViewBag.id = id;
- ViewBag.state = state;
- return View();
- }
- /// <summary>
- /// 添加接口信息
- /// </summary>
- /// <returns></returns>
- [HttpPost]
- public int Add_Interface(InterfaceBusinessModel model)
- {
- model.ID = Guid.NewGuid().ToString();
- var result=ProModule.Add_Interface(model,GetCurrentUser().PersonID);
- if(result==1)
- {
- Session["project"] = model.XMID;
- Session["interfaceID"] = model.ID;
- }
- return result;
- }
- /// <summary>
- /// 编辑接口信息
- /// </summary>
- /// <returns></returns>
- [HttpPost]
- public int Edit_Interface(InterfaceBusinessModel model)
- {
- var result = ProModule.Edit_Interface(model);
- if (result == 1)
- {
- Session["project"] = model.XMID;
- Session["interfaceID"] = model.ID;
- }
- return result;
- }
- /// <summary>
- /// 删除接口信息
- /// </summary>
- /// <returns></returns>
- [HttpPost]
- public int Del_Interface(string id)
- {
- return ProModule.Del_Interface(id);
- }
- /// <summary>
- /// 根据ID获取接口信息
- /// </summary>
- /// <param name="id"></param>
- /// <returns></returns>
- [HttpPost]
- public ActionResult GetInterface(string id)
- {
- string json = ProModule.GetInterface(id).ToJson();
- return Content(json, "application/json");
- }
- #endregion
- #region 总部
- public ActionResult GolbalInte()
- {
- ViewBag.userInfo = GetCurrentUser().PersonProperty;
- return View();
- }
- /// <summary>
- /// 添加接口信息的弹窗
- /// </summary>
- /// <param name="id"></param>
- /// <returns></returns>
- public ActionResult GlobalInteWindow(int type, string id, string state)
- {
- ViewBag.type = type;
- ViewBag.state = state;
- ViewBag.id = id;
- return View();
- }
- /// <summary>
- /// 变更接口状态的弹窗
- /// </summary>
- /// <param name="id"></param>
- /// <returns></returns>
- public ActionResult DealWindow(string id)
- {
- ViewBag.id = id;
- return View();
- }
- /// <summary>
- /// 根据ID获取接口过程
- /// </summary>
- /// <param name="id"></param>
- /// <returns></returns>
- [HttpPost]
- public int DealInte(InterfaceBusinessModel model)
- {
- var result = ProModule.DealInte(model, GetCurrentUser().PersonID);
- if (result == 1)
- {
- Session["project"] = model.XMID;
- Session["interfaceID"] = model.ID;
- }
- return result;
- }
- /// <summary>
- /// 根据ID获取接口过程
- /// </summary>
- /// <param name="id"></param>
- /// <returns></returns>
- [HttpPost]
- public ActionResult GetInteProcess(string id)
- {
- string json = ProModule.GetInteProcess(id);
- return Content(json, "application/json");
- }
-
- /// <summary>
- /// 获取性质除了客户的人员信息
- /// </summary>
- /// <param name="id"></param>
- /// <returns></returns>
- public ActionResult GetinfoBynature(int type)
- {
- string json = ProModule.GetinfoBynature(type);
- return Content(json, "application/json");
- }
- #endregion
- #endregion
- #region 查询字典表
- /// <summary>
- /// 查询字典表
- /// </summary>
- /// <param name="ID"></param>
- /// <returns></returns>
- public ActionResult SelectNature(string ID)
- {
- var list = account_obj.SelectNature(ID);
- var json = Strings.ObjectToJson(list);
- return Content(json, "application/json");
- }
- #endregion
- #region 迁移机构数据变成项目
- /// <summary>
- /// 迁移渠道项目【将机构变成项目】
- /// </summary>
- /// <param name="ProjectID">项目ID</param>
- /// <param name="SiteID">机构ID</param>
- /// <returns></returns>
- public ActionResult MigrationOrganization(string ProjectID, string SiteID)
- {
- var msg = "";
- var state = ProModule.MigrationOrganization( ProjectID, SiteID, GetCurrentUser(), out msg);
- return Content(new PmsJsonResoult(true, msg, null).ToString(), "text/json");
- }
- #endregion
- }
- }
|