ProblemController.cs 70 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Data;
  4. using System.Dynamic;
  5. using System.IO;
  6. using System.Web;
  7. using System.Web.Mvc;
  8. using PMS.BusinessModels;
  9. using PMS.BusinessModels.Account;
  10. using PMS.BusinessModels.ComplaintManage;
  11. using PMS.BusinessModels.Problem;
  12. using PMS.EntityModels.Product;
  13. using PMS.Interface;
  14. using PMS.Interface.PresonManager;
  15. using PMS.Interface.Problems;
  16. using PMS.Interface.Product;
  17. using PMS.Interface.ProManager;
  18. using PMS.Interface.WorkFlow;
  19. using QWPlatform.SystemLibrary;
  20. using QWPlatform.SystemLibrary.LogManager;
  21. using QWPlatform.SystemLibrary.Utils;
  22. using PMS.Interface.Support;
  23. using System.Threading.Tasks;
  24. using System.Text;
  25. using System.Web.Services.Description;
  26. using System.Security.Cryptography;
  27. using System.Runtime.Serialization.Formatters.Binary;
  28. using System.Xml;
  29. using Newtonsoft.Json.Linq;
  30. using Newtonsoft.Json;
  31. using System.Web.Script.Serialization;
  32. using PMS.EntityModels.ProManager;
  33. using PMS.EntityModels.Problem;
  34. using PMS.Interface.MessageManage;
  35. using PMS.BusinessModels.SMS;
  36. using System.Text.RegularExpressions;
  37. using PMS.Plugins.Common;
  38. using System.Linq;
  39. using static System.Net.WebRequestMethods;
  40. using PMS.Plugins.AliFileUpload;
  41. using PMS.BusinessModels.MobileProblem;
  42. namespace PMS.WebUI.Controllers
  43. {
  44. /// <summary>
  45. /// 创 建 人:王海洋
  46. /// 创建日期:2018-12-24
  47. /// 功能描述:问题管理控制器
  48. /// </summary>
  49. public class ProblemController : BaseController
  50. {
  51. #region 接口实例
  52. ICPWTJLModel CPWTJL_obj = InterfaceFactory.CreateBusinessInstance<ICPWTJLModel>();
  53. IZDYCXModel ZDYCX_obj = InterfaceFactory.CreateBusinessInstance<IZDYCXModel>();
  54. IProModule ProModule = InterfaceFactory.CreateBusinessInstance<IProModule>();
  55. IZDYCXModel ZdycxModel = InterfaceFactory.CreateBusinessInstance<IZDYCXModel>();
  56. ICPWTGCModel ZpwtgcModel = InterfaceFactory.CreateBusinessInstance<ICPWTGCModel>();
  57. IPersonModule PersonModule = InterfaceFactory.CreateBusinessInstance<IPersonModule>();
  58. IWorkFlow WorkFlowModule = InterfaceFactory.CreateBusinessInstance<IWorkFlow>();
  59. IWTJLGCModel WtJlGcModule = InterfaceFactory.CreateBusinessInstance<IWTJLGCModel>();
  60. IWTJLModel WTJL_obj = InterfaceFactory.CreateBusinessInstance<IWTJLModel>();
  61. IWTGTGCModel WTGTG_obj = InterfaceFactory.CreateBusinessInstance<IWTGTGCModel>();
  62. ISupport support = InterfaceFactory.CreateBusinessInstance<ISupport>();
  63. IProduct product = InterfaceFactory.CreateBusinessInstance<IProduct>();
  64. IReport IReport = InterfaceFactory.CreateBusinessInstance<IReport>();
  65. //项目问题管理
  66. IProjectProblems projectProblems = InterfaceFactory.CreateBusinessInstance<IProjectProblems>();
  67. //推送消息
  68. IMessageManage notice = InterfaceFactory.CreateBusinessInstance<IMessageManage>();
  69. #endregion 公共方法
  70. #region 公共方法
  71. //获取基础编码
  72. public ActionResult GetBaseCode(string type)
  73. {
  74. return Content(CPWTJL_obj.GetBaseCode(type), "text/json");
  75. }
  76. /// <summary>
  77. /// 日期计算方法
  78. /// </summary>
  79. /// <param type="type">1.一周 2.两周 3.一个月 4.两个月 5.三个月 6.半年</param>
  80. /// <returns></returns>
  81. [HttpPost]
  82. public ActionResult GetDateRange(int type)
  83. {
  84. var jss = new JavaScriptSerializer();
  85. var Sdate = "";
  86. var Edate = "";
  87. try
  88. {
  89. switch (type)
  90. {
  91. case 1: Sdate = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd")).ToString("yyyy-MM-dd"); Edate = DateTime.Parse(DateTime.Now.AddDays(7).ToString("yyyy-MM-dd")).ToString("yyyy-MM-dd"); break;
  92. case 2: Sdate = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd")).ToString("yyyy-MM-dd"); Edate = DateTime.Parse(DateTime.Now.AddDays(14).ToString("yyyy-MM-dd")).ToString("yyyy-MM-dd"); break;
  93. case 3: Sdate = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd")).ToString("yyyy-MM-dd"); Edate = DateTime.Parse(DateTime.Now.AddDays(30).ToString("yyyy-MM-dd")).ToString("yyyy-MM-dd"); break;
  94. case 4: Sdate = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd")).ToString("yyyy-MM-dd"); Edate = DateTime.Parse(DateTime.Now.AddDays(60).ToString("yyyy-MM-dd")).ToString("yyyy-MM-dd"); break;
  95. case 5: Sdate = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd")).ToString("yyyy-MM-dd"); Edate = DateTime.Parse(DateTime.Now.AddDays(90).ToString("yyyy-MM-dd")).ToString("yyyy-MM-dd"); break;
  96. case 6: Sdate = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd")).ToString("yyyy-MM-dd"); Edate = DateTime.Parse(DateTime.Now.AddDays(180).ToString("yyyy-MM-dd")).ToString("yyyy-MM-dd"); break;
  97. }
  98. var obj = new { state = true, Sdate, Edate };
  99. return Content(jss.Serialize(obj), "application/json");
  100. }
  101. catch (Exception ex)
  102. {
  103. Logger.Instance.Error("调用GetDateRange时发生异常错误", ex);
  104. return Content(jss.Serialize(new { state = false, Sdate, Edate }), "application/json"); ;
  105. }
  106. }
  107. #endregion
  108. #region 信息查询
  109. //获取所有迭代
  110. public ActionResult GetLterationList()
  111. {
  112. return Content(CPWTJL_obj.GetLterationList(), "applciation/json");
  113. }
  114. //获取所有获取反馈人
  115. [HttpPost]
  116. public ActionResult GetFKR(string id)
  117. {
  118. var json = CPWTJL_obj.GetFKR(id,base.GetCurrentUser().CompanyID);//渠道ID
  119. return Content(json, "application/json");
  120. }
  121. //根据项目ID获取产品信息
  122. public string GetProductByID(string id)
  123. {
  124. return CPWTJL_obj.GetProductByID(id);
  125. }
  126. //获取关注的产品信息
  127. [HttpPost]
  128. public ActionResult GetMyConfig(string id)
  129. {
  130. var myconfig = base.GetMyConfigInfo()?.ProductID; /*ModuleID*/
  131. if (myconfig != null)
  132. {
  133. return Content(CPWTJL_obj.GetMyConfig(myconfig, id), "application/json");
  134. }
  135. return null;
  136. }
  137. //获取关注的模块信息
  138. [HttpPost]
  139. public ActionResult GetMyConfigModual(string id)
  140. {
  141. var myconfig = base.GetMyConfigInfo()?.ModuleID;
  142. if (myconfig != null)
  143. {
  144. return Content(CPWTJL_obj.GetMyConfigModual(myconfig, id), "application/json");
  145. }
  146. return null;
  147. }
  148. //我的关注产品和模块
  149. [HttpPost]
  150. public ActionResult GetMyConfigAll()
  151. {
  152. JavaScriptSerializer javaScriptSerializer = new JavaScriptSerializer();
  153. return base.Content(javaScriptSerializer.Serialize(base.GetMyConfigInfo()), "application/json");
  154. }
  155. //根据产品ID获取产品模块
  156. public ActionResult GetModualByCPID(string id)
  157. {
  158. string json = CPWTJL_obj.GetModualByCPID(id);
  159. return Content(json, "application/json");
  160. }
  161. //模块的树形结构
  162. public string getmk(string id)
  163. {
  164. string domDetailObj = Newtonsoft.Json.JsonConvert.DeserializeObject(CPWTJL_obj.getmk(id)).ToString(); //转换为动态JSON类型
  165. return domDetailObj;
  166. }
  167. //项目产品模块信息
  168. public ActionResult SelectProjectModualInfo(string id)
  169. {
  170. string json = CPWTJL_obj.SelectProjectModualInfo(id);
  171. return Content(json, "application/json");
  172. }
  173. //获取权限获取渠道
  174. public ActionResult GetChannelByAuth()
  175. {
  176. string json = ProModule.GetAll_Channel(GetAuthDats().Channel);
  177. return Content(json, "application/json");
  178. }
  179. //根据项目获取对应的渠道
  180. public ActionResult GetChannelByInfo(string id)
  181. {
  182. string json = CPWTJL_obj.GetChannelByInfo(id);
  183. return Content(json, "application/json");
  184. }
  185. //根据登录人员信息获取对应的项目
  186. public ActionResult GetProjectByInfo()
  187. {
  188. var user = GetCurrentUser();
  189. string json = CPWTJL_obj.GetProjectByInfo(user);
  190. return Content(json, "application/json");
  191. }
  192. //根据项目获取对应的机构
  193. public ActionResult GetStationByID(string id)
  194. {
  195. string json = CPWTJL_obj.GetStationByID(id);
  196. return Content(json, "application/json");
  197. }
  198. //获取问题紧急程度
  199. public ActionResult GetEmergencylevel()
  200. {
  201. string json = CPWTJL_obj.GetEmergencylevel();
  202. return Content(json, "application/json");
  203. }
  204. //根据登录人员获取人员性质
  205. public int GetFeedbackID()
  206. {
  207. var user = GetCurrentUser();
  208. return user.PersonProperty;
  209. }
  210. //获取总部人员
  211. public ActionResult GetUserInfoByChannelId()
  212. {
  213. UserInfo currentUser = base.GetCurrentUser();
  214. return base.Content(this.CPWTJL_obj.GetUserInfoByChannelId(), "application/json");
  215. }
  216. //根据登录人员获取人员信息
  217. [HttpPost]
  218. public ActionResult GetUserInfo()
  219. {
  220. var user = GetCurrentUser();
  221. return Content(CPWTJL_obj.GetUserInfo(user), "application/json");
  222. }
  223. //根据登录人员ID获取人员信息
  224. public ActionResult GetPersonInfoByID(string PersonID)
  225. {
  226. var user = GetCurrentUser();
  227. string json = CPWTJL_obj.GetPersonInfoByID(user.PersonID);
  228. return Content(json, "application/json");
  229. }
  230. //获取唯一问题序列编号
  231. public ActionResult GetSequence()
  232. {
  233. string json = CPWTJL_obj.GetSequence();
  234. return Content(json, "application/json");
  235. }
  236. //获取问题来源
  237. public ActionResult GetProblemSource()
  238. {
  239. var user = GetCurrentUser();
  240. var json = CPWTJL_obj.GetProblemSource(user.PersonProperty);
  241. return Content(json, "application/json");
  242. }
  243. //问题性质
  244. public ActionResult GetProblemNature()
  245. {
  246. var user = GetCurrentUser();
  247. var json = CPWTJL_obj.GetProblemNature(user.PersonProperty);
  248. return Content(json, "application/json");
  249. }
  250. //根据渠道ID获取项目ID
  251. public ActionResult GetProjectByChannelID(string id)
  252. {
  253. string result = CPWTJL_obj.QdXm(id);
  254. return Content(result, "application/json");
  255. }
  256. //获取所有模块
  257. public ActionResult GetAllModual()
  258. {
  259. return Content(CPWTJL_obj.GetAllModual(), "application/json");
  260. }
  261. //获取问题主流程
  262. public ActionResult GetMainProcess(string id)
  263. {
  264. var json = projectProblems.GetMainProcess(id);
  265. return Content(json, "application/json");
  266. }
  267. #endregion
  268. #region 问题记录得显示及自定义查询
  269. //GET: 项目问题管理页面
  270. public ActionResult ProjectIndex(int page = 0, int rows = 0)
  271. {
  272. var UserInfo = GetCurrentUser();
  273. ViewBag.UserID = UserInfo.PersonID;
  274. ViewBag.RYXZ = UserInfo.PersonProperty;
  275. return View();
  276. }
  277. /// <summary>
  278. /// 自定义查询方案查询
  279. /// </summary>
  280. /// <returns></returns>
  281. public ActionResult ProjectZdyCx()
  282. {
  283. var UserInfo = GetCurrentUser();
  284. string result = ZDYCX_obj.ProjectZdyCx(UserInfo.ID);
  285. return Content(result, "application/json");
  286. }
  287. /// <summary>
  288. /// 根据自定义方案得条件查询数据
  289. /// </summary>
  290. /// <returns></returns>
  291. [HttpPost]
  292. public ActionResult ProjectZdyCxInfo(WTJLModel model, int page = 0, int rows = 0)
  293. {
  294. string result;
  295. if (model.satate == true)
  296. {
  297. var UserInfo = GetCurrentUser();
  298. model.DJRID = UserInfo.PersonID;
  299. }
  300. ///125(渠道)3客户人员(自己登记的问题)4医院管理员(自己机构(站点信息))
  301. if (model.RYXZ == 1 || model.RYXZ == 2 || model.RYXZ == 5)
  302. {
  303. result = WTJL_obj.ProjectZdyCxInfoQKW(GetAuthDats().Channel, page, rows);
  304. }
  305. else if (model.RYXZ == 3)
  306. {
  307. var UserInfo = GetCurrentUser();
  308. model.DJRID = UserInfo.PersonID;
  309. result = WTJL_obj.ProjectZdyCxInfoKh(model.DJRID, page, rows);
  310. }
  311. else if (model.RYXZ == 4)
  312. {
  313. var UserInfo = GetCurrentUser();
  314. model.DJRID = UserInfo.PersonID;
  315. result = WTJL_obj.ProjectZdyCxZd(model.DJRID, page, rows);
  316. }
  317. else
  318. {
  319. result = WTJL_obj.ProjectZdyCxInfo(model, page, rows);
  320. }
  321. return Content(result, "application/json");
  322. }
  323. //查询问题目录
  324. public ActionResult QueryProblems(QueryModel model, string sort = "编号", string order = "desc", int page = 1, int rows = 20)
  325. {
  326. model.page = page;
  327. model.rows = rows;
  328. model.sort = sort;
  329. model.order = order;
  330. // 选择的字段
  331. var text = TempData["arry"];
  332. if (text != null)
  333. {
  334. model.text = text.ToString();
  335. }
  336. // 是否勾选之查看已解决按钮
  337. var state = TempData["state"];
  338. if (state != null)
  339. {
  340. model.isend = Convert.ToBoolean(state);
  341. }
  342. var userInfo = GetCurrentUser();
  343. //获取当前登录人员ID
  344. model.currentUserID = userInfo?.PersonID;
  345. model.currentUserProperty = userInfo.PersonProperty;
  346. var json = projectProblems.GetProjectListDataGridJson(model);
  347. return Content(json, "text/json");
  348. }
  349. public ActionResult QueryProblemsV2(QueryModel model, string sort = "编号", string order = "desc", int page = 1, int rows = 20)
  350. {
  351. model.page = page;
  352. model.rows = rows;
  353. model.sort = sort;
  354. model.order = order;
  355. // 选择的字段
  356. var text = TempData["arry"];
  357. if (text != null)
  358. {
  359. model.text = text.ToString();
  360. }
  361. // 是否勾选之查看已解决按钮
  362. var state = TempData["state"];
  363. if (state != null)
  364. {
  365. model.isend = Convert.ToBoolean(state);
  366. }
  367. var userInfo = GetCurrentUser();
  368. //获取当前登录人员ID
  369. model.currentUserID = userInfo?.PersonID;
  370. model.currentUserProperty = userInfo.PersonProperty;
  371. var json = projectProblems.GetProjectListDataGridJsonV2(model);
  372. return Content(json, "text/json");
  373. }
  374. //重复问题列表所用的数据
  375. public ActionResult AllProList()
  376. {
  377. return Content(projectProblems.AllProList(GetCurrentUser()), "text/json");
  378. }
  379. /// <summary>
  380. /// 分布视图
  381. /// </summary>
  382. /// <returns></returns>
  383. public PartialViewResult Partial()
  384. {
  385. return base.PartialView();
  386. }
  387. /// <summary>
  388. /// 获取渠道信息
  389. /// </summary>
  390. /// <returns></returns>
  391. public ActionResult QDinfo()
  392. {
  393. //string result = WTJL_obj.GETQDinfo(this.GetAuthDats().Channel);
  394. var user = this.GetCurrentUser();
  395. string result = WTJL_obj.GetChanels(user.PersonProperty, user.CompanyID);
  396. return Content(result, "application/json");
  397. }
  398. /// <summary>
  399. /// 获取性质信息
  400. /// </summary>
  401. /// <returns></returns>
  402. public ActionResult XZinfo()
  403. {
  404. string result = WTJL_obj.GETXZinfo();
  405. return Content(result, "application/json");
  406. }
  407. /// <summary>
  408. /// 获取紧急程度信息
  409. /// </summary>
  410. /// <returns></returns>
  411. public ActionResult JJCDinfo()
  412. {
  413. string result = WTJL_obj.GETJJCDinfo();
  414. return Content(result, "application/json");
  415. }
  416. /// <summary>
  417. /// 获取研发人员
  418. /// </summary>
  419. /// <returns></returns>
  420. public ActionResult GetAssignPerson()
  421. {
  422. return Content(CPWTJL_obj.GetAssignPerson(), "application/json");
  423. }
  424. public ActionResult LCHJ()
  425. {
  426. return Content(WTJL_obj.LCHJ(), "application/json");
  427. }
  428. /// <summary>
  429. /// 渠道所属项目查询
  430. /// </summary>
  431. /// <param name="QdID"></param>
  432. /// <returns></returns>
  433. public ActionResult QdXm(string QdID)
  434. {
  435. string result = WTJL_obj.QdXm(QdID);
  436. return Content(result, "application/json");
  437. }
  438. /// <summary>
  439. /// 获取项目机构
  440. /// </summary>
  441. /// <param name="JgID"></param>
  442. /// <returns></returns>
  443. public ActionResult XmJg(string JgID)
  444. {
  445. string result = CPWTJL_obj.XmJgs(JgID);
  446. return Content(result, "application/json");
  447. }
  448. /// <summary>
  449. /// 获取项目产品
  450. /// </summary>
  451. /// <param name="XmID"></param>
  452. /// <returns></returns>
  453. public ActionResult XmCp(string XmID)
  454. {
  455. string result = WTJL_obj.XmCp(XmID);
  456. return Content(result, "application/json");
  457. }
  458. /// <summary>
  459. /// 快速查询
  460. /// </summary>
  461. /// <param name="KsCx">快速查询</param>
  462. /// <returns></returns>
  463. public ActionResult KsSelect(string KsCx)
  464. {
  465. int page = 1, rows = 10, total = 0;
  466. return Content(WTJL_obj.KsSelect(KsCx, page, rows, total), "application/json");
  467. }
  468. /// <summary>
  469. /// 获取产品问题过程处理流程
  470. /// </summary>
  471. /// <returns></returns>
  472. public ActionResult GetClc(string ID)
  473. {
  474. return Content(WtJlGcModule.GetClc(ID), "application/json");
  475. }
  476. /// <summary>
  477. /// 获取产品问题过程沟通需要的信息
  478. /// </summary>
  479. /// <param name="ID"></param>
  480. /// <returns></returns>
  481. public ActionResult GetCommunicates(string ID)
  482. {
  483. return Content(WTGTG_obj.GetCommunicates(ID), "application/json");
  484. }
  485. public ActionResult SubmitContent(WTGTGCModel model)
  486. {
  487. model.JLSJ = DateTime.Now;
  488. var UserInfo = GetCurrentUser();
  489. model.JLRID = UserInfo.PersonID;
  490. string result = WTGTG_obj.SubmitContent(model);
  491. string[] results = result.Split('|');
  492. if (results[0] == "1")
  493. {
  494. return this.ResponseJson(System.Net.HttpStatusCode.OK, "保存成功");
  495. }
  496. return this.ResponseJson(System.Net.HttpStatusCode.InternalServerError, "保存失败");
  497. }
  498. /// <summary>
  499. /// 判断是否卫计委审核可以处理问题(待测试) ///12 5(卫计委管理员 卫计委信息科管理员)3客户人员(自己登记的问题)4医院管理员(自己机构(站点信息))
  500. /// ?处理问题时 医院管理原 机构内处理 卫计委 卫计委处理 客户只能看不能处理
  501. /// </summary>
  502. /// <param name="id"></param>
  503. /// <returns></returns>
  504. public string SfSh(string id)
  505. {
  506. var user = GetCurrentUser();
  507. var UserProperty = user.PersonProperty;
  508. string result = "1";
  509. if (UserProperty == 5)
  510. {
  511. ///是否卫计委可以处理
  512. result = CPWTJL_obj.SfShWjW(user.PersonID);
  513. }
  514. else if (UserProperty == 4)
  515. {
  516. //判断是否机构内审核可以处理问题
  517. result = CPWTJL_obj.SfSh(user.PersonID);
  518. }
  519. else if (UserProperty == 3 || UserProperty == 1)
  520. {
  521. //客户,本部人员只能看不能处理
  522. result = "2";
  523. }
  524. return result;
  525. }
  526. /// <summary>
  527. /// 问题确认
  528. /// </summary>
  529. /// <param name="id"></param>
  530. /// <returns></returns>
  531. public ActionResult WtQr(string id)
  532. {
  533. // 确认类型1 ,2本部,渠道(3 项目人员确认)
  534. //4 医院管理员(1机构确认) 5 卫计委管理员(2:卫计委确认)
  535. //4:技术支持确认 5:研发人员确认
  536. var user = GetCurrentUser();
  537. string JlrID = user.PersonID;
  538. DateTime Jlsj = DateTime.Now;
  539. int Qrlx = 0;
  540. if (user.PersonProperty == 2)
  541. {
  542. //项目人员确认
  543. Qrlx = 3;
  544. }
  545. else if (user.PersonProperty == 4)
  546. {
  547. //机构确认
  548. Qrlx = 1;
  549. }
  550. else if (user.PersonProperty == 5)
  551. {
  552. //卫计委确认
  553. Qrlx = 2;
  554. }
  555. string result = CPWTJL_obj.WtQr(id, JlrID, Jlsj, Qrlx);
  556. string[] results = result.Split('|');
  557. if (results[0] == "1")
  558. {
  559. return this.ResponseJson(System.Net.HttpStatusCode.OK, result[1].ToString());
  560. }
  561. else
  562. {
  563. return this.ResponseJson(System.Net.HttpStatusCode.InternalServerError, result[1].ToString());
  564. }
  565. }
  566. /// <summary>
  567. /// 查看问题
  568. /// </summary>
  569. /// <param name="id"></param>
  570. /// <param name="BT"></param>
  571. /// <returns></returns>
  572. public ActionResult WtCk(string id, string BT)
  573. {
  574. ViewBag.Event = BT;
  575. ViewBag.id = id;
  576. return View();
  577. }
  578. /// <summary>
  579. ///查看问题详情
  580. /// </summary>
  581. /// <param name="id"></param>
  582. /// <returns></returns>
  583. public ActionResult Wtdetail(string id)
  584. {
  585. return Content(CPWTJL_obj.Wtdetail(id), "application/json");
  586. }
  587. /// <summary>
  588. ///当前问题处理状态
  589. /// </summary>
  590. /// <param name="id"></param>
  591. /// <returns></returns>
  592. public ActionResult DealProblem(string WTid)
  593. {
  594. var user = GetCurrentUser();
  595. string result = WTJL_obj.DealProblem(WTid, user.PersonProperty.ToString());
  596. return Content(result);
  597. }
  598. /// <summary>
  599. /// 判断问题是否被终止或者被解决
  600. /// </summary>
  601. /// <param name="id"></param>
  602. /// <returns></returns>
  603. public ActionResult SfZz(string id)
  604. {
  605. string result = CPWTJL_obj.SfZz(id);
  606. return Content(result);
  607. }
  608. /// <summary>
  609. /// 产品问题处理人
  610. /// </summary>
  611. /// <returns></returns>
  612. public ActionResult ProductionPdealR()
  613. {
  614. var UserInfo = GetCurrentUser();
  615. var t = UserInfo.AuthDats;
  616. string json = PersonModule.GetPerson(t);
  617. return Content(json, "application/json");
  618. }
  619. /// <summary>
  620. /// 处理问题弹出层
  621. /// </summary>
  622. /// <returns></returns>
  623. public ActionResult PopWindows()
  624. {
  625. return View();
  626. }
  627. /// <summary>
  628. /// 问题验证
  629. /// </summary>
  630. /// <param name="id"></param>
  631. /// <returns></returns>
  632. public ActionResult AcceptanceWindow(string id)
  633. {
  634. ViewBag.ID = id;
  635. return View();
  636. }
  637. #endregion
  638. #region 登记项目问题
  639. //Get: 登记一个新问题的页面
  640. public ActionResult NewProjectProblem(string id, int type)
  641. {
  642. var UserInfo = GetCurrentUser();
  643. ViewBag.DJRId = UserInfo.PersonID;
  644. ViewBag.RYXZ = UserInfo.PersonProperty;
  645. ViewBag.id = id;
  646. ViewBag.type = type;
  647. return View();
  648. }
  649. //登记操作(id:问题ID)
  650. public string RegisterProblem(string text)
  651. {
  652. //反编码并转换为一个Model对象
  653. ProblemBusinessModel model = Strings.JsonToModel<ProblemBusinessModel>(HttpUtility.UrlDecode(text));
  654. //判断项目的审核流程是否允许用户反馈问题
  655. if (CPWTJL_obj.CheckApprovalProcess(model.QDID, model.XMID, model.JGID))
  656. {
  657. return "-1";
  658. }
  659. if (model.WTMS.Length >= 3000)
  660. {
  661. Logger.Instance.Info("项目问题【"+model.DJR+"】登记的内容过长:" + model.WTMS);
  662. return "-2";
  663. }
  664. string id = Guid.NewGuid().ToString();
  665. Session["ProblemUID"] = id;
  666. var user = GetCurrentUser();
  667. model.QDID = this.CPWTJL_obj.GetChannelByProId(model.XMID).Rows[0]["ID"].ToString();
  668. //登记问题
  669. ProblemStateModel state = CPWTJL_obj.RegisterProblem(model, user, id);
  670. Session["ProblemProcessID"] = state.ProblemProcessID;
  671. //用户登记问题的流程
  672. if (user.PersonProperty == 3|| user.PersonProperty == 4)//客户要求调整医院管理员只能提交到渠道
  673. {
  674. //根据性质ID返回性质代码
  675. DataTable dt = CPWTJL_obj.SelectNature(model.WTXZ);
  676. int Nature = int.Parse(dt.Rows[0]["代码"].ToString());
  677. //获取下一个流程ID
  678. string FlowID = WorkFlowModule.GetNewProblemWorkFlowID(state.CatalogID, user.PersonProperty, Nature).ToString();
  679. //提交问题
  680. int r = CPWTJL_obj.PostProblem(id, FlowID, user, state.ID);
  681. if (r == 0)
  682. {
  683. id = null;
  684. }
  685. return id;
  686. }
  687. //其他角色登记问题的流程
  688. else
  689. {
  690. if (state.Count == 0)
  691. {
  692. id = null;
  693. }
  694. else
  695. {
  696. ///解决的问题不需要推送
  697. if (model.RegisterType != 2)
  698. {
  699. RegistNotify(id);
  700. }
  701. }
  702. return id;
  703. }
  704. }
  705. //指定处理人弹窗
  706. public ActionResult AssignDealWithPerson_Window()
  707. {
  708. return View();
  709. }
  710. //保存处理人
  711. public void SaveAssignDealWithPerson(string id)
  712. {
  713. TempData["AssignID"] = id;
  714. }
  715. #endregion
  716. #region 登记技术支持问题
  717. //Get: 登记一个新问题的页面
  718. public ActionResult NewSupportProblem(string id,string type)
  719. {
  720. var UserInfo = GetCurrentUser();
  721. ViewBag.DJRId = UserInfo.PersonID;
  722. ViewBag.RYXZ = UserInfo.PersonProperty;
  723. ViewBag.type = type;
  724. ViewBag.id = id;
  725. return View();
  726. }
  727. //登记操作(id:问题ID)
  728. public string RegisterSupportProblem(string text)
  729. {
  730. string text2 = Guid.NewGuid().ToString();
  731. base.Session["ProblemUID"] = text2;
  732. ProblemBusinessModel problemBusinessModel = Strings.JsonToModel<ProblemBusinessModel>(HttpUtility.UrlDecode(text));
  733. bool flag = problemBusinessModel.WTMS.Length >= 3000;
  734. string result;
  735. if (flag)
  736. {
  737. Logger.Instance.Info("技术支持【" + problemBusinessModel.DJR + "】登记的内容过长:" + problemBusinessModel.WTMS);
  738. result = "-2";
  739. }
  740. else
  741. {
  742. UserInfo currentUser = base.GetCurrentUser();
  743. string text3 = (base.TempData["AssignID"] == null) ? null : base.TempData["AssignID"].ToString();
  744. problemBusinessModel.QDID = this.CPWTJL_obj.GetChannelByProId(problemBusinessModel.XMID).Rows[0]["ID"].ToString();
  745. ProblemStateModel problemStateModel = this.support.RegisterSupportProblem(problemBusinessModel, currentUser, text2, text3);
  746. base.Session["ProblemProcessID"] = problemStateModel.ProblemProcessID;
  747. bool flag2 = problemStateModel.Count == 0;
  748. if (flag2)
  749. {
  750. text2 = null;
  751. }
  752. else
  753. {
  754. bool flag3 = text3 != null;
  755. if (flag3)
  756. {
  757. this.SitePush(new ProblemProcessModel
  758. {
  759. ProblemID = text2,
  760. SubID = text3,
  761. IsCommit = true
  762. });
  763. }
  764. else
  765. {
  766. bool flag4 = problemBusinessModel.RegisterType != 2;
  767. if (flag4)
  768. {
  769. this.RegistNotify(text2);
  770. }
  771. }
  772. }
  773. result = text2;
  774. }
  775. return result;
  776. }
  777. #endregion
  778. #region 登记产品问题
  779. //Get: 登记一个新问题的页面
  780. public ActionResult NewProductProblem(string id, int type)
  781. {
  782. var UserInfo = GetCurrentUser();
  783. ViewBag.DJRId = UserInfo.PersonID;
  784. ViewBag.RYXZ = UserInfo.PersonProperty;
  785. ViewBag.type = type;
  786. ViewBag.id = id;
  787. return View();
  788. }
  789. //登记操作(id:问题ID)
  790. public string RegisterProductProblem(string text)
  791. {
  792. var ID = Guid.NewGuid().ToString();
  793. Session["ProblemUID"] = ID;
  794. ProblemBusinessModel problemBusinessModel = Strings.JsonToModel<ProblemBusinessModel>(HttpUtility.UrlDecode(text));
  795. if (problemBusinessModel.WTMS.Length >= 3000)
  796. {
  797. Logger.Instance.Info("产品问题【" + problemBusinessModel.DJR + "】登记的内容过长:" + problemBusinessModel.WTMS);
  798. ID = "-2";
  799. }
  800. else
  801. {
  802. UserInfo currentUser = base.GetCurrentUser();
  803. problemBusinessModel.QDID = this.CPWTJL_obj.GetChannelByProId(problemBusinessModel.XMID).Rows[0]["ID"].ToString();
  804. ProblemStateModel problemStateModel = this.product.RegisterProductProblem(problemBusinessModel, currentUser, ID);
  805. Session["ProblemProcessID"] = problemStateModel.ProblemProcessID;
  806. if (problemStateModel.Count == 0)
  807. {
  808. ID = null;
  809. }
  810. else
  811. {
  812. if (problemBusinessModel.RegisterType != 2)
  813. {
  814. this.RegistNotify(ID);
  815. }
  816. }
  817. }
  818. return ID;
  819. }
  820. #endregion
  821. #region 附件上传
  822. //上传附件
  823. [HttpPost]
  824. public ActionResult FileUpload()
  825. {
  826. string ProblemProcessID;
  827. string Problemid = Session["ProblemUID"].ToString();
  828. if (Session["ProblemProcessID"] == null)
  829. {
  830. ProblemProcessID = CPWTJL_obj.GetNewProcessID(Problemid);
  831. }
  832. else
  833. {
  834. ProblemProcessID = Session["ProblemProcessID"].ToString();
  835. }
  836. var result = "0";
  837. var files = this.Request.Files;
  838. if (this.Request.Files.Count > 0)
  839. {
  840. using (BinaryReader br = new BinaryReader(files[0].InputStream))
  841. {
  842. byte[] byteData = br.ReadBytes((int)files[0].InputStream.Length);
  843. var uploadFile = files[0];
  844. var fileName = uploadFile.FileName;
  845. var fileLen = uploadFile.ContentLength;
  846. var fileType = uploadFile.ContentType;
  847. string _tp = System.IO.Path.GetExtension(fileName);
  848. var r = UploadFile(byteData, fileName, fileType);
  849. if (r.code == 100)
  850. {
  851. ///数据库存储附件ID
  852. var Complete = CPWTJL_obj.FileUpload(Problemid, r.data, GetCurrentUser().Name, fileType, ProblemProcessID);
  853. if (Complete)
  854. {
  855. result = Problemid;
  856. }
  857. return Content(new PmsJsonResoult(System.Net.HttpStatusCode.OK, result, null).ToString(), "application/json");
  858. }
  859. }
  860. }
  861. return Content(new PmsJsonResoult(System.Net.HttpStatusCode.Forbidden, result, null).ToString(), "application/json");
  862. }
  863. /// <summary>
  864. /// 智能表单文件上传[旧版本,上传文件到114]
  865. /// </summary>
  866. /// <returns></returns>
  867. [HttpPost]
  868. public ActionResult FormMakingFileUploadOld()
  869. {
  870. var url = "";
  871. var files = this.Request.Files;
  872. if (this.Request.Files.Count > 0)
  873. {
  874. using (BinaryReader br = new BinaryReader(files[0].InputStream))
  875. {
  876. byte[] byteData = br.ReadBytes((int)files[0].InputStream.Length);
  877. var uploadFile = files[0];
  878. var fileName = uploadFile.FileName;
  879. var fileLen = uploadFile.ContentLength;
  880. var fileType = uploadFile.ContentType;
  881. string _tp = System.IO.Path.GetExtension(fileName);
  882. var r = UploadFile(byteData, fileName, fileType);
  883. if (r.code == 100)
  884. {
  885. var data = GetFtpUrl(r.data, "");
  886. if (data.code == 100)
  887. {
  888. var GetFileUrl = System.Configuration.ConfigurationManager.AppSettings["GetFileUrl"];
  889. url= GetFileUrl + data.data.FirstOrDefault().filepath;
  890. }
  891. }
  892. }
  893. }
  894. return Content(new PmsJsonResoult(url).ToString(), "application/json");
  895. }
  896. /// <summary>
  897. /// 上传文件到阿里云
  898. /// </summary>
  899. /// <returns></returns>
  900. [HttpPost]
  901. public ActionResult FormMakingFileUpload()
  902. {
  903. var url = "";
  904. var files = this.Request.Files;
  905. if (this.Request.Files.Count > 0)
  906. {
  907. url= AliFileUpload.PutObjectFileStream(files);
  908. }
  909. return Content(new PmsJsonResoult(url).ToString(), "application/json");
  910. }
  911. #endregion
  912. #region 修改问题
  913. //Get: 修改问题的页面
  914. public ActionResult UpdateProjectProblem(string id)
  915. {
  916. var UserInfo = GetCurrentUser();
  917. ViewBag.DJRId = UserInfo.PersonID;
  918. ViewBag.RYXZ = UserInfo.PersonProperty;
  919. ViewBag.id = id;
  920. return View();
  921. }
  922. //根据问题编号获取问题信息
  923. public ActionResult GetInfolByBH(int id)
  924. {
  925. DataTable dt = CPWTJL_obj.GetInfolByBH(id);
  926. Session["ProblemUID"] = dt.Rows[0]["ID"];
  927. var json = dt.ToJson();
  928. return Content(json, "application/json");
  929. }
  930. //修改问题操作
  931. public string UpdateProblem(string text)
  932. {
  933. ProblemBusinessModel problemBusinessModel = Strings.JsonToModel<ProblemBusinessModel>(HttpUtility.UrlDecode(text));
  934. UserInfo currentUser = base.GetCurrentUser();
  935. problemBusinessModel.QDID = this.CPWTJL_obj.GetChannelByProId(problemBusinessModel.XMID).Rows[0]["ID"].ToString();
  936. int num = this.CPWTJL_obj.UpdateProblem(problemBusinessModel, currentUser);
  937. bool flag = num != 0 && num != -1;
  938. string result;
  939. if (flag)
  940. {
  941. base.Session["ProblemUID"] = this.CPWTJL_obj.GetProblemID(problemBusinessModel.BH.ToInt32());
  942. result = problemBusinessModel.BH.ToString();
  943. }
  944. else
  945. {
  946. result = null;
  947. }
  948. return result;
  949. }
  950. //加载产品
  951. public ActionResult GetCpwtjlByID(string xmid, string cpid)
  952. {
  953. var json = CPWTJL_obj.GetCpwtjlByID(xmid, cpid);
  954. return Content(json, "application/json");
  955. }
  956. //获取项目id
  957. public ActionResult GetXMID(string xmid)
  958. {
  959. var json = CPWTJL_obj.GetXMID(xmid);
  960. return Content(json, "application/json");
  961. }
  962. //获取问题附件
  963. [HttpPost]
  964. public ActionResult Attachment(string id)
  965. {
  966. DataTable dt = CPWTJL_obj.GetAttachment(id);
  967. List<FTPFileModel> list = new List<FTPFileModel>();
  968. for (int i = 0; i < dt.Rows.Count; i++)
  969. {
  970. var type = dt.Rows[i]["类型"].ToInt32();
  971. var ID = dt.Rows[i]["附件ID"].ToString();
  972. FtpDownloadResult model = DownloadFileBase64(ID, "o");
  973. FTPFileModel ftpmodel = new FTPFileModel();
  974. if (model != null)
  975. {
  976. ftpmodel.id = ID;
  977. ftpmodel.format = model.format;
  978. ftpmodel.fileName = model.fileName;
  979. ftpmodel.base64 = model.base64;
  980. ftpmodel.type = type;
  981. list.Add(ftpmodel);
  982. }
  983. }
  984. return Content(Strings.ObjectToJson(list), "application/json");
  985. }
  986. //删除附件
  987. [HttpPost]
  988. public int Delete_Img(string id)
  989. {
  990. return CPWTJL_obj.Delete_Img(id);
  991. }
  992. #endregion
  993. #region 删除问题
  994. //删除操作
  995. public int Delete_Problem(string id)
  996. {
  997. return CPWTJL_obj.Delete_Problem(id);
  998. }
  999. //判断是否可以删除或修改
  1000. public ActionResult CheckState(string id, int type)
  1001. {
  1002. var user = GetCurrentUser();
  1003. var dt = CPWTJL_obj.CheckState(id);
  1004. //所有人都不允许修改他人登记的问题 2020-9-17
  1005. if ((type == 1 && user.PersonID != dt.Rows[0]["登记人ID"].ToString()) || type == 2 && (user.PersonID != dt.Rows[0]["登记人ID"].ToString()))
  1006. {
  1007. return null;
  1008. }
  1009. return Content(dt.ToJson(), "application/json");
  1010. }
  1011. //得到问题状态判断
  1012. public ActionResult GetProblemState(string id)
  1013. {
  1014. var user = GetCurrentUser();
  1015. var s = CPWTJL_obj.GetProblemState(id, user);
  1016. return Content(s ? "1" : "0", "application/json");
  1017. }
  1018. #endregion
  1019. #region 查看问题
  1020. //查看问题弹窗
  1021. public ActionResult CheckProblemWindow(string id)
  1022. {
  1023. var UserInfo = GetCurrentUser();
  1024. ViewBag.DJRId = UserInfo.PersonID;
  1025. ViewBag.RYXZ = UserInfo.PersonProperty;
  1026. ViewBag.id = id;
  1027. return View();
  1028. }
  1029. //查看问题
  1030. public ActionResult CheckProblem(string id)
  1031. {
  1032. var json = CPWTJL_obj.CheckProblem(id);
  1033. return Content(json, "application/json");
  1034. }
  1035. //查看附件图像(id:附件id,type:缩略图o原图,s缩略图,m大图)
  1036. public ActionResult ViewProblemImage(string id, string type)
  1037. {
  1038. if (string.IsNullOrEmpty(type))
  1039. {//文件流传输
  1040. var obj = DownloadFileBase64(id, string.Empty);
  1041. if (obj != null)
  1042. {
  1043. //将base64转bytes
  1044. var data = Convert.FromBase64String(obj.base64);
  1045. return File(data, "application/octet-stream", obj.fileName);
  1046. }
  1047. else
  1048. {
  1049. Logger.Instance.Warn("未获取到文件对象:" + id);
  1050. return View();
  1051. }
  1052. }
  1053. else
  1054. {//图像传输
  1055. var data = base.DownloadFileBytes(id, type);
  1056. if (data == null)
  1057. {
  1058. return null;
  1059. }
  1060. return File(data, "image/jpeg");
  1061. }
  1062. }
  1063. //查看处理过程信息
  1064. public ActionResult ViewProcessInfo(string id)
  1065. {
  1066. ViewBag.id = id;
  1067. //返回查询对象
  1068. var obj = projectProblems.QueryProcessInfo(id);
  1069. return View(obj);
  1070. }
  1071. //图片查看弹窗
  1072. public ActionResult ViewImg(string src)
  1073. {
  1074. ViewBag.src = src;
  1075. return View();
  1076. }
  1077. //获取问题记录
  1078. public ActionResult GetProblemById(string id)
  1079. {
  1080. var json = projectProblems.GetProblemById(id);
  1081. return Content(json, "application/json");
  1082. }
  1083. #endregion
  1084. #region 处理问题
  1085. public ActionResult CancelReceiveProblem(string id)
  1086. {
  1087. //数据库取消执行
  1088. var r = projectProblems.CancelReceiveProblem(id, GetCurrentUser().PersonID);
  1089. var json = new PmsJsonResoult(r).ToString();
  1090. return Content(json, "text/json");
  1091. }
  1092. /// <summary>
  1093. /// 产品问题处理弹框
  1094. /// </summary>
  1095. /// <returns></returns>
  1096. public ActionResult ProductionPdeal(string id, string cpId, int showatt = 0, int workflowid = 1, int IsSupport = 0)
  1097. {
  1098. ViewBag.id = id;
  1099. ViewBag.showAtt = showatt;
  1100. ViewBag.IsSupport = IsSupport;
  1101. ViewBag.cpId = cpId;
  1102. var userInfo = GetCurrentUser();
  1103. var uid = userInfo.PersonID;
  1104. var name = userInfo.Name;
  1105. //设置当前人员性质
  1106. ViewBag.userProp = userInfo.PersonProperty;
  1107. ViewBag.workflowid = workflowid;//流程ID
  1108. //projectProblems.TryReceiveProblem(id, uid, name);
  1109. //获取最近的处理说明
  1110. var model = projectProblems.GetRecentlyDetail(id);
  1111. ViewBag.DealDetail = model.DealDetail;
  1112. ViewBag.SolveDetail = model.SolveDetail;
  1113. return View();
  1114. }
  1115. /// <summary>
  1116. /// 执行处理(确定处理问题)
  1117. /// </summary>
  1118. /// <param name="model">处理信息</param>
  1119. /// <returns></returns>
  1120. public ActionResult ExecuteProcessData(ProblemProcessModel model)
  1121. {
  1122. model.ProcessRemark = HttpUtility.UrlDecode(model.ProcessRemark);
  1123. model.AlterRemark = HttpUtility.UrlDecode(model.AlterRemark);
  1124. var userInfo = GetCurrentUser();
  1125. var uid = userInfo.PersonID;
  1126. //当前操作人
  1127. model.CurrentUserID = uid;
  1128. model.CurrentUserProp = userInfo.PersonProperty;
  1129. model.CurrentUserJob = userInfo.JobCode;
  1130. model.CurrentUserName = userInfo.Name;
  1131. var msg = string.Empty;
  1132. //返回处理结果
  1133. bool r = projectProblems.ExecuteProcessData(model, out msg,GetCurrentUser());
  1134. Session["ProblemUID"] = model.ProblemID;
  1135. Session["ProblemProcessID"] = model.ProcesssID;
  1136. //站点推送
  1137. if (r)
  1138. {
  1139. SitePush(model);
  1140. }
  1141. //刷新推送
  1142. if (r && (model.IsBack || (model.IsCommit && string.IsNullOrEmpty(model.SubID))))
  1143. {
  1144. DealNotify(model.ProblemID, model.IsBack ? 1 : 2);
  1145. }
  1146. return Content(new PmsJsonResoult(r, msg).ToString(), "text/json");
  1147. }
  1148. /// <summary>
  1149. /// 向客户端发送更新操作
  1150. /// </summary>
  1151. /// <param name="id"></param>
  1152. private void RefreshProblem(string id)
  1153. {
  1154. var WTJLModel = projectProblems.GetWTJLModel(id);
  1155. if (WTJLModel.HJID <= 3)
  1156. {//更新项目问题管理列表
  1157. App_Start.ClientManager.RefreshProblem("1");
  1158. }
  1159. else if (WTJLModel.HJID == 4)
  1160. {//更新技术支持
  1161. App_Start.ClientManager.RefreshProblem("2");
  1162. }
  1163. else
  1164. {//研发
  1165. App_Start.ClientManager.RefreshProblem("3");
  1166. }
  1167. }
  1168. //登记问题获取推送人
  1169. private List<string> GetPushPerson(string ProblemId)
  1170. {
  1171. var PersonId = GetCurrentUser().PersonID;
  1172. var list = projectProblems.GetPushPerson(ProblemId);
  1173. //去除自己
  1174. list.Remove(PersonId);
  1175. return list;
  1176. }
  1177. /// <summary>
  1178. /// 登记推送
  1179. /// </summary>
  1180. /// <param name="id"></param>
  1181. private void RegistNotify(string id)
  1182. {
  1183. var PushPerson = GetPushPerson(id);
  1184. var PushPersonTask = Task.Factory.StartNew(() => Parallel.ForEach<string>(PushPerson, item => this.RefreshProblemAndSendMessage(item, "有新的问题登记,请注意查收!", id)));
  1185. Task.WaitAll(PushPersonTask);
  1186. return;
  1187. }
  1188. /// <summary>
  1189. /// 回退和向上提交的问题推送
  1190. /// </summary>
  1191. /// <param name="id"></param>
  1192. private void DealNotify(string id, int type)
  1193. {
  1194. string Message;
  1195. if (type == 1)
  1196. {
  1197. //回退
  1198. Message = "有新的问题回退,请注意查收!";
  1199. }
  1200. else
  1201. {//提交
  1202. Message = "有新的问题向上提交,请注意查收!";
  1203. }
  1204. var PushPerson = GetPushPerson(id);
  1205. var PushPersonTask = Task.Factory.StartNew(() => Parallel.ForEach<string>(PushPerson, item => this.RefreshProblemAndSendMessage(item, Message, id)));
  1206. Task.WaitAll(PushPersonTask);
  1207. return;
  1208. }
  1209. //站点推送
  1210. private void SitePush(ProblemProcessModel model)
  1211. {
  1212. var userInfo = GetCurrentUser();
  1213. try
  1214. {
  1215. var str = "您有新的消息通知";
  1216. var AssignID = model.AssignID;//默认推送给指派人员
  1217. if (model.IsAssign)
  1218. {//处理成功与指派人员时需要向该被指派人员推送消息
  1219. str = "有新的问题指派给您,请注意查收!";
  1220. var NotefiyConfigInfo = projectProblems.GetNotifyConfigInfoByUserId(model.AssignID);
  1221. if (NotefiyConfigInfo != null && NotefiyConfigInfo.Assign.SendSite)
  1222. {
  1223. this.SendDealMessage(model.ProblemID, model.AssignID, str, 1);
  1224. }
  1225. }
  1226. else if (model.IsSolve)
  1227. {
  1228. var WTJLModel = projectProblems.GetWTJLModel(model.ProblemID);
  1229. str = "您的编号为【" + WTJLModel.BH.ToString() + "】的问题已被解决,处理人:" + WTJLModel.SLR;
  1230. AssignID = WTJLModel.DJRID;
  1231. //推送本地消息
  1232. var NotefiyConfigInfo = projectProblems.GetNotifyConfigInfoByUserId(WTJLModel.DJRID);
  1233. if (NotefiyConfigInfo != null && NotefiyConfigInfo.SolveTime.SendSite)
  1234. {
  1235. this.SendDealMessage(model.ProblemID, WTJLModel.DJRID, str, 2);
  1236. }
  1237. }
  1238. else if (model.IsBack)
  1239. {
  1240. var WTJLModel = projectProblems.GetWTJLModel(model.ProblemID);
  1241. str = "您的编号为【" + WTJLModel.BH.ToString() + "】的问题已被回退,处理人:" + userInfo.Name;
  1242. AssignID = WTJLModel.DJRID;
  1243. //推送本地消息
  1244. var NotefiyConfigInfo = projectProblems.GetNotifyConfigInfoByUserId(WTJLModel.DJRID);
  1245. if (NotefiyConfigInfo != null && NotefiyConfigInfo.BackTime.SendSite)
  1246. {
  1247. this.SendDealMessage(model.ProblemID, WTJLModel.DJRID, str, 3);
  1248. }
  1249. }
  1250. else if (model.IsStop)
  1251. {
  1252. var WTJLModel = projectProblems.GetWTJLModel(model.ProblemID);
  1253. str = "您的编号为【" + WTJLModel.BH.ToString() + "】的问题已被终止,处理人:" + userInfo.Name;
  1254. AssignID = WTJLModel.DJRID;
  1255. //推送本地消息
  1256. var NotefiyConfigInfo = projectProblems.GetNotifyConfigInfoByUserId(WTJLModel.DJRID);
  1257. if (NotefiyConfigInfo != null && NotefiyConfigInfo.StopTime.SendSite)
  1258. {
  1259. this.SendDealMessage(model.ProblemID, WTJLModel.DJRID, str, 4);
  1260. }
  1261. }
  1262. else if (model.IsCommit && !string.IsNullOrEmpty(model.SubID))
  1263. {
  1264. str = "有新的问题提交给您,请注意查收!";
  1265. AssignID = model.SubID;
  1266. //推送本地消息
  1267. var NotefiyConfigInfo = projectProblems.GetNotifyConfigInfoByUserId(model.SubID);
  1268. if (NotefiyConfigInfo != null && NotefiyConfigInfo.Assign.SendSite)
  1269. {
  1270. this.SendDealMessage(model.ProblemID, model.SubID,str , 5);
  1271. }
  1272. }
  1273. //if(model.ProblemID== "fa750062-79d8-4975-b901-6e0395e3cc80")//测试代码
  1274. if(AssignID.IsNullOrEmpty())//推送人id为空,根据问题id找到登记人id
  1275. {
  1276. DataTable dt = CPWTJL_obj.GetProblemInfo(model.ProblemID);
  1277. if(dt.Rows.Count>0)
  1278. {
  1279. AssignID = dt.GetValueByName<string>("登记人ID");
  1280. }
  1281. dt = null;
  1282. }
  1283. WeChartPush(str,model.ProblemID,model.ProcessRemark, AssignID);
  1284. }
  1285. catch (Exception ex)
  1286. {
  1287. Logger.Instance.Error("站点推送失败,原因:" + ex);
  1288. }
  1289. }
  1290. /// <summary>
  1291. /// 微信推送
  1292. /// </summary>
  1293. /// <param name="str">标题</param>
  1294. /// <param name="ProblemID">问题id</param>
  1295. /// <param name="ProcessRemark">内容</param>
  1296. /// <param name="AssignID">推送人id</param>
  1297. private void WeChartPush(string str,string ProblemID,string ProcessRemark,string AssignID) {
  1298. if (!ProcessRemark.IsNullOrEmpty())
  1299. {
  1300. try
  1301. {
  1302. ProcessRemark = Tools.RemoveHTML(ProcessRemark);
  1303. }
  1304. catch (Exception ex)
  1305. {
  1306. Logger.Instance.Error("微信推送失败[转换内容出错],原因:" + ex);
  1307. }
  1308. }
  1309. else
  1310. {
  1311. ProcessRemark = str;
  1312. }
  1313. NotificationDto no = new NotificationDto();
  1314. no.style = "3";
  1315. no.template_code = "OIE51OsXeECnoPxGgPTQ7acXybc7t1plgAbdlH-mMWE";
  1316. no.template_value = "{\"first\":{\"value\":\"" + str+ "\",\"color\":\"#173177\"},\"keyword1\":{\"value\":\"" + DateTime.Now+ "\",\"color\":\"#173177\"},\"keyword2\":{\"value\":\"" + ProcessRemark + "\",\"color\":\"#173177\"},\"remark\":{\"value\":\"点击【查看详情】立即查阅您的问题记录\",\"color\":\"#173177\"}}";
  1317. no.url = "https://zlpms.zlsoft.com:8078/MobileProblem/ProblemDetail/"+ProblemID;
  1318. List<MessageDetailsDto> list = new List<MessageDetailsDto>();
  1319. MessageDetailsDto mdd = new MessageDetailsDto();
  1320. var dt = account_obj.GetAccountInfo(AssignID);
  1321. if (dt != null && dt.Rows.Count > 0)
  1322. {
  1323. mdd.接收人id = dt.GetValueByName<string>("微信id");
  1324. }
  1325. mdd.接收人 = "李艳春";
  1326. //mdd.接收人id = "oR2TM1RJcCi4E93BWPgz8i42vRcY";
  1327. mdd.接收人电话 = "李艳春";
  1328. list.Add(mdd);
  1329. no.record_items = list;
  1330. if (mdd.接收人id!=null)
  1331. {
  1332. notice.SendWeChartTempletMessge(no);
  1333. }
  1334. }
  1335. // 根据问题id获取对应产品版本
  1336. public ActionResult GetVersionById(string id, int type)
  1337. {
  1338. return Content(CPWTJL_obj.GetVersionById(id, type), "application/json");
  1339. }
  1340. #endregion
  1341. #region 撤消问题
  1342. //撤消已关闭或解决的问题
  1343. public ActionResult UndoProblem(string id)
  1344. {
  1345. var cnt = WorkFlowModule.UndoProblem(id, GetCurrentUser().PersonID);
  1346. return Content(cnt ? "1" : "", "text/plan");
  1347. }
  1348. #endregion
  1349. #region 新处理版本
  1350. public ActionResult NewversionWindow(string id)
  1351. {
  1352. ViewBag.id = id;
  1353. return View();
  1354. }
  1355. public ActionResult GetVersion(string pid)
  1356. {
  1357. return Content(product.GetVersion(pid), "application/json");
  1358. }
  1359. public int SaveVersion(string pid, string version, string productid)
  1360. {
  1361. return product.SaveVersion(pid, version, productid, GetCurrentUser());
  1362. }
  1363. [HttpPost]
  1364. public ActionResult ShowConnect(string id)
  1365. {
  1366. return Content(product.ShowConnect(id), "application/json");
  1367. }
  1368. #endregion
  1369. #region 获取APP
  1370. [Route("GetAppPC/{Type}")]
  1371. public ActionResult GetAppforPC(string Type)
  1372. {
  1373. var pathbase = this.HttpContext.Server.MapPath("/AppDownLoad/");
  1374. var AppType = string.Empty;
  1375. var AppName = string.Empty;
  1376. if (Type == "Android")
  1377. {
  1378. pathbase += "ZLPMS.apk";
  1379. AppName = "ZLPMS.apk";
  1380. AppType = ".apk";
  1381. }
  1382. else
  1383. {
  1384. pathbase += "ZLPMS.ipa";
  1385. AppName = "ZLPMS.ipa";
  1386. AppType = ".ipa";
  1387. }
  1388. if (System.IO.File.Exists(pathbase))
  1389. {
  1390. try
  1391. {
  1392. var data = System.IO.File.ReadAllBytes(pathbase);
  1393. return File(data, "application/octet-stream", AppName);
  1394. }
  1395. catch (Exception ex)
  1396. {
  1397. Logger.Instance.Error("读取文件失败", ex);
  1398. return View();
  1399. }
  1400. }
  1401. else
  1402. {
  1403. Logger.Instance.Warn("未获取到APP对象");
  1404. return View();
  1405. }
  1406. }
  1407. #endregion
  1408. #region 修改问题过程
  1409. //修改问题过程弹窗
  1410. public ActionResult UpdateViewProcessInfo(string id)
  1411. {
  1412. ViewBag.id = id;
  1413. //返回查询对象
  1414. var obj = projectProblems.QueryProcessInfo(id);
  1415. return View(obj);
  1416. }
  1417. //问题过程的附件上传
  1418. [HttpPost]
  1419. public int ProcessFileUpload(string problemID, string processID)
  1420. {
  1421. var result = 0;
  1422. var files = this.Request.Files;
  1423. if (this.Request.Files.Count > 0)
  1424. {
  1425. using (BinaryReader br = new BinaryReader(files[0].InputStream))
  1426. {
  1427. byte[] byteData = br.ReadBytes((int)files[0].InputStream.Length);
  1428. var uploadFile = files[0];
  1429. var fileName = uploadFile.FileName;
  1430. var fileLen = uploadFile.ContentLength;
  1431. var fileType = uploadFile.ContentType;
  1432. string _tp = System.IO.Path.GetExtension(fileName);
  1433. var r = UploadFile(byteData, fileName, fileType);
  1434. if (r.code == 100)
  1435. {
  1436. ///数据库存储附件ID
  1437. var Complete = CPWTJL_obj.ProcessFileUpload(problemID, r.data, GetCurrentUser().Name, fileType, processID);
  1438. if (Complete)
  1439. {
  1440. result = 1;
  1441. }
  1442. }
  1443. }
  1444. }
  1445. return result;
  1446. }
  1447. /// <summary>
  1448. /// 判断是否允许修改问题过程
  1449. /// </summary>
  1450. /// <param name="id"></param>
  1451. /// <returns></returns>
  1452. public ActionResult CheckUpdateProcess(string id)
  1453. {
  1454. var userInfo = GetCurrentUser();
  1455. var t = projectProblems.CheckUpdateProcess(id, userInfo.PersonID);
  1456. return Content(t, "text/json");
  1457. }
  1458. public ActionResult UpdateProblemProcess(string text)
  1459. {
  1460. WTJLGCModel model = Strings.JsonToModel<WTJLGCModel>(HttpUtility.UrlDecode(text));
  1461. var r = projectProblems.UpdateProblemProcess(model);
  1462. if (r)
  1463. {
  1464. return Content(new PmsJsonResoult(System.Net.HttpStatusCode.OK, "成功", null).ToString(), "application/json");
  1465. }
  1466. else
  1467. {
  1468. return Content(new PmsJsonResoult(System.Net.HttpStatusCode.Forbidden, "失败", null).ToString(), "application/json");
  1469. }
  1470. }
  1471. #endregion
  1472. #region 导出excel文件
  1473. [HttpPost]
  1474. public int ProcessRequest(string text)
  1475. {
  1476. var x = HttpUtility.UrlDecode(text);
  1477. string fn = DateTime.Now.ToString("yyyyMMddHHmmssfff") + ".xls";
  1478. System.IO.File.WriteAllText(@"d:\\" + fn, x, Encoding.UTF8);
  1479. TempData["path"] = fn;
  1480. TempData["bytes"] = HttpUtility.UrlDecode(text);
  1481. TempData["name"] = fn;
  1482. return 1;
  1483. }
  1484. //导出excel
  1485. public ActionResult Excel()
  1486. {
  1487. return File(@"d:\\" + TempData["name"].ToString(), "application/octet-stream", TempData["name"].ToString());
  1488. //return File(System.Text.Encoding.Default.GetBytes(TempData["bytes"].ToString()), "application/octet-stream", TempData["name"].ToString());
  1489. }
  1490. //删除
  1491. public void DeleteExcel()
  1492. {
  1493. System.IO.File.Delete(@"d:\\" + TempData["path"].ToString());
  1494. }
  1495. //导出设置的弹窗
  1496. public ActionResult ExcelSet_Window()
  1497. {
  1498. return View();
  1499. }
  1500. //接受设置字段
  1501. [HttpPost]
  1502. public void GetFiledList(string text, string state)
  1503. {
  1504. TempData["arry"] = text;
  1505. TempData["state"] = state;
  1506. }
  1507. #endregion
  1508. #region 其他操作
  1509. /// <summary>
  1510. /// 判断是否有权限对问题进行归类
  1511. /// </summary>
  1512. /// <returns></returns>
  1513. public ActionResult IsDealed(string id)
  1514. {
  1515. bool res = this.projectProblems.IsDealed(id, base.GetCurrentUser().PersonID);
  1516. bool flag2 = false;
  1517. foreach (string current in GetCurrentUser().Roles)
  1518. {
  1519. if (current == "369")
  1520. {
  1521. flag2 = true;
  1522. break;
  1523. }
  1524. }
  1525. if (res | flag2)
  1526. {
  1527. return Content("1");
  1528. }
  1529. else
  1530. {
  1531. return Content("0");
  1532. }
  1533. }
  1534. /// <summary>
  1535. /// 判断问题是否完结并处理推送评价
  1536. /// </summary>
  1537. /// <param name="id"></param>
  1538. /// <returns></returns>
  1539. public ActionResult IsConfirmClosing(string id)
  1540. {
  1541. bool res = this.projectProblems.IsConfirmClosing(id, base.GetCurrentUser().PersonID);
  1542. bool flag2 = false;
  1543. foreach (string current in GetCurrentUser().Roles)
  1544. {
  1545. if (current == "369")
  1546. {
  1547. flag2 = true;
  1548. break;
  1549. }
  1550. }
  1551. if (res | flag2)
  1552. {
  1553. return Content("1");
  1554. }
  1555. else
  1556. {
  1557. return Content("0");
  1558. }
  1559. }
  1560. /// <summary>
  1561. /// 问题验证
  1562. /// </summary>
  1563. /// <param name="model"></param>
  1564. /// <returns></returns>
  1565. public ActionResult AcceptancProblem(ProblemProcessModel model)
  1566. {
  1567. model.ProcessRemark = HttpUtility.UrlDecode(model.ProcessRemark);
  1568. model.CurrentUserID = GetCurrentUser().PersonID;
  1569. var r = WorkFlowModule.AcceptancProblem(model);
  1570. return Content(r ? "1" : "0", "text/plan");
  1571. }
  1572. /// <summary>
  1573. /// 归类问题窗体
  1574. /// </summary>
  1575. /// <param name="id"></param>
  1576. /// <returns></returns>
  1577. public ActionResult DoClassifiWindow(string id,int nature)
  1578. {
  1579. ViewBag.ID = id;
  1580. ViewBag.nature = nature;
  1581. return View();
  1582. }
  1583. /// <summary>
  1584. /// 解决版本
  1585. /// </summary>
  1586. /// <param name="id">问题id</param>
  1587. /// <param name="probID">产品id</param>
  1588. /// <returns></returns>
  1589. public ActionResult ResolveVersion(string id,string probID)
  1590. {
  1591. ViewBag.ID = id;
  1592. ViewBag.probID = probID;
  1593. return View();
  1594. }
  1595. /// <summary>
  1596. /// 更新问题版本
  1597. /// </summary>
  1598. /// <param name="model"></param>
  1599. /// <returns></returns>
  1600. public ActionResult UpdateVersion(VersionManageModel model)
  1601. {
  1602. model.操作人 = GetCurrentUser().Name;
  1603. var r = WorkFlowModule.UpdateVersion(model);
  1604. return Content(r ? "1" : "0", "text/plan");
  1605. }
  1606. /// <summary>
  1607. /// 问题归类
  1608. /// </summary>
  1609. /// <param name="id"></param>
  1610. /// <returns></returns>
  1611. [HttpPost]
  1612. public ActionResult DoClassifi(string id, string ClssID, int nature)
  1613. {
  1614. var r = projectProblems.DoClassifi(id, ClssID, nature, GetCurrentUser());
  1615. return Content(r ? "1" : "0");
  1616. }
  1617. [HttpPost]
  1618. public int ChangeVersionState(string id, int state)
  1619. {
  1620. return this.CPWTJL_obj.ChangeVersionState(id, state);
  1621. }
  1622. /// <summary>
  1623. /// 标准底线问题
  1624. /// </summary>
  1625. /// <param name="id"></param>
  1626. /// <param name="state"></param>
  1627. /// <returns></returns>
  1628. [HttpPost]
  1629. public int Bottomlineissues(string id, int state)
  1630. {
  1631. return this.CPWTJL_obj.Bottomlineissues(id, state);
  1632. }
  1633. [HttpPost]
  1634. public int Identify(int id)
  1635. {
  1636. Identify_Model identify_Model = new Identify_Model();
  1637. DataTable infolByBH = this.CPWTJL_obj.GetInfolByBH(id);
  1638. identify_Model.XMID = infolByBH.Rows[0]["项目ID"].ToString();
  1639. identify_Model.CPID = this.CPWTJL_obj.GetProjectProducct(infolByBH.Rows[0]["产品ID"].ToString()).Rows[0]["产品ID"].ToString();
  1640. identify_Model.XGSJ = new DateTime?(this.CPWTJL_obj.GetDatabaseTime());
  1641. identify_Model.XGR = base.GetCurrentUser().Name;
  1642. identify_Model.MC = infolByBH.Rows[0]["问题标题"].ToString();
  1643. identify_Model.LYWT = infolByBH.Rows[0]["编号"].ToString();
  1644. bool flag = this.CPWTJL_obj.CheckRepeat(identify_Model.LYWT);
  1645. int result;
  1646. if (flag)
  1647. {
  1648. result = 2;
  1649. }
  1650. else
  1651. {
  1652. bool flag2 = base.GetCurrentUser().JobCode.ToInt32() == 10 || base.GetCurrentUser().JobCode.ToInt32() == 11;
  1653. if (flag2)
  1654. {
  1655. identify_Model.XGXZ = new int?(1);
  1656. }
  1657. else
  1658. {
  1659. bool flag3 = base.GetCurrentUser().JobCode.ToInt32() == 12 || base.GetCurrentUser().JobCode.ToInt32() == 13 || base.GetCurrentUser().JobCode.ToInt32() == 7;
  1660. if (flag3)
  1661. {
  1662. identify_Model.XGXZ = new int?(2);
  1663. }
  1664. else
  1665. {
  1666. identify_Model.XGXZ = new int?(3);
  1667. }
  1668. }
  1669. result = ((this.ProModule.Add_Identify(identify_Model).Length == 36) ? 1 : 0);
  1670. }
  1671. return result;
  1672. }
  1673. #endregion
  1674. #region 超时推送
  1675. /// <summary>
  1676. /// 获取超时推送是否开启
  1677. /// </summary>
  1678. /// <returns></returns>
  1679. public ActionResult GetIsOverTime()
  1680. {
  1681. var r = projectProblems.GetIsOverTime(GetCurrentUser());
  1682. return Content(r ? "1" : "0", "application/json");
  1683. }
  1684. /// <summary>
  1685. /// 获取受理超时的问题ID
  1686. /// </summary>
  1687. /// <returns></returns>
  1688. public ActionResult GetAcceptOverTime()
  1689. {
  1690. var json = projectProblems.GetAcceptOverTime(GetCurrentUser());
  1691. return Content(json, "application/json");
  1692. }
  1693. /// <summary>
  1694. /// 获取处理超时的问题ID
  1695. /// </summary>
  1696. /// <param name="user"></param>
  1697. /// <returns></returns>
  1698. public ActionResult GetDealOverTime(UserInfo user)
  1699. {
  1700. var json = projectProblems.GetDealOverTime(GetCurrentUser());
  1701. return Content(json, "application/json");
  1702. }
  1703. #endregion
  1704. #region 统计查询
  1705. public ActionResult Statistics()
  1706. {
  1707. return View();
  1708. }
  1709. /// <summary>
  1710. /// 获取统计报表
  1711. /// </summary>
  1712. /// <returns></returns>
  1713. public string GetList()
  1714. {
  1715. return Newtonsoft.Json.JsonConvert.DeserializeObject(IReport.GetList(GetCurrentUser())).ToString(); //转换为动态JSON类型
  1716. }
  1717. #endregion
  1718. #region 版本问题查询
  1719. public ActionResult GetVersionProblem(string SearchText, string ProductId, string VersionId, string projectId, string AcceptedId, string sort, string order ,int page, int rows)
  1720. {
  1721. var json = projectProblems.GetVersionProblem(SearchText, ProductId, VersionId, projectId, AcceptedId, sort, order, page, rows);
  1722. return Content(json, "text/json");
  1723. }
  1724. public ActionResult AddNotes(string id, string probID)
  1725. {
  1726. ViewBag.ID = id;
  1727. ViewBag.probID = probID;
  1728. return View();
  1729. }
  1730. /// <summary>
  1731. /// 添加备注
  1732. /// </summary>
  1733. /// <param name="model"></param>
  1734. /// <returns></returns>
  1735. public ActionResult AddNotesContent(SubmitProblemFormModel model)
  1736. {
  1737. model.registrantID = GetCurrentUser().PersonID;
  1738. model.DealDetail = HttpUtility.UrlDecode(model.DealDetail);
  1739. model.Status = 12;
  1740. var r = projectProblems.AddNotes(model);
  1741. return Content(r.IsNullOrEmpty() ? "0" : "1", "text/plan");
  1742. }
  1743. #endregion
  1744. #region 变更研发/测试处理人
  1745. public ActionResult DevTestWindow(string id,string devID,string testID)
  1746. {
  1747. ViewBag.id = id;
  1748. ViewBag.dev = devID;
  1749. ViewBag.test = testID;
  1750. return View();
  1751. }
  1752. //保存研发/测试处理人
  1753. public int SaveDevTest(string id, string dev, string test)
  1754. {
  1755. var res= this.CPWTJL_obj.SaveDevTest(id, dev, test);
  1756. return res;
  1757. }
  1758. #endregion
  1759. #region 资源信息
  1760. //问题资源弹窗
  1761. public ActionResult ResourceWindow(string type, string version)
  1762. {
  1763. ViewBag.type = type;
  1764. ViewBag.version = version;
  1765. return View();
  1766. }
  1767. //编辑资源信息
  1768. [HttpPost]
  1769. public int SaveResource(ResourceBusinessModels model)
  1770. {
  1771. model.TJRID = GetCurrentUser().PersonID;
  1772. var res = CPWTJL_obj.SaveResource(model);
  1773. return res;
  1774. }
  1775. //问题资源的列表数据
  1776. public ActionResult ResourceData(string proid)
  1777. {
  1778. return Content(CPWTJL_obj.ResourceData(proid), "text/json");
  1779. }
  1780. //问题资源的列表数据(layui用)
  1781. public ActionResult ResourceData_Layui(string proid)
  1782. {
  1783. var obj = new
  1784. {
  1785. code = 0,
  1786. msg = "",
  1787. count = 1000,
  1788. data = CPWTJL_obj.ResourceData_Layui(proid)
  1789. };
  1790. var jss = new JavaScriptSerializer();
  1791. return Content(jss.Serialize(obj));
  1792. }
  1793. //删除资源
  1794. public int DelResource(string id)
  1795. {
  1796. return CPWTJL_obj.DelResource(id);
  1797. }
  1798. //获取序号
  1799. public int GetNumber(string id)
  1800. {
  1801. return CPWTJL_obj.GetNumber(id);
  1802. }
  1803. public string GetBhMethod(string id)
  1804. {
  1805. var obj = new
  1806. {
  1807. resquest = new
  1808. {
  1809. 资源ID = id,
  1810. }
  1811. };
  1812. var jsonstr = JsonConvert.SerializeObject(obj);
  1813. string url = "http://192.168.0.106:8801/bizdomain/03/Basis/生成资源路径?Input=" + jsonstr.ToString();
  1814. //string url = "http://192.168.31.206:8083/bizdomain/03/Basis/生成资源路径?Input=" + jsonstr.ToString();
  1815. return CPWTJL_obj.DoBHGet(url, "CZ", "123");
  1816. }
  1817. #endregion
  1818. }
  1819. }