VerifyTemplate.go 32 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150
  1. package controllers
  2. import (
  3. "ColdVerify_server/conf"
  4. "ColdVerify_server/lib"
  5. "ColdVerify_server/logs"
  6. "ColdVerify_server/models/Account"
  7. "ColdVerify_server/models/System"
  8. "ColdVerify_server/models/Task"
  9. "ColdVerify_server/models/VerifyTemplate"
  10. "encoding/json"
  11. "fmt"
  12. beego "github.com/beego/beego/v2/server/web"
  13. "math"
  14. "strconv"
  15. "strings"
  16. )
  17. type VerifyTemplateController struct {
  18. beego.Controller
  19. User_r Account.Admin // 登陆的用户
  20. }
  21. func (c *VerifyTemplateController) Prepare() {
  22. GetCookie := c.Ctx.GetCookie("User_tokey")
  23. GetString := c.GetString("User_tokey")
  24. fmt.Println(c.Ctx.Request.URL.Path)
  25. if strings.Contains(c.Ctx.Request.URL.Path, "/VerifyTemplateMapData/Pu") {
  26. return
  27. }
  28. // 验证登录 User_is, User_r
  29. User_r, User_is := Account.Verification_Admin(GetCookie, GetString)
  30. if !User_is {
  31. c.Data["json"] = lib.JSONS{Code: 201, Msg: "请重新登录!"}
  32. c.ServeJSON()
  33. return
  34. }
  35. // 经销商只能访问列表接口,不能操作
  36. //if len(User_r.T_Distributor_id) > 0 {
  37. // checkUrl := []string{"Add", "Up", "Del"}
  38. // for _, v := range checkUrl {
  39. // if strings.Contains(c.Ctx.Request.URL.Path, v) {
  40. // c.Data["json"] = lib.JSONS{Code: 202, Msg: "没有操作权限!"}
  41. // c.ServeJSON()
  42. // return
  43. // }
  44. // }
  45. //}
  46. c.User_r = User_r
  47. }
  48. // 列表 -
  49. func (c *VerifyTemplateController) List() {
  50. // 验证登录 User_is, User_r
  51. User_r, User_is := Account.Verification_Admin(c.Ctx.GetCookie("User_tokey"), c.GetString("User_tokey"))
  52. if !User_is {
  53. c.Data["json"] = lib.JSONS{Code: 201, Msg: "请重新登录!"}
  54. c.ServeJSON()
  55. return
  56. }
  57. var r_jsons lib.R_JSONS
  58. page, _ := c.GetInt("page")
  59. if page < 1 {
  60. page = 1
  61. }
  62. page_z, _ := c.GetInt("page_z")
  63. if page_z < 1 {
  64. page_z = conf.Page_size
  65. }
  66. T_class, _ := c.GetInt("T_class")
  67. if T_class <= 0 {
  68. c.Data["json"] = lib.JSONS{Code: 202, Msg: "T_class Err!"}
  69. c.ServeJSON()
  70. return
  71. }
  72. T_name := c.GetString("T_name")
  73. logs.Debug("经销商id", User_r.T_Distributor_id)
  74. // Fixme 经销商只能获取绑定的验证模版 绑定功能做好之后再打开此注释
  75. //if len(User_r.T_Distributor_id) > 0 {
  76. // var cnt int64
  77. // List, cnt := Distributor.Read_DistributorVerifyTemplate_List(User_r.T_Distributor_id, T_class, T_name, page, page_z)
  78. // page_size := math.Ceil(float64(cnt) / float64(page_z))
  79. // r_jsons.List = List
  80. // r_jsons.Page = page
  81. // r_jsons.Page_size = int(page_size)
  82. // r_jsons.Pages = lib.Func_page(int64(page), int64(page_size))
  83. // r_jsons.Num = int(cnt)
  84. //
  85. // c.Data["json"] = lib.JSONS{Code: 200, Msg: "ok!", Data: r_jsons}
  86. // c.ServeJSON()
  87. // return
  88. //}
  89. var cnt int64
  90. List, cnt := VerifyTemplate.Read_VerifyTemplate_List(T_class, T_name, page, page_z)
  91. page_size := math.Ceil(float64(cnt) / float64(page_z))
  92. r_jsons.List = List
  93. r_jsons.Page = page
  94. r_jsons.Page_size = int(page_size)
  95. r_jsons.Pages = lib.Func_page(int64(page), int64(page_size))
  96. r_jsons.Num = int(cnt)
  97. c.Data["json"] = lib.JSONS{Code: 200, Msg: "ok!", Data: r_jsons}
  98. c.ServeJSON()
  99. return
  100. }
  101. // 添加-
  102. func (c *VerifyTemplateController) Add() {
  103. // 验证登录 User_is, User_r
  104. User_r, User_is := Account.Verification_Admin(c.Ctx.GetCookie("User_tokey"), c.GetString("User_tokey"))
  105. if !User_is {
  106. c.Data["json"] = lib.JSONS{Code: 201, Msg: "请重新登录!"}
  107. c.ServeJSON()
  108. return
  109. }
  110. T_name := c.GetString("T_name")
  111. T_sort, _ := c.GetInt("T_sort")
  112. T_class, _ := c.GetInt("T_class")
  113. var_ := VerifyTemplate.VerifyTemplate{
  114. T_class: T_class,
  115. T_name: T_name,
  116. T_sort: T_sort,
  117. }
  118. Id, is := VerifyTemplate.Add_VerifyTemplate(var_)
  119. if !is {
  120. c.Data["json"] = lib.JSONS{Code: 202, Msg: "添加失败!"}
  121. c.ServeJSON()
  122. return
  123. }
  124. System.Add_UserLogs_T(User_r.T_uuid, "验证模版", "添加", var_)
  125. c.Data["json"] = lib.JSONS{Code: 200, Msg: "ok!", Data: Id}
  126. c.ServeJSON()
  127. return
  128. }
  129. // 修改-
  130. func (c *VerifyTemplateController) Up() {
  131. // 验证登录 User_is, User_r
  132. User_r, User_is := Account.Verification_Admin(c.Ctx.GetCookie("User_tokey"), c.GetString("User_tokey"))
  133. if !User_is {
  134. c.Data["json"] = lib.JSONS{Code: 201, Msg: "请重新登录!"}
  135. c.ServeJSON()
  136. return
  137. }
  138. T_name := c.GetString("T_name")
  139. T_sort, T_sort_err := c.GetInt("T_sort")
  140. T_VerifyTemplate_id := c.GetString("T_VerifyTemplate_id")
  141. T_scheme := c.GetString("T_scheme")
  142. T_reporting := c.GetString("T_reporting")
  143. T_inspect := c.GetString("T_inspect")
  144. T_marking := c.GetString("T_marking")
  145. T_cover := c.GetString("T_cover")
  146. T_deploy := c.GetString("T_deploy")
  147. r, is := VerifyTemplate.Read_VerifyTemplate(T_VerifyTemplate_id)
  148. if !is {
  149. c.Data["json"] = lib.JSONS{Code: 202, Msg: "Id 错误!"}
  150. c.ServeJSON()
  151. return
  152. }
  153. // .......
  154. if len(T_name) > 0 {
  155. r.T_name = T_name
  156. }
  157. if len(T_scheme) > 0 {
  158. r.T_scheme = T_scheme
  159. }
  160. if len(T_reporting) > 0 {
  161. r.T_reporting = T_reporting
  162. }
  163. if len(T_inspect) > 0 {
  164. r.T_inspect = T_inspect
  165. }
  166. if len(T_marking) > 0 {
  167. r.T_marking = T_marking
  168. }
  169. if len(T_cover) > 0 {
  170. r.T_cover = T_cover
  171. }
  172. if len(T_deploy) > 0 {
  173. var deployList []VerifyTemplate.VerifyTemplateDeploy
  174. // 将 布点1|布点2|布点3| 格式替换为 [{"T_name":"布点1","T_scope":"布点范围1"},{"T_name":"布点2","T_scope":"布点范围2"}]
  175. if strings.Contains(T_deploy, "|") {
  176. deploys := strings.Split(strings.Trim(T_deploy, "|"), "|")
  177. for _, v := range deploys {
  178. deployList = append(deployList, VerifyTemplate.VerifyTemplateDeploy{T_name: v})
  179. }
  180. deploy, err := json.Marshal(deployList)
  181. if err != nil {
  182. logs.Error("JSON 序列化失败:", err)
  183. return
  184. }
  185. T_deploy = string(deploy)
  186. } else {
  187. err := json.Unmarshal([]byte(T_deploy), &deployList)
  188. if err != nil {
  189. logs.Error("JSON 反序列化失败:", err)
  190. return
  191. }
  192. }
  193. r.T_deploy = T_deploy
  194. }
  195. if T_sort_err == nil {
  196. r.T_sort = T_sort
  197. }
  198. // .......
  199. if !VerifyTemplate.Update_VerifyTemplate(r, "T_name", "T_sort", "T_scheme", "T_reporting", "T_inspect", "T_marking", "T_cover", "T_deploy") {
  200. c.Data["json"] = lib.JSONS{Code: 202, Msg: "修改失败!"}
  201. c.ServeJSON()
  202. return
  203. }
  204. System.Add_UserLogs_T(User_r.T_uuid, "验证模版", "修改", r)
  205. c.Data["json"] = lib.JSONS{Code: 200, Msg: "ok!"}
  206. c.ServeJSON()
  207. return
  208. }
  209. // 删除-
  210. func (c *VerifyTemplateController) Del() {
  211. // 验证登录 User_is, User_r
  212. User_r, User_is := Account.Verification_Admin(c.Ctx.GetCookie("User_tokey"), c.GetString("User_tokey"))
  213. if !User_is {
  214. c.Data["json"] = lib.JSONS{Code: 201, Msg: "请重新登录!"}
  215. c.ServeJSON()
  216. return
  217. }
  218. T_VerifyTemplate_id := c.GetString("T_VerifyTemplate_id")
  219. r, is := VerifyTemplate.Read_VerifyTemplate(T_VerifyTemplate_id)
  220. if !is {
  221. c.Data["json"] = lib.JSONS{Code: 202, Msg: "Id 错误!"}
  222. c.ServeJSON()
  223. return
  224. }
  225. if !VerifyTemplate.Delete_VerifyTemplate(r) {
  226. c.Data["json"] = lib.JSONS{Code: 202, Msg: "删除失败!"}
  227. c.ServeJSON()
  228. return
  229. }
  230. mapList, _ := VerifyTemplate.Read_VerifyTemplateMap_List(T_VerifyTemplate_id, 0, 0)
  231. for _, v := range mapList {
  232. if vtm, is := VerifyTemplate.Read_VerifyTemplateMap(v.T_id); is {
  233. VerifyTemplate.Delete_VerifyTemplateMap(vtm)
  234. }
  235. }
  236. System.Add_UserLogs_T(User_r.T_uuid, "验证模版", "删除", r)
  237. c.Data["json"] = lib.JSONS{Code: 200, Msg: "ok!"}
  238. c.ServeJSON()
  239. return
  240. }
  241. // 删除-
  242. func (c *VerifyTemplateController) Get() {
  243. // 验证登录 User_is, User_r
  244. _, User_is := Account.Verification_Admin(c.Ctx.GetCookie("User_tokey"), c.GetString("User_tokey"))
  245. if !User_is {
  246. c.Data["json"] = lib.JSONS{Code: 201, Msg: "请重新登录!"}
  247. c.ServeJSON()
  248. return
  249. }
  250. T_VerifyTemplate_id := c.GetString("T_VerifyTemplate_id")
  251. r, is := VerifyTemplate.Read_VerifyTemplate(T_VerifyTemplate_id)
  252. if !is {
  253. c.Data["json"] = lib.JSONS{Code: 202, Msg: "Id 错误!"}
  254. c.ServeJSON()
  255. return
  256. }
  257. c.Data["json"] = lib.JSONS{Code: 200, Msg: "ok!", Data: VerifyTemplate.VerifyTemplateToVerifyTemplate_R(r)}
  258. c.ServeJSON()
  259. return
  260. }
  261. // 复制-
  262. func (c *VerifyTemplateController) Copy() {
  263. // 验证登录 User_is, User_r
  264. User_r, User_is := Account.Verification_Admin(c.Ctx.GetCookie("User_tokey"), c.GetString("User_tokey"))
  265. if !User_is {
  266. c.Data["json"] = lib.JSONS{Code: 201, Msg: "请重新登录!"}
  267. c.ServeJSON()
  268. return
  269. }
  270. T_VerifyTemplate_id := c.GetString("T_VerifyTemplate_id")
  271. T_name := c.GetString("T_name")
  272. r, is := VerifyTemplate.Read_VerifyTemplate(T_VerifyTemplate_id)
  273. if !is {
  274. c.Data["json"] = lib.JSONS{Code: 202, Msg: "Id 错误!"}
  275. c.ServeJSON()
  276. return
  277. }
  278. var_ := VerifyTemplate.VerifyTemplate{
  279. T_class: r.T_class,
  280. T_name: T_name,
  281. T_sort: r.T_sort,
  282. T_deploy: r.T_deploy,
  283. }
  284. new_id, is := VerifyTemplate.Add_VerifyTemplate(var_)
  285. if !is {
  286. c.Data["json"] = lib.JSONS{Code: 202, Msg: "复制失败!"}
  287. c.ServeJSON()
  288. return
  289. }
  290. mapList, _ := VerifyTemplate.Read_VerifyTemplateMap_List(T_VerifyTemplate_id, 0, 0)
  291. tempMap := make(map[string]struct{})
  292. idList := make([]string, len(mapList))
  293. // 生成mapList长度的T_id
  294. for i := 0; i < len(mapList); i++ {
  295. // 生成编号
  296. rand_x := 0
  297. T_id := ""
  298. for true {
  299. T_id = lib.GetRandstring(4, "", int64(rand_x))
  300. _, is = VerifyTemplate.Read_VerifyTemplateMap(T_id)
  301. if !is {
  302. if _, ok := tempMap[T_id]; !ok {
  303. break
  304. }
  305. }
  306. rand_x += 1
  307. }
  308. tempMap[T_id] = struct{}{}
  309. idList[i] = T_id
  310. }
  311. mapInsertList := make([]VerifyTemplate.VerifyTemplateMap, 0)
  312. for i, v := range mapList {
  313. vtm := VerifyTemplate.VerifyTemplateMap{
  314. T_id: idList[i],
  315. T_VerifyTemplate_id: new_id,
  316. T_name: v.T_name,
  317. T_text: v.T_text,
  318. T_label: v.T_label,
  319. T_source: v.T_source,
  320. T_sort: v.T_sort,
  321. T_Required: v.T_Required,
  322. T_Construction: v.T_Construction,
  323. T_flow_sort: v.T_flow_sort,
  324. T_max_time: v.T_max_time,
  325. T_min_time: v.T_min_time,
  326. }
  327. mapInsertList = append(mapInsertList, vtm)
  328. }
  329. _, is = VerifyTemplate.Add_VerifyTemplateMapMulti(mapInsertList)
  330. if !is {
  331. c.Data["json"] = lib.JSONS{Code: 202, Msg: "复制失败!"}
  332. c.ServeJSON()
  333. return
  334. }
  335. System.Add_UserLogs_T(User_r.T_uuid, "验证模版", "复制", var_)
  336. c.Data["json"] = lib.JSONS{Code: 200, Msg: "ok!", Data: new_id}
  337. c.ServeJSON()
  338. return
  339. }
  340. /// -----------------------------------------------------------------------------
  341. // 标签列表 -
  342. func (c *VerifyTemplateController) Map_List() {
  343. // 验证登录 User_is, User_r
  344. _, User_is := Account.Verification_Admin(c.Ctx.GetCookie("User_tokey"), c.GetString("User_tokey"))
  345. if !User_is {
  346. c.Data["json"] = lib.JSONS{Code: 201, Msg: "请重新登录!"}
  347. c.ServeJSON()
  348. return
  349. }
  350. var r_jsons lib.R_JSONS
  351. // page, _ := c.GetInt("page")
  352. //
  353. // if page < 1 {
  354. // page = 1
  355. // }
  356. //
  357. // page_z, _ := c.GetInt("page_z")
  358. //
  359. // if page_z < 1 {
  360. // page_z = conf.Page_size
  361. // }
  362. T_sort, _ := c.GetInt("T_sort") // 排序
  363. T_flow_sort, _ := c.GetInt("T_flow_sort") // 验证流程排序
  364. T_VerifyTemplate_id := c.GetString("T_VerifyTemplate_id")
  365. var cnt int64
  366. List, cnt := VerifyTemplate.Read_VerifyTemplateMap_List(T_VerifyTemplate_id, T_sort, T_flow_sort)
  367. r_jsons.List = List
  368. r_jsons.Num = int(cnt)
  369. c.Data["json"] = lib.JSONS{Code: 200, Msg: "ok!", Data: r_jsons}
  370. c.ServeJSON()
  371. return
  372. }
  373. // 标签添加-
  374. func (c *VerifyTemplateController) Map_Add() {
  375. // 验证登录 User_is, User_r
  376. User_r, User_is := Account.Verification_Admin(c.Ctx.GetCookie("User_tokey"), c.GetString("User_tokey"))
  377. if !User_is {
  378. c.Data["json"] = lib.JSONS{Code: 201, Msg: "请重新登录!"}
  379. c.ServeJSON()
  380. return
  381. }
  382. T_VerifyTemplate_id := c.GetString("T_VerifyTemplate_id")
  383. T_name := c.GetString("T_name")
  384. T_text := c.GetString("T_text")
  385. T_label, _ := c.GetInt("T_label")
  386. T_source, _ := c.GetInt("T_source")
  387. T_sort, _ := c.GetInt("T_sort")
  388. T_Required, _ := c.GetInt("T_Required")
  389. T_Construction, _ := c.GetInt("T_Construction")
  390. T_flow_sort, _ := c.GetInt("T_flow_sort")
  391. T_max_time, _ := c.GetInt("T_max_time")
  392. T_min_time, _ := c.GetInt("T_min_time")
  393. var_ := VerifyTemplate.VerifyTemplateMap{
  394. T_VerifyTemplate_id: T_VerifyTemplate_id,
  395. T_name: T_name,
  396. T_text: T_text,
  397. T_label: T_label,
  398. T_source: T_source,
  399. T_sort: T_sort,
  400. T_Required: T_Required,
  401. T_Construction: T_Construction,
  402. T_flow_sort: T_flow_sort,
  403. T_max_time: T_max_time,
  404. T_min_time: T_min_time,
  405. }
  406. Id, is := VerifyTemplate.Add_VerifyTemplateMap(var_)
  407. if !is {
  408. c.Data["json"] = lib.JSONS{Code: 202, Msg: "添加失败!"}
  409. c.ServeJSON()
  410. return
  411. }
  412. System.Add_UserLogs_T(User_r.T_uuid, "验证模版标签", "添加", var_)
  413. c.Data["json"] = lib.JSONS{Code: 200, Msg: "ok!", Data: Id}
  414. c.ServeJSON()
  415. return
  416. }
  417. // 标签修改-
  418. func (c *VerifyTemplateController) Map_Up() {
  419. // 验证登录 User_is, User_r
  420. User_r, User_is := Account.Verification_Admin(c.Ctx.GetCookie("User_tokey"), c.GetString("User_tokey"))
  421. if !User_is {
  422. c.Data["json"] = lib.JSONS{Code: 201, Msg: "请重新登录!"}
  423. c.ServeJSON()
  424. return
  425. }
  426. T_name := c.GetString("T_name")
  427. T_text := c.GetString("T_text")
  428. T_label, T_label_err := c.GetInt("T_label")
  429. T_sort, T_sort_err := c.GetInt("T_sort")
  430. T_source, T_source_err := c.GetInt("T_source")
  431. T_Required, _ := c.GetInt("T_Required")
  432. T_Construction, _ := c.GetInt("T_Construction")
  433. T_min_time, T_min_time_err := c.GetInt("T_min_time")
  434. T_max_time, T_max_time_err := c.GetInt("T_max_time")
  435. T_flow_sort, T_flow_sort_err := c.GetInt("T_flow_sort")
  436. T_id := c.GetString("T_id")
  437. r, is := VerifyTemplate.Read_VerifyTemplateMap(T_id)
  438. if !is {
  439. c.Data["json"] = lib.JSONS{Code: 202, Msg: "Id 错误!"}
  440. c.ServeJSON()
  441. return
  442. }
  443. // .......
  444. if len(T_name) > 0 {
  445. r.T_name = T_name
  446. }
  447. if len(T_text) > 0 {
  448. r.T_text = T_text
  449. }
  450. if T_label_err == nil {
  451. r.T_label = T_label
  452. }
  453. if T_sort_err == nil {
  454. r.T_sort = T_sort
  455. }
  456. if T_source_err == nil {
  457. r.T_source = T_source
  458. }
  459. if T_min_time_err == nil {
  460. r.T_min_time = T_min_time
  461. }
  462. if T_max_time_err == nil {
  463. r.T_max_time = T_max_time
  464. }
  465. if T_flow_sort_err == nil {
  466. r.T_flow_sort = T_flow_sort
  467. }
  468. r.T_Required = T_Required
  469. r.T_Construction = T_Construction
  470. if !VerifyTemplate.Update_VerifyTemplateMap(r, "T_name", "T_label", "T_text", "T_sort", "T_source", "T_min_time", "T_max_time", "T_flow_sort", "T_Required", "T_Construction") {
  471. c.Data["json"] = lib.JSONS{Code: 202, Msg: "修改失败!"}
  472. c.ServeJSON()
  473. return
  474. }
  475. System.Add_UserLogs_T(User_r.T_uuid, "验证模版标签", "修改", r)
  476. c.Data["json"] = lib.JSONS{Code: 200, Msg: "ok!"}
  477. c.ServeJSON()
  478. return
  479. }
  480. // 标签删除-
  481. func (c *VerifyTemplateController) Map_Del() {
  482. // 验证登录 User_is, User_r
  483. User_r, User_is := Account.Verification_Admin(c.Ctx.GetCookie("User_tokey"), c.GetString("User_tokey"))
  484. if !User_is {
  485. c.Data["json"] = lib.JSONS{Code: 201, Msg: "请重新登录!"}
  486. c.ServeJSON()
  487. return
  488. }
  489. T_id := c.GetString("T_id")
  490. if r, is := VerifyTemplate.Read_VerifyTemplateMap(T_id); is {
  491. if !VerifyTemplate.Delete_VerifyTemplateMap(r) {
  492. c.Data["json"] = lib.JSONS{Code: 202, Msg: "删除失败!"}
  493. c.ServeJSON()
  494. return
  495. }
  496. System.Add_UserLogs_T(User_r.T_uuid, "验证模版标签", "删除", r)
  497. c.Data["json"] = lib.JSONS{Code: 200, Msg: "ok!"}
  498. c.ServeJSON()
  499. return
  500. }
  501. c.Data["json"] = lib.JSONS{Code: 202, Msg: "Id 错误!"}
  502. c.ServeJSON()
  503. return
  504. }
  505. /// -----------------------------------------------------------------------------
  506. // 标签数据列表 -
  507. func (c *VerifyTemplateController) Map_Data_List() {
  508. // 验证登录 User_is, User_r
  509. _, User_is := Account.Verification_Admin(c.Ctx.GetCookie("User_tokey"), c.GetString("User_tokey"))
  510. if !User_is {
  511. c.Data["json"] = lib.JSONS{Code: 201, Msg: "请重新登录!"}
  512. c.ServeJSON()
  513. return
  514. }
  515. T_VerifyTemplate_id := c.GetString("T_VerifyTemplate_id")
  516. T_source, _ := c.GetInt("T_source")
  517. T_flow, _ := c.GetInt("T_flow") // app 时间流程
  518. if T_flow == 0 && T_source == 0 {
  519. c.Data["json"] = lib.JSONS{Code: 202, Msg: "T_source Err!"}
  520. c.ServeJSON()
  521. return
  522. }
  523. T_task_id := c.GetString("T_task_id")
  524. task, is := Task.Read_Task(T_task_id)
  525. if !is {
  526. c.Data["json"] = lib.JSONS{Code: 202, Msg: "T_task_id 错误!"}
  527. c.ServeJSON()
  528. return
  529. }
  530. Map_List := VerifyTemplate.Read_VerifyTemplateMap_List_For_Data(T_VerifyTemplate_id, T_source, T_flow)
  531. Data := VerifyTemplate.Read_VerifyTemplateMapData_List(T_source, T_task_id, T_VerifyTemplate_id, Map_List)
  532. type JSONS struct {
  533. //必须的大写开头
  534. Code int16
  535. Msg string
  536. Data interface{} // 泛型
  537. T_step int
  538. }
  539. c.Data["json"] = JSONS{Code: 200, Msg: "ok!", Data: Data, T_step: task.T_step}
  540. c.ServeJSON()
  541. return
  542. }
  543. // 添加标签数据
  544. func (c *VerifyTemplateController) Map_Data_Pu() {
  545. //验证登录 User_is, User_r
  546. var err error
  547. //token := c.Ctx.Request.Header.Get("user_tokey")
  548. //User_r, User_is := Account.Verification_Admin(token, "")
  549. //if !User_is {
  550. // c.Data["json"] = lib.JSONS{Code: 201, Msg: "请重新登录!"}
  551. // c.ServeJSON()
  552. // return
  553. //}
  554. //err = albb.DescribeInstances()
  555. ////err := RunInstances(tea.StringSlice(os.Args[1:]))
  556. //if err != nil {
  557. // c.Data["json"] = lib.JSONS{Code: 202, Msg: "服务启动失败!"}
  558. // c.ServeJSON()
  559. // return
  560. //}
  561. type RequestBody struct {
  562. User_tokey string
  563. T_source int
  564. T_task_id string
  565. T_VerifyTemplate_id string
  566. T_step int // 进行步骤下标
  567. VerifyTemplateMapData []VerifyTemplate.VerifyTemplateMapData_R
  568. }
  569. var body RequestBody
  570. data := c.Ctx.Input.RequestBody
  571. err = json.Unmarshal(data, &body)
  572. if err != nil {
  573. c.Data["json"] = lib.JSONS{Code: 202, Msg: "json返序列化失败:" + err.Error()}
  574. c.ServeJSON()
  575. }
  576. User_r, User_is := Account.Verification_Admin(body.User_tokey, "")
  577. if !User_is {
  578. System.Add_UserLogs_T(User_r.T_uuid, "验证模版标签数据", "未登录-保存", body)
  579. c.Data["json"] = lib.JSONS{Code: 201, Msg: "请重新登录!"}
  580. c.ServeJSON()
  581. return
  582. }
  583. task, is := Task.Read_Task(body.T_task_id)
  584. if !is {
  585. c.Data["json"] = lib.JSONS{Code: 202, Msg: "T_task_id 错误!"}
  586. c.ServeJSON()
  587. return
  588. }
  589. task.T_step = body.T_step
  590. if !Task.Update_Task(task, "T_step") {
  591. c.Data["json"] = lib.JSONS{Code: 202, Msg: "修改任务步骤失败!"}
  592. c.ServeJSON()
  593. return
  594. }
  595. MapDataList := make([]VerifyTemplate.VerifyTemplateMapData, 0)
  596. for _, v := range body.VerifyTemplateMapData {
  597. val := VerifyTemplate.VerifyTemplateMapData{
  598. T_source: v.T_source,
  599. T_task_id: body.T_task_id,
  600. T_VerifyTemplate_id: body.T_VerifyTemplate_id,
  601. T_VerifyTemplateMap_id: v.T_VerifyTemplateMap_id,
  602. T_Required: v.T_Required,
  603. T_Construction: v.T_Construction,
  604. T_flow_sort: v.T_flow_sort,
  605. T_max_time: v.T_max_time,
  606. T_min_time: v.T_min_time,
  607. T_value: v.T_value,
  608. T_start_time: v.T_start_time,
  609. }
  610. MapDataList = append(MapDataList, val)
  611. if v.T_label == 16 && len(v.T_value) > 0 {
  612. // 判断验证模版标签-描述是否存在该值,不存在则添加
  613. verifyTemplateMap, exist := VerifyTemplate.Read_VerifyTemplateMap(v.T_VerifyTemplateMap_id)
  614. if exist {
  615. // 用|分割成列表
  616. options := lib.SplitStringSeparator(verifyTemplateMap.T_text, "|")
  617. // 检查是否存在
  618. found := false
  619. for _, opt := range options {
  620. if opt == v.T_value {
  621. found = true
  622. break
  623. }
  624. }
  625. if !found {
  626. verifyTemplateMap.T_text = verifyTemplateMap.T_text + "|" + v.T_value
  627. VerifyTemplate.Update_VerifyTemplateMap(verifyTemplateMap, "T_text")
  628. }
  629. }
  630. }
  631. }
  632. ids, is := VerifyTemplate.AddOrUpdate_VerifyTemplateMapData_ADD_History(MapDataList, body.T_source, User_r.T_uuid)
  633. if !is {
  634. c.Data["json"] = lib.JSONS{Code: 202, Msg: "保存失败"}
  635. c.ServeJSON()
  636. return
  637. }
  638. System.Add_UserLogs_T(User_r.T_uuid, "验证模版标签数据", "保存", body)
  639. c.Data["json"] = lib.JSONS{Code: 200, Msg: "ok!", Data: ids}
  640. c.ServeJSON()
  641. return
  642. }
  643. func (c *VerifyTemplateController) Map_Data_Copy() {
  644. // 验证登录 User_is, User_r
  645. User_r, User_is := Account.Verification_Admin(c.Ctx.GetCookie("User_tokey"), c.GetString("User_tokey"))
  646. if !User_is {
  647. c.Data["json"] = lib.JSONS{Code: 201, Msg: "请重新登录!"}
  648. c.ServeJSON()
  649. return
  650. }
  651. T_source, _ := c.GetInt("T_source")
  652. T_flow, _ := c.GetInt("T_flow")
  653. if T_flow == 0 && T_source == 0 {
  654. c.Data["json"] = lib.JSONS{Code: 202, Msg: "T_source Err!"}
  655. c.ServeJSON()
  656. return
  657. }
  658. T_copy_task_id := c.GetString("T_copy_task_id")
  659. copy_task, is := Task.Read_Task(T_copy_task_id)
  660. if !is {
  661. c.Data["json"] = lib.JSONS{Code: 202, Msg: "T_copy_task_id 错误!"}
  662. c.ServeJSON()
  663. return
  664. }
  665. T_paste_task_id := c.GetString("T_paste_task_id")
  666. paste_task, is := Task.Read_Task(T_paste_task_id)
  667. if !is {
  668. c.Data["json"] = lib.JSONS{Code: 202, Msg: "T_paste_task_id 错误!"}
  669. c.ServeJSON()
  670. return
  671. }
  672. if copy_task.T_VerifyTemplate_id != paste_task.T_VerifyTemplate_id {
  673. c.Data["json"] = lib.JSONS{Code: 202, Msg: "仅支持相同模版间复制!"}
  674. c.ServeJSON()
  675. return
  676. }
  677. list := VerifyTemplate.Read_MapData_List(T_source, T_copy_task_id, copy_task.T_VerifyTemplate_id)
  678. MapDataList := make([]VerifyTemplate.VerifyTemplateMapData, 0)
  679. for _, v := range list {
  680. val := VerifyTemplate.VerifyTemplateMapData{
  681. T_source: T_source,
  682. T_task_id: paste_task.T_task_id,
  683. T_VerifyTemplate_id: paste_task.T_VerifyTemplate_id,
  684. T_VerifyTemplateMap_id: v.T_VerifyTemplateMap_id,
  685. T_Required: v.T_Required,
  686. T_Construction: v.T_Construction,
  687. T_flow_sort: v.T_flow_sort,
  688. T_max_time: v.T_max_time,
  689. T_min_time: v.T_min_time,
  690. T_value: v.T_value,
  691. }
  692. MapDataList = append(MapDataList, val)
  693. }
  694. var ids []int64
  695. ids, is = VerifyTemplate.AddOrUpdate_VerifyTemplateMapData_ADD_History(MapDataList, T_source, User_r.T_uuid)
  696. if !is {
  697. c.Data["json"] = lib.JSONS{Code: 202, Msg: "保存失败"}
  698. c.ServeJSON()
  699. return
  700. }
  701. System.Add_UserLogs_T(User_r.T_uuid, "验证模版标签数据", "复制", MapDataList)
  702. c.Data["json"] = lib.JSONS{Code: 200, Msg: "ok!", Data: ids}
  703. c.ServeJSON()
  704. return
  705. }
  706. // 添加标签数据
  707. func (c *VerifyTemplateController) Map_Data_History_List() {
  708. // 验证登录 User_is, User_r
  709. _, User_is := Account.Verification_Admin(c.Ctx.GetCookie("User_tokey"), c.GetString("User_tokey"))
  710. if !User_is {
  711. c.Data["json"] = lib.JSONS{Code: 201, Msg: "请重新登录!"}
  712. c.ServeJSON()
  713. return
  714. }
  715. T_task_id := c.GetString("T_task_id")
  716. T_source, _ := c.GetInt("T_source")
  717. _, is := Task.Read_Task(T_task_id)
  718. if !is {
  719. c.Data["json"] = lib.JSONS{Code: 202, Msg: "T_task_id 错误!"}
  720. c.ServeJSON()
  721. return
  722. }
  723. AdminMap := Account.AdminListToMap(Account.Read_Admin_List_ALL_1())
  724. c.Data["json"] = lib.JSONS{Code: 200, Msg: "ok!", Data: VerifyTemplate.Read_VerifyTemplateMapDataHistory_History_List(T_task_id, T_source, AdminMap)}
  725. c.ServeJSON()
  726. return
  727. }
  728. // 标签数据列表 -
  729. func (c *VerifyTemplateController) Map_Data_History_Data_List() {
  730. // 验证登录 User_is, User_r
  731. _, User_is := Account.Verification_Admin(c.Ctx.GetCookie("User_tokey"), c.GetString("User_tokey"))
  732. if !User_is {
  733. c.Data["json"] = lib.JSONS{Code: 201, Msg: "请重新登录!"}
  734. c.ServeJSON()
  735. return
  736. }
  737. T_time := c.GetString("T_time")
  738. if len(T_time) == 0 {
  739. c.Data["json"] = lib.JSONS{Code: 202, Msg: "请选择时间点!"}
  740. c.ServeJSON()
  741. return
  742. }
  743. T_source, _ := c.GetInt("T_source")
  744. if T_source == 0 {
  745. c.Data["json"] = lib.JSONS{Code: 202, Msg: "T_source Err!"}
  746. c.ServeJSON()
  747. return
  748. }
  749. T_task_id := c.GetString("T_task_id")
  750. task, is := Task.Read_Task(T_task_id)
  751. if !is {
  752. c.Data["json"] = lib.JSONS{Code: 202, Msg: "T_task_id 错误!"}
  753. c.ServeJSON()
  754. return
  755. }
  756. Map_List := VerifyTemplate.Read_VerifyTemplateMap_List_For_Data(task.T_VerifyTemplate_id, T_source, 0)
  757. Data := VerifyTemplate.Read_VerifyTemplateMapDataHistory_List(T_source, T_task_id, task.T_VerifyTemplate_id, T_time, Map_List)
  758. type JSONS struct {
  759. //必须的大写开头
  760. Code int16
  761. Msg string
  762. Data interface{} // 泛型
  763. T_step int
  764. }
  765. c.Data["json"] = JSONS{Code: 200, Msg: "ok!", Data: Data, T_step: task.T_step}
  766. c.ServeJSON()
  767. return
  768. }
  769. // 清除数据
  770. func (c *VerifyTemplateController) Map_Data_Clear_Value() {
  771. // 验证登录 User_is, User_r
  772. User_r, User_is := Account.Verification_Admin(c.Ctx.GetCookie("User_tokey"), c.GetString("User_tokey"))
  773. if !User_is {
  774. c.Data["json"] = lib.JSONS{Code: 201, Msg: "请重新登录!"}
  775. c.ServeJSON()
  776. return
  777. }
  778. T_VerifyTemplate_id := c.GetString("T_VerifyTemplate_id")
  779. T_VerifyTemplateMap_id := c.GetString("T_VerifyTemplateMap_id")
  780. T_task_id := c.GetString("T_task_id")
  781. _, is := Task.Read_Task(T_task_id)
  782. if !is {
  783. c.Data["json"] = lib.JSONS{Code: 202, Msg: "T_task_id 错误!"}
  784. c.ServeJSON()
  785. return
  786. }
  787. VerifyTemplate.Clear_VerifyTemplateMapData_T_value(T_task_id, T_VerifyTemplate_id, T_VerifyTemplateMap_id)
  788. System.Add_UserLogs_T(User_r.T_uuid, "验证模版标签数据", "清除数据", fmt.Sprintf("T_task_id:%s T_VerifyTemplate_id:%s T_VerifyTemplateMap_id:%s", T_task_id, T_VerifyTemplate_id, T_VerifyTemplateMap_id))
  789. c.Data["json"] = lib.JSONS{Code: 200, Msg: "ok!"}
  790. c.ServeJSON()
  791. return
  792. }
  793. // 历史数据恢复
  794. func (c *VerifyTemplateController) Map_Data_History_Recover() {
  795. // 验证登录 User_is, User_r
  796. User_r, User_is := Account.Verification_Admin(c.Ctx.GetCookie("User_tokey"), c.GetString("User_tokey"))
  797. if !User_is {
  798. c.Data["json"] = lib.JSONS{Code: 201, Msg: "请重新登录!"}
  799. c.ServeJSON()
  800. return
  801. }
  802. T_time := c.GetString("T_time")
  803. if len(T_time) == 0 {
  804. c.Data["json"] = lib.JSONS{Code: 202, Msg: "请选择时间点!"}
  805. c.ServeJSON()
  806. return
  807. }
  808. T_source, _ := c.GetInt("T_source")
  809. if T_source == 0 {
  810. c.Data["json"] = lib.JSONS{Code: 202, Msg: "T_source Err!"}
  811. c.ServeJSON()
  812. return
  813. }
  814. T_task_id := c.GetString("T_task_id")
  815. task, is := Task.Read_Task(T_task_id)
  816. if !is {
  817. c.Data["json"] = lib.JSONS{Code: 202, Msg: "T_task_id 错误!"}
  818. c.ServeJSON()
  819. return
  820. }
  821. HistoryList := VerifyTemplate.Read_MapDataHistory_List(T_source, T_task_id, task.T_VerifyTemplate_id, T_time)
  822. list := VerifyTemplate.Read_MapData_List(T_source, T_task_id, task.T_VerifyTemplate_id)
  823. HistoryListMap := make(map[string]VerifyTemplate.VerifyTemplateMapDataHistory)
  824. for _, data := range HistoryList {
  825. HistoryListMap[data.T_VerifyTemplateMap_id] = data
  826. }
  827. MapDataList := make([]VerifyTemplate.VerifyTemplateMapData, 0)
  828. for _, v := range list {
  829. if len(v.T_value) > 0 {
  830. continue
  831. }
  832. if HistoryListMap[v.T_VerifyTemplateMap_id].T_value == "" {
  833. continue
  834. }
  835. val := VerifyTemplate.VerifyTemplateMapData{
  836. T_source: T_source,
  837. T_task_id: task.T_task_id,
  838. T_VerifyTemplate_id: task.T_VerifyTemplate_id,
  839. T_VerifyTemplateMap_id: v.T_VerifyTemplateMap_id,
  840. T_Required: v.T_Required,
  841. T_Construction: v.T_Construction,
  842. T_flow_sort: v.T_flow_sort,
  843. T_max_time: v.T_max_time,
  844. T_min_time: v.T_min_time,
  845. T_value: HistoryListMap[v.T_VerifyTemplateMap_id].T_value,
  846. }
  847. MapDataList = append(MapDataList, val)
  848. }
  849. var ids []int64
  850. ids, is = VerifyTemplate.AddOrUpdate_VerifyTemplateMapData(MapDataList)
  851. if !is {
  852. c.Data["json"] = lib.JSONS{Code: 202, Msg: "保存失败"}
  853. c.ServeJSON()
  854. return
  855. }
  856. System.Add_UserLogs_T(User_r.T_uuid, "验证模版标签数据", "恢复", MapDataList)
  857. c.Data["json"] = lib.JSONS{Code: 200, Msg: "ok!", Data: ids}
  858. c.ServeJSON()
  859. return
  860. }
  861. func (c *VerifyTemplateController) Class_List() {
  862. // 验证登录 User_is, User_r
  863. User_r, User_is := Account.Verification_Admin(c.Ctx.GetCookie("User_tokey"), c.GetString("User_tokey"))
  864. if !User_is {
  865. c.Data["json"] = lib.JSONS{Code: 201, Msg: "请重新登录!"}
  866. c.ServeJSON()
  867. return
  868. }
  869. logs.Debug("经销商id", User_r.T_Distributor_id)
  870. // Fixme 经销商只能获取绑定的验证模版分类 绑定功能做好之后再打开此注释
  871. //if len(User_r.T_Distributor_id) > 0 {
  872. // c.Data["json"] = lib.JSONS{Code: 200, Msg: "ok!", Data: Distributor.Read_DistributorVerifyTemplateClass_List(User_r.T_Distributor_id)}
  873. // c.ServeJSON()
  874. // return
  875. //}
  876. c.Data["json"] = lib.JSONS{Code: 200, Msg: "ok!", Data: VerifyTemplate.Read_VerifyTemplateClass_List()}
  877. c.ServeJSON()
  878. return
  879. }
  880. func (c *VerifyTemplateController) Class_Add() {
  881. // 验证登录 User_is, User_r
  882. User_r, User_is := Account.Verification_Admin(c.Ctx.GetCookie("User_tokey"), c.GetString("User_tokey"))
  883. if !User_is {
  884. c.Data["json"] = lib.JSONS{Code: 201, Msg: "请重新登录!"}
  885. c.ServeJSON()
  886. return
  887. }
  888. T_name := c.GetString("T_name")
  889. T_fid, _ := c.GetInt("T_fid")
  890. var_ := VerifyTemplate.VerifyTemplateClass{
  891. T_name: T_name,
  892. T_fid: T_fid,
  893. T_State: 1,
  894. }
  895. Id, err := VerifyTemplate.Add_VerifyTemplateClass(var_)
  896. if err != nil {
  897. c.Data["json"] = lib.JSONS{Code: 203, Msg: "添加失败"}
  898. c.ServeJSON()
  899. return
  900. }
  901. System.Add_UserLogs_T(User_r.T_uuid, "模版分类", "添加", var_)
  902. c.Data["json"] = lib.JSONS{Code: 200, Msg: "ok!", Data: Id}
  903. c.ServeJSON()
  904. return
  905. }
  906. func (c *VerifyTemplateController) Class_Up() {
  907. User_r, User_is := Account.Verification_Admin(c.Ctx.GetCookie("User_tokey"), c.GetString("User_tokey"))
  908. if !User_is {
  909. c.Data["json"] = lib.JSONS{Code: 201, Msg: "请重新登录!"}
  910. c.ServeJSON()
  911. return
  912. }
  913. T_id, _ := c.GetInt("T_id")
  914. T_name := c.GetString("T_name")
  915. R_VerifyTemplateToolClass, err := VerifyTemplate.Read_VerifyTemplateClass_ById(T_id)
  916. if err != nil {
  917. c.Data["json"] = lib.JSONS{Code: 203, Msg: "T_id Err!"}
  918. c.ServeJSON()
  919. return
  920. }
  921. if len(T_name) > 0 {
  922. R_VerifyTemplateToolClass.T_name = T_name
  923. }
  924. if is := VerifyTemplate.Update_VerifyTemplateClass(R_VerifyTemplateToolClass, "T_name"); !is {
  925. c.Data["json"] = lib.JSONS{Code: 203, Msg: "修改失败"}
  926. c.ServeJSON()
  927. return
  928. }
  929. System.Add_UserLogs_T(User_r.T_uuid, "模版分类", "修改", R_VerifyTemplateToolClass)
  930. c.Data["json"] = lib.JSONS{Code: 200, Msg: "ok!"}
  931. c.ServeJSON()
  932. return
  933. }
  934. func (c *VerifyTemplateController) Class_Del() {
  935. User_r, User_is := Account.Verification_Admin(c.Ctx.GetCookie("User_tokey"), c.GetString("User_tokey"))
  936. if !User_is {
  937. c.Data["json"] = lib.JSONS{Code: 201, Msg: "请重新登录!"}
  938. c.ServeJSON()
  939. return
  940. }
  941. T_id, _ := c.GetInt("T_id")
  942. R_VerifyTemplateToolClass, err := VerifyTemplate.Read_VerifyTemplateClass_ById(T_id)
  943. if err != nil {
  944. c.Data["json"] = lib.JSONS{Code: 203, Msg: "T_id Err!"}
  945. c.ServeJSON()
  946. return
  947. }
  948. ids := VerifyTemplate.ReadVerifyTemplateClassIds_T_path(R_VerifyTemplateToolClass.T_path)
  949. if is := VerifyTemplate.Delete_VerifyTemplateClass_ByIds(ids); !is {
  950. c.Data["json"] = lib.JSONS{Code: 202, Msg: "删除失败!"}
  951. c.ServeJSON()
  952. return
  953. }
  954. System.Add_UserLogs(User_r.T_uuid, "模版分类", "删除", strconv.Itoa(T_id))
  955. c.Data["json"] = lib.JSONS{Code: 200, Msg: "ok!"}
  956. c.ServeJSON()
  957. return
  958. }
  959. // 复制验证模版-分类-标签
  960. func (c *VerifyTemplateController) Class_Copy() {
  961. // 验证登录 User_is, User_r
  962. User_r, User_is := Account.Verification_Admin(c.Ctx.GetCookie("User_tokey"), c.GetString("User_tokey"))
  963. if !User_is {
  964. c.Data["json"] = lib.JSONS{Code: 201, Msg: "请重新登录!"}
  965. c.ServeJSON()
  966. return
  967. }
  968. T_id, _ := c.GetInt("T_id") // 要复制的信息采集分类id
  969. T_name := c.GetString("T_name")
  970. // 查询要复制的信息采集分类id
  971. R_VerifyTemplateClass, err := VerifyTemplate.Read_VerifyTemplateClass_ById(T_id)
  972. if err != nil {
  973. c.Data["json"] = lib.JSONS{Code: 203, Msg: "T_id Err!"}
  974. c.ServeJSON()
  975. return
  976. }
  977. if len(T_name) > 0 && T_name != R_VerifyTemplateClass.T_name {
  978. R_VerifyTemplateClass.T_name = T_name
  979. } else {
  980. R_VerifyTemplateClass.T_name = R_VerifyTemplateClass.T_name + "_副本"
  981. }
  982. _, err = VerifyTemplate.CopyVerifyTemplateClassTree(R_VerifyTemplateClass.T_path, R_VerifyTemplateClass.T_fid, R_VerifyTemplateClass.T_name)
  983. if err != nil {
  984. c.Data["json"] = lib.JSONS{Code: 202, Msg: "复制验证模版分类失败"}
  985. c.ServeJSON()
  986. return
  987. }
  988. System.Add_UserLogs_T(User_r.T_uuid, "验证模版分类", "复制", T_id)
  989. c.Data["json"] = lib.JSONS{Code: 200, Msg: "ok!"}
  990. c.ServeJSON()
  991. return
  992. }