TestController.cs 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. using System;
  2. using System.Collections.Generic;
  3. using System.IO;
  4. using System.Linq;
  5. using System.Web;
  6. using System.Web.Mvc;
  7. using PMS.Interface;
  8. using PMS.Interface.SysManager;
  9. using QWPlatform.SystemLibrary.ValidateCode;
  10. using QWPlatform.SystemLibrary.Web;
  11. using PMS.BusinessModels.Person;
  12. using System.Drawing;
  13. using QWPlatform.SystemLibrary.LogManager;
  14. using PMS.Interface.MessageManage;
  15. using PMS.BusinessModels.SMS;
  16. using PMS.Interface.Product;
  17. using PMS.BusinessModels.Product;
  18. using System.Data;
  19. using PMS.EntityModels.Product;
  20. namespace PMS.WebUI.Controllers
  21. {
  22. /// <summary>
  23. /// 创 建 人:王海洋
  24. /// 创建日期:2018-12-10
  25. /// 功能描述:账户管理控制类
  26. /// </summary>
  27. [CheckLogin(false)]
  28. public class TestController : BaseController
  29. {
  30. IMessageManage notice = InterfaceFactory.CreateBusinessInstance<IMessageManage>();
  31. IProductModule ProductModule = InterfaceFactory.CreateBusinessInstance<IProductModule>();
  32. // GET: Account
  33. public ActionResult Test()
  34. {
  35. Import();
  36. return View();
  37. //NotificationDto no = new NotificationDto();
  38. //no.style = "3";
  39. //no.template_code = "OIE51OsXeECnoPxGgPTQ7acXybc7t1plgAbdlH-mMWE";
  40. //no.template_value ="{\"first\":{\"value\":\"您有新的消息通知。\",\"color\":\"#173177\"},\"keyword1\":{\"value\":\"2019-01-0211:08\",\"color\":\"#173177\"},\"keyword2\":{\"value\":\"你的问题有新的变更通知\",\"color\":\"#173177\"},\"remark\":{\"value\":\"感谢您的使用。\",\"color\":\"#173177\"}}";
  41. //List<MessageDetailsDto> list = new List<MessageDetailsDto>();
  42. //MessageDetailsDto mdd = new MessageDetailsDto();
  43. //mdd.接收人 = "李艳春";
  44. //mdd.接收人id = "oR2TM1RJcCi4E93BWPgz8i42vRcY";
  45. //mdd.接收人电话 = "李艳春";
  46. //list.Add(mdd);
  47. //no.record_items = list;
  48. //notice.SendWeChartTempletMessge(no);
  49. //return View();
  50. }
  51. /// <summary>
  52. /// 导入功能模块
  53. /// </summary>
  54. /// <returns></returns>
  55. public ActionResult Import()
  56. {
  57. var column = new string[] { "ID", "上级ID", "名称", "编码", "开发方式", "开发状态", "研发人", "测试人", "测试人NEW", "说明", "类型" };
  58. var dt= ProductModule.GetProductFunctionDataTable("2f436cb5-06b8-45a1-a3c3-652b0ea18529", "", "");
  59. List<FormProductFunModel> CmodelList = new List<FormProductFunModel>();
  60. for (int i = 0; i < dt.Rows.Count; i++)
  61. {
  62. var id = Guid.NewGuid().ToString();
  63. if (dt.Rows[i]["上级ID"].ToString()=="")
  64. {
  65. FormProductFunModel Cmodel1 = new FormProductFunModel();
  66. Cmodel1.id = id;
  67. Cmodel1.parentid = "";
  68. Cmodel1.Coding = dt.Rows[i]["编码"].ToString();
  69. Cmodel1.ProID = "19010664-4f49-4a98-9f5d-98722dca92fe";
  70. Cmodel1.TestPer = "";
  71. Cmodel1.TestPerID = "";
  72. Cmodel1.DevelopmentModeID = "2";
  73. Cmodel1.name = dt.Rows[i]["名称"].ToString();
  74. Cmodel1.remark = dt.Rows[i]["说明"].ToString();
  75. Cmodel1.ResearchPer = "";
  76. Cmodel1.ResearchPerID = "";
  77. Cmodel1.ProType = "0";
  78. Cmodel1.DevelopmentStatusID = "3";
  79. var jj= ProductModule.PostSaveProductFunInport(Cmodel1);
  80. for (int j = 0; j < dt.Rows.Count; j++)
  81. {
  82. if (dt.Rows[i]["ID"].ToString() == dt.Rows[j]["上级ID"].ToString())
  83. {
  84. FormProductFunModel Cmodel = new FormProductFunModel();
  85. Cmodel.id = Guid.NewGuid().ToString(); ;
  86. Cmodel.parentid = id;
  87. Cmodel.Coding = dt.Rows[j]["编码"].ToString();
  88. Cmodel.ProID = "19010664-4f49-4a98-9f5d-98722dca92fe";
  89. Cmodel.TestPer = "";
  90. Cmodel.TestPerID = "";
  91. Cmodel.DevelopmentModeID = "2";
  92. Cmodel.name = dt.Rows[j]["名称"].ToString();
  93. Cmodel.remark = dt.Rows[j]["说明"].ToString();
  94. Cmodel.ResearchPer = "";
  95. Cmodel.ResearchPerID = "";
  96. Cmodel.DevelopmentStatusID = "3";
  97. Cmodel.ProType = "0";
  98. var r = ProductModule.PostSaveProductFunInport(Cmodel);
  99. }
  100. }
  101. }
  102. }
  103. return View();
  104. }
  105. }
  106. }