custom_api_controller.go 35KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140
  1. package admin_api_controllers
  2. import (
  3. "XT_Admin_Api/enums"
  4. "XT_Admin_Api/models"
  5. "XT_Admin_Api/service"
  6. "fmt"
  7. "time"
  8. )
  9. type CustomAPIController struct {
  10. AdminBaseAPIAuthController
  11. }
  12. func (this *CustomAPIController) CheckCustom() {
  13. id, _ := this.GetInt64("id")
  14. ci, _ := service.FindCustomInfoByIDTwo(id)
  15. if ci.ID == 0 {
  16. this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
  17. return
  18. }
  19. ci.IsCheck = 1
  20. ci.CheckPerson = this.GetAdminInfo().Name
  21. err := service.SaveCustomTwo(ci)
  22. if err != nil {
  23. this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
  24. return
  25. }
  26. this.ServeSuccessJSON(map[string]interface{}{
  27. "msg": "审核成功",
  28. })
  29. }
  30. func (this *CustomAPIController) CreateCustom() {
  31. name := this.GetString("name")
  32. //xtOrgID := this.GetString("xt_org_id")
  33. customType, _ := this.GetInt64("custom_type")
  34. salesperson := this.GetString("salesperson")
  35. signTime := this.GetString("sign_time")
  36. contractPrice := this.GetString("contract_price")
  37. softwarePrice := this.GetString("software_price")
  38. hardwarePrice := this.GetString("hardware_price")
  39. yearCostPrice := this.GetString("year_cost_price")
  40. address := this.GetString("address")
  41. isImplement, _ := this.GetInt64("is_implement")
  42. lisStatus, _ := this.GetInt64("lis_status")
  43. lisContact := this.GetString("lis_contact")
  44. lisTime := this.GetString("lis_time")
  45. lisRemark := this.GetString("lis_remark")
  46. qcStatus, _ := this.GetInt64("qc_status")
  47. ybStatus, _ := this.GetInt64("yb_status")
  48. remark := this.GetString("remark")
  49. weightScaleStatus, _ := this.GetInt64("weight_scale_status")
  50. weightScaleBrand := this.GetString("weight_scale_brand")
  51. weightScaleRemark := this.GetString("weight_scale_remark")
  52. sphygmomanometerStatus, _ := this.GetInt64("sphygmomanometer_status")
  53. sphygmomanometerBrand := this.GetString("sphygmomanometer_brand")
  54. sphygmomanometerRemark := this.GetString("sphygmomanometer_remark")
  55. scannerStatus, _ := this.GetInt64("scanner_status")
  56. scannerBrand := this.GetString("scanner_brand")
  57. scannerRemark := this.GetString("scanner_remark")
  58. facialRecognitionDeviceStatus, _ := this.GetInt64("facial_recognition_device_status")
  59. facialRecognitionDeviceBrand := this.GetString("facial_recognition_device_brand")
  60. facialRecognitionDeviceRemark := this.GetString("facial_recognition_device_remark")
  61. printerStatus, _ := this.GetInt64("printer_status")
  62. printerBrand := this.GetString("printer_brand")
  63. printerRemark := this.GetString("printer_remark")
  64. hardwareRemark := this.GetString("hardware_remark")
  65. implement_time := this.GetString("implement_time")
  66. implement_person := this.GetString("implement_person")
  67. implement_remark := this.GetString("implement_remark")
  68. yb_time := this.GetString("yb_time")
  69. yb_person := this.GetString("yb_person")
  70. yb_remark := this.GetString("yb_remark")
  71. qc_time := this.GetString("qc_time")
  72. qc_person := this.GetString("qc_person")
  73. qc_remark := this.GetString("qc_remark")
  74. client_remark := this.GetString("client_remark")
  75. topline_time := this.GetString("topline_time")
  76. sign_end_time := this.GetString("sign_end_time")
  77. kyyChargeCustom := &models.KyyChargeCustom{
  78. ImplementTime: implement_time,
  79. ImplementPerson: implement_person,
  80. ImplementRemark: implement_remark,
  81. YbTime: yb_time,
  82. YbRemark: yb_remark,
  83. YbPerson: yb_person,
  84. QcTime: qc_time,
  85. QcPerson: qc_person,
  86. QcRemark: qc_remark,
  87. Name: name,
  88. Status: 1,
  89. Ctime: time.Now().Unix(),
  90. Mtime: time.Now().Unix(),
  91. Creator: 0,
  92. Modifier: 0,
  93. CustomType: customType,
  94. Salesperson: salesperson,
  95. SignTime: signTime,
  96. ContractPrice: contractPrice,
  97. SoftwarePrice: softwarePrice,
  98. HardwarePrice: hardwarePrice,
  99. YearCostPrice: yearCostPrice,
  100. Address: address,
  101. IsImplement: isImplement,
  102. LisStatus: lisStatus,
  103. LisContact: lisContact,
  104. LisTime: lisTime,
  105. LisRemark: lisRemark,
  106. QcStatus: qcStatus,
  107. YbStatus: ybStatus,
  108. Remark: remark,
  109. WeightScaleStatus: weightScaleStatus,
  110. WeightScaleBrand: weightScaleBrand,
  111. WeightScaleRemark: weightScaleRemark,
  112. SphygmomanometerStatus: sphygmomanometerStatus,
  113. SphygmomanometerBrand: sphygmomanometerBrand,
  114. SphygmomanometerRemark: sphygmomanometerRemark,
  115. ScannerStatus: scannerStatus,
  116. ScannerBrand: scannerBrand,
  117. ScannerRemark: scannerRemark,
  118. FacialRecognitionDeviceStatus: facialRecognitionDeviceStatus,
  119. FacialRecognitionDeviceBrand: facialRecognitionDeviceBrand,
  120. FacialRecognitionDeviceRemark: facialRecognitionDeviceRemark,
  121. PrinterStatus: printerStatus,
  122. PrinterBrand: printerBrand,
  123. PrinterRemark: printerRemark,
  124. HardwareRemark: hardwareRemark,
  125. ClientRemark: client_remark,
  126. ToplineTime: topline_time,
  127. SignEndTime: sign_end_time,
  128. }
  129. //custom, _ := service.FindCustomInfo(xtOrgID)
  130. //if custom.ID > 0 {
  131. // this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeNameException)
  132. // return
  133. //}
  134. err := service.CreateCustom(kyyChargeCustom)
  135. if err == nil {
  136. this.ServeSuccessJSON(map[string]interface{}{
  137. "custom": kyyChargeCustom,
  138. })
  139. }
  140. }
  141. func (this *CustomAPIController) GetCustomList() {
  142. list, _ := service.GetAllCustoms()
  143. this.ServeSuccessJSON(map[string]interface{}{
  144. "list": list,
  145. })
  146. }
  147. // func (this *CustomAPIController) DeleteAdmin() {
  148. // id, _ := this.GetInt64("id")
  149. // err := service.DeleteAdmin(id)
  150. // if err == nil {
  151. // this.ServeSuccessJSON(map[string]interface{}{
  152. // "msg": "删除成功",
  153. // })
  154. // }
  155. // }
  156. func (this *CustomAPIController) ModifyCustom() {
  157. id, _ := this.GetInt64("id")
  158. module, _ := this.GetInt64("module")
  159. custom, _ := service.FindCustomInfoByIDTwo(id)
  160. switch module {
  161. case 1: //编辑基本信息
  162. name := this.GetString("name")
  163. customType, _ := this.GetInt64("custom_type")
  164. salesperson := this.GetString("salesperson")
  165. signTime := this.GetString("sign_time")
  166. sign_end_time := this.GetString("sign_end_time")
  167. contractPrice := this.GetString("contract_price")
  168. softwarePrice := this.GetString("software_price")
  169. hardwarePrice := this.GetString("hardware_price")
  170. yearCostPrice := this.GetString("year_cost_price")
  171. address := this.GetString("address")
  172. client_remark := this.GetString("client_remark")
  173. topline_time := this.GetString("topline_time")
  174. custom.CustomType = customType
  175. custom.Salesperson = salesperson
  176. custom.SignEndTime = sign_end_time
  177. custom.SignTime = signTime
  178. custom.ContractPrice = contractPrice
  179. custom.SoftwarePrice = softwarePrice
  180. custom.HardwarePrice = hardwarePrice
  181. custom.YearCostPrice = yearCostPrice
  182. custom.Address = address
  183. custom.Name = name
  184. custom.ID = id
  185. custom.Mtime = time.Now().Unix()
  186. custom.ClientRemark = client_remark
  187. custom.ToplineTime = topline_time
  188. err := service.UpdateCustomTwo(custom)
  189. if err != nil {
  190. this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
  191. return
  192. }
  193. this.ServeSuccessJSON(map[string]interface{}{
  194. "msg": "修改成功",
  195. })
  196. break
  197. case 2: //编辑实施信息
  198. isImplement, _ := this.GetInt64("is_implement")
  199. implementTime := this.GetString("implement_time")
  200. implementPerson := this.GetString("implement_person")
  201. implementRemark := this.GetString("implement_remark")
  202. custom.IsImplement = isImplement
  203. custom.ImplementTime = implementTime
  204. custom.ImplementPerson = implementPerson
  205. custom.ImplementRemark = implementRemark
  206. custom.ID = id
  207. custom.Mtime = time.Now().Unix()
  208. err := service.UpdateCustomTwo(custom)
  209. if err != nil {
  210. this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
  211. return
  212. }
  213. this.ServeSuccessJSON(map[string]interface{}{
  214. "msg": "修改成功",
  215. })
  216. break
  217. case 3: //编辑LIS对接
  218. lisStatus, _ := this.GetInt64("lis_status")
  219. lisContact := this.GetString("lis_contact")
  220. lisTime := this.GetString("lis_time")
  221. lisRemark := this.GetString("lis_remark")
  222. custom.LisStatus = lisStatus
  223. custom.LisTime = lisTime
  224. custom.LisRemark = lisRemark
  225. custom.LisContact = lisContact
  226. custom.ID = id
  227. custom.Mtime = time.Now().Unix()
  228. err := service.UpdateCustomTwo(custom)
  229. if err != nil {
  230. this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
  231. return
  232. }
  233. this.ServeSuccessJSON(map[string]interface{}{
  234. "msg": "修改成功",
  235. })
  236. break
  237. case 4: //编辑医保对接
  238. ybStatus, _ := this.GetInt64("yb_status")
  239. ybPerson := this.GetString("yb_person")
  240. ybTime := this.GetString("yb_time")
  241. ybRemark := this.GetString("yb_remark")
  242. custom.YbStatus = ybStatus
  243. custom.YbPerson = ybPerson
  244. custom.YbTime = ybTime
  245. custom.YbRemark = ybRemark
  246. custom.ID = id
  247. custom.Mtime = time.Now().Unix()
  248. err := service.UpdateCustomTwo(custom)
  249. if err != nil {
  250. this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
  251. return
  252. }
  253. this.ServeSuccessJSON(map[string]interface{}{
  254. "msg": "修改成功",
  255. })
  256. break
  257. case 5: //编辑质控对接
  258. qcStatus, _ := this.GetInt64("qc_status")
  259. qcPerson := this.GetString("qc_person")
  260. qcTime := this.GetString("qc_time")
  261. qcRemark := this.GetString("qc_remark")
  262. custom.QcStatus = qcStatus
  263. custom.QcPerson = qcPerson
  264. custom.QcTime = qcTime
  265. custom.QcRemark = qcRemark
  266. custom.ID = id
  267. custom.Mtime = time.Now().Unix()
  268. err := service.UpdateCustomTwo(custom)
  269. if err != nil {
  270. this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
  271. return
  272. }
  273. this.ServeSuccessJSON(map[string]interface{}{
  274. "msg": "修改成功",
  275. })
  276. break
  277. case 6: //编辑备注
  278. remark := this.GetString("remark")
  279. custom.Remark = remark
  280. custom.ID = id
  281. custom.Mtime = time.Now().Unix()
  282. err := service.UpdateCustomTwo(custom)
  283. if err != nil {
  284. this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
  285. return
  286. }
  287. this.ServeSuccessJSON(map[string]interface{}{
  288. "msg": "修改成功",
  289. })
  290. break
  291. case 7: //编辑硬件信息
  292. weightScaleStatus, _ := this.GetInt64("weight_scale_status")
  293. weightScaleBrand := this.GetString("weight_scale_brand")
  294. weightScaleRemark := this.GetString("weight_scale_remark")
  295. sphygmomanometerStatus, _ := this.GetInt64("sphygmomanometer_status")
  296. sphygmomanometerBrand := this.GetString("sphygmomanometer_brand")
  297. sphygmomanometerRemark := this.GetString("sphygmomanometer_remark")
  298. scannerStatus, _ := this.GetInt64("scanner_status")
  299. scannerBrand := this.GetString("scanner_brand")
  300. scannerRemark := this.GetString("scanner_remark")
  301. facialRecognitionDeviceStatus, _ := this.GetInt64("facial_recognition_device_status")
  302. facialRecognitionDeviceBrand := this.GetString("facial_recognition_device_brand")
  303. facialRecognitionDeviceRemark := this.GetString("facial_recognition_device_remark")
  304. printerStatus, _ := this.GetInt64("printer_status")
  305. printerBrand := this.GetString("printer_brand")
  306. printerRemark := this.GetString("printer_remark")
  307. hardwareRemark := this.GetString("hardware_remark")
  308. custom.WeightScaleStatus = weightScaleStatus
  309. custom.WeightScaleBrand = weightScaleBrand
  310. custom.WeightScaleRemark = weightScaleRemark
  311. custom.SphygmomanometerStatus = sphygmomanometerStatus
  312. custom.SphygmomanometerBrand = sphygmomanometerBrand
  313. custom.SphygmomanometerRemark = sphygmomanometerRemark
  314. custom.ScannerStatus = scannerStatus
  315. custom.ScannerBrand = scannerBrand
  316. custom.ScannerRemark = scannerRemark
  317. custom.FacialRecognitionDeviceStatus = facialRecognitionDeviceStatus
  318. custom.FacialRecognitionDeviceBrand = facialRecognitionDeviceBrand
  319. custom.FacialRecognitionDeviceRemark = facialRecognitionDeviceRemark
  320. custom.PrinterStatus = printerStatus
  321. custom.PrinterBrand = printerBrand
  322. custom.PrinterRemark = printerRemark
  323. custom.HardwareRemark = hardwareRemark
  324. custom.ID = id
  325. custom.Mtime = time.Now().Unix()
  326. err := service.UpdateCustomTwo(custom)
  327. if err != nil {
  328. this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
  329. return
  330. }
  331. this.ServeSuccessJSON(map[string]interface{}{
  332. "msg": "修改成功",
  333. })
  334. break
  335. }
  336. }
  337. func (this *CustomAPIController) GetCustom() {
  338. id, _ := this.GetInt64("id")
  339. custom, _ := service.FindCustomInfoByID(id)
  340. if custom.ID == 0 {
  341. this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
  342. return
  343. }
  344. this.ServeSuccessJSON(map[string]interface{}{
  345. "custom": custom,
  346. })
  347. }
  348. func (this *CustomAPIController) CreatePaymentCollection() {
  349. customID, _ := this.GetInt64("custom_id")
  350. customName := this.GetString("custom_name")
  351. paymentCollectionType, _ := this.GetInt64("payment_collection_type")
  352. paymentCollectionSumAmt := this.GetString("payment_collection_sumamt")
  353. softwareSumAmt := this.GetString("software_sumamt")
  354. hardwareSumAmt := this.GetString("hardware_sumamt")
  355. paymentCollectionDate := this.GetString("payment_collection_date")
  356. paymentCollectionRole := this.GetString("payment_collection_role")
  357. url := this.GetString("url")
  358. remark := this.GetString("remark")
  359. ctime := time.Now().Unix()
  360. mtime := time.Now().Unix()
  361. // 创建 KyyChargePaymentCollection 对象,并设置每个字段的值
  362. paymentCollection := models.KyyChargePaymentCollection{
  363. CustomId: customID,
  364. CustomName: customName,
  365. PaymentCollectionType: paymentCollectionType,
  366. PaymentCollectionSumamt: paymentCollectionSumAmt,
  367. SoftwareSumamt: softwareSumAmt,
  368. HardwareSumamt: hardwareSumAmt,
  369. PaymentCollectionDate: paymentCollectionDate,
  370. PaymentCollectionRole: paymentCollectionRole,
  371. Url: url,
  372. Remark: remark,
  373. Ctime: ctime,
  374. Mtime: mtime,
  375. Creator: 0,
  376. Modifier: 0,
  377. Status: 1,
  378. }
  379. err := service.CreateChargePaymentCollection(&paymentCollection)
  380. if err != nil {
  381. this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
  382. return
  383. }
  384. this.ServeSuccessJSON(map[string]interface{}{
  385. "paymentCollection": paymentCollection,
  386. })
  387. }
  388. func (this *CustomAPIController) GetPaymentCollectionList() {
  389. list, _ := service.GetAllPaymentCollections()
  390. this.ServeSuccessJSON(map[string]interface{}{
  391. "list": list,
  392. })
  393. }
  394. func (this *CustomAPIController) GetPaymentCollection() {
  395. id, _ := this.GetInt64("id")
  396. pc, _ := service.FindPaymentCollectionInfo(id)
  397. if pc.ID == 0 {
  398. this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
  399. return
  400. }
  401. this.ServeSuccessJSON(map[string]interface{}{
  402. "pc": pc,
  403. })
  404. }
  405. func (this *CustomAPIController) EditPaymentCollection() {
  406. id, _ := this.GetInt64("id")
  407. paymentCollectionType, _ := this.GetInt64("payment_collection_type")
  408. paymentCollectionSumAmt := this.GetString("payment_collection_sumamt")
  409. softwareSumAmt := this.GetString("software_sumamt")
  410. hardwareSumAmt := this.GetString("hardware_sumamt")
  411. paymentCollectionDate := this.GetString("payment_collection_date")
  412. paymentCollectionRole := this.GetString("payment_collection_role")
  413. url := this.GetString("url")
  414. remark := this.GetString("remark")
  415. mtime := time.Now().Unix()
  416. cpc, _ := service.FindPaymentCollectionInfo(id)
  417. if cpc.ID == 0 {
  418. this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
  419. return
  420. }
  421. cpc.PaymentCollectionType = paymentCollectionType
  422. cpc.PaymentCollectionSumamt = paymentCollectionSumAmt
  423. cpc.SoftwareSumamt = softwareSumAmt
  424. cpc.HardwareSumamt = hardwareSumAmt
  425. cpc.PaymentCollectionDate = paymentCollectionDate
  426. cpc.PaymentCollectionRole = paymentCollectionRole
  427. cpc.Url = url
  428. cpc.Remark = remark
  429. cpc.Mtime = mtime
  430. err := service.CreateChargePaymentCollection(&cpc)
  431. if err != nil {
  432. this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
  433. return
  434. }
  435. this.ServeSuccessJSON(map[string]interface{}{
  436. "cpc": cpc,
  437. })
  438. }
  439. func (this *CustomAPIController) DeleteCustom() {
  440. id, _ := this.GetInt64("id")
  441. ct, _ := service.FindCustomInfoByIDTwo(id)
  442. if ct.ID == 0 {
  443. this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
  444. return
  445. }
  446. ct.Status = 0
  447. err := service.SaveCustomTwo(ct)
  448. if err != nil {
  449. this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
  450. return
  451. }
  452. this.ServeSuccessJSON(map[string]interface{}{
  453. "msg": "删除成功",
  454. })
  455. }
  456. func (this *CustomAPIController) DeletePaymentCollection() {
  457. id, _ := this.GetInt64("id")
  458. cpc, _ := service.FindPaymentCollectionInfo(id)
  459. if cpc.ID == 0 {
  460. this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
  461. return
  462. }
  463. cpc.Status = 0
  464. err := service.SaveChargePaymentCollection(&cpc)
  465. if err != nil {
  466. this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
  467. return
  468. }
  469. this.ServeSuccessJSON(map[string]interface{}{
  470. "msg": "删除成功",
  471. })
  472. }
  473. func (this *CustomAPIController) CheckPaymentCollection() {
  474. id, _ := this.GetInt64("id")
  475. cpc, _ := service.FindPaymentCollectionInfo(id)
  476. if cpc.ID == 0 {
  477. this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
  478. return
  479. }
  480. cpc.IsCheck = 1
  481. cpc.CheckPerson = this.GetAdminInfo().Name
  482. err := service.SaveChargePaymentCollection(&cpc)
  483. if err != nil {
  484. this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
  485. return
  486. }
  487. this.ServeSuccessJSON(map[string]interface{}{
  488. "msg": "审核成功",
  489. })
  490. }
  491. func (this *CustomAPIController) CreateContactInfo() {
  492. customID, _ := this.GetInt64("custom_id")
  493. contactName := this.GetString("contact_name")
  494. contactPhone := this.GetString("contact_phone")
  495. contactDuties := this.GetString("contact_duties")
  496. isDecision := this.GetString("is_decision")
  497. remark := this.GetString("remark")
  498. contact_way := this.GetString("contact_way")
  499. ctime := time.Now().Unix()
  500. mtime := time.Now().Unix()
  501. // 创建 KyyChargeContact 对象,并设置每个字段的值
  502. contact := models.KyyChargeContact{
  503. ID: 0,
  504. CustomId: customID,
  505. ContactName: contactName,
  506. ContactPhone: contactPhone,
  507. ContactDuties: contactDuties,
  508. IsDecision: isDecision,
  509. Remark: remark,
  510. Ctime: ctime,
  511. Mtime: mtime,
  512. Status: 1,
  513. Creator: 0,
  514. Modifier: 0,
  515. IsCheck: 0,
  516. ContactWay: contact_way,
  517. }
  518. err := service.SaveChargeContact(&contact)
  519. if err != nil {
  520. this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
  521. return
  522. }
  523. this.ServeSuccessJSON(map[string]interface{}{
  524. "contact": contact,
  525. })
  526. }
  527. func (this *CustomAPIController) GetContactInfoList() {
  528. list, _ := service.GetAllChargeContacts()
  529. this.ServeSuccessJSON(map[string]interface{}{
  530. "list": list,
  531. })
  532. }
  533. func (this *CustomAPIController) GetContactInfo() {
  534. id, _ := this.GetInt64("id")
  535. cc, _ := service.FindChargeContactInfo(id)
  536. if cc.ID == 0 {
  537. this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
  538. return
  539. }
  540. this.ServeSuccessJSON(map[string]interface{}{
  541. "contact_info": cc,
  542. })
  543. }
  544. func (this *CustomAPIController) EditContactInfo() {
  545. id, _ := this.GetInt64("id")
  546. contactName := this.GetString("contact_name")
  547. contactPhone := this.GetString("contact_phone")
  548. contactDuties := this.GetString("contact_duties")
  549. isDecision := this.GetString("is_decision")
  550. remark := this.GetString("remark")
  551. mtime := time.Now().Unix()
  552. chargeContact, _ := service.FindChargeContactInfo(id)
  553. if chargeContact.ID == 0 {
  554. this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
  555. return
  556. }
  557. chargeContact.ContactName = contactName
  558. chargeContact.ContactPhone = contactPhone
  559. chargeContact.ContactDuties = contactDuties
  560. chargeContact.IsDecision = isDecision
  561. chargeContact.Remark = remark
  562. chargeContact.Remark = remark
  563. chargeContact.Mtime = mtime
  564. err := service.SaveChargeContact(&chargeContact)
  565. if err != nil {
  566. this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
  567. return
  568. }
  569. this.ServeSuccessJSON(map[string]interface{}{
  570. "contact": chargeContact,
  571. })
  572. }
  573. func (this *CustomAPIController) DeleteContactInfo() {
  574. id, _ := this.GetInt64("id")
  575. cc, _ := service.FindChargeContactInfo(id)
  576. if cc.ID == 0 {
  577. this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
  578. return
  579. }
  580. cc.Status = 0
  581. err := service.SaveChargeContact(&cc)
  582. if err != nil {
  583. this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
  584. return
  585. }
  586. this.ServeSuccessJSON(map[string]interface{}{
  587. "msg": "删除成功",
  588. })
  589. }
  590. func (this *CustomAPIController) CheckContactInfo() {
  591. id, _ := this.GetInt64("id")
  592. chargeContact, _ := service.FindChargeContactInfo(id)
  593. if chargeContact.ID == 0 {
  594. this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
  595. return
  596. }
  597. chargeContact.IsCheck = 1
  598. chargeContact.CheckPerson = this.GetAdminInfo().Name
  599. err := service.SaveChargeContact(&chargeContact)
  600. if err != nil {
  601. this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
  602. return
  603. }
  604. this.ServeSuccessJSON(map[string]interface{}{
  605. "msg": "审核成功",
  606. })
  607. }
  608. func (this *CustomAPIController) CreateContractInfo() {
  609. customID, _ := this.GetInt64("custom_id")
  610. code := this.GetString("code")
  611. name := this.GetString("name")
  612. sumamt := this.GetString("sumamt")
  613. custom_name := this.GetString("custom_name")
  614. start_time := this.GetString("start_time")
  615. end_time := this.GetString("end_time")
  616. signing_person := this.GetString("signing_person")
  617. wordFileURL := this.GetString("word_file_url")
  618. pdfFileURL := this.GetString("pdf_file_url")
  619. remark := this.GetString("remark")
  620. ctime := time.Now().Unix()
  621. mtime := time.Now().Unix()
  622. // 创建 KyyChargeContract 对象,并设置每个字段的值
  623. contract := models.KyyChargeContract{
  624. CustomId: customID,
  625. Code: code,
  626. Name: name,
  627. Sumamt: sumamt,
  628. StartTime: start_time,
  629. EndTime: end_time,
  630. SigningPerson: signing_person,
  631. WordFileUrl: wordFileURL,
  632. PdfFileUrl: pdfFileURL,
  633. CustomName: custom_name,
  634. Remark: remark,
  635. Ctime: ctime,
  636. Mtime: mtime,
  637. Status: 1,
  638. }
  639. err := service.SaveChargeContract(&contract)
  640. if err != nil {
  641. this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
  642. return
  643. }
  644. this.ServeSuccessJSON(map[string]interface{}{
  645. "msg": "创建成功",
  646. })
  647. }
  648. func (this *CustomAPIController) GetContractInfoList() {
  649. list, _ := service.GetAllChargeContracts()
  650. this.ServeSuccessJSON(map[string]interface{}{
  651. "list": list,
  652. })
  653. }
  654. func (this *CustomAPIController) GetContractInfo() {
  655. id, _ := this.GetInt64("id")
  656. cc, _ := service.FindChargeContractInfo(id)
  657. if cc.ID == 0 {
  658. this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
  659. return
  660. }
  661. this.ServeSuccessJSON(map[string]interface{}{
  662. "charge_contract": cc,
  663. })
  664. }
  665. func (this *CustomAPIController) EditContractInfo() {
  666. id, _ := this.GetInt64("id")
  667. code := this.GetString("code")
  668. name := this.GetString("name")
  669. customName := this.GetString("custom_name")
  670. sumamt := this.GetString("sumamt")
  671. startTime := this.GetString("start_time")
  672. endTime := this.GetString("end_time")
  673. signingPerson := this.GetString("signing_person")
  674. wordFileURL := this.GetString("word_file_url")
  675. pdfFileURL := this.GetString("pdf_file_url")
  676. remark := this.GetString("remark")
  677. mtime := time.Now().Unix()
  678. chargeContract, _ := service.FindChargeContractInfo(id)
  679. if chargeContract.ID == 0 {
  680. this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
  681. return
  682. }
  683. chargeContract.Code = code
  684. chargeContract.Name = name
  685. chargeContract.CustomName = customName
  686. chargeContract.Sumamt = sumamt
  687. chargeContract.StartTime = startTime
  688. chargeContract.EndTime = endTime
  689. chargeContract.SigningPerson = signingPerson
  690. chargeContract.WordFileUrl = wordFileURL
  691. chargeContract.PdfFileUrl = pdfFileURL
  692. chargeContract.Remark = remark
  693. chargeContract.Mtime = mtime
  694. err := service.SaveChargeContract(&chargeContract)
  695. if err != nil {
  696. this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
  697. return
  698. }
  699. this.ServeSuccessJSON(map[string]interface{}{
  700. "msg": "修改成功",
  701. })
  702. }
  703. func (this *CustomAPIController) DeleteContractInfo() {
  704. id, _ := this.GetInt64("id")
  705. cc, _ := service.FindChargeContractInfo(id)
  706. if cc.ID == 0 {
  707. this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
  708. return
  709. }
  710. cc.Status = 0
  711. err := service.SaveChargeContract(&cc)
  712. if err != nil {
  713. this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
  714. return
  715. }
  716. this.ServeSuccessJSON(map[string]interface{}{
  717. "msg": "删除成功",
  718. })
  719. }
  720. func (this *CustomAPIController) CheckContractInfo() {
  721. id, _ := this.GetInt64("id")
  722. chargeContract, _ := service.FindChargeContractInfo(id)
  723. if chargeContract.ID == 0 {
  724. this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
  725. return
  726. }
  727. chargeContract.CheckPerson = this.GetAdminInfo().Name
  728. chargeContract.IsCheck = 1
  729. err := service.SaveChargeContract(&chargeContract)
  730. if err != nil {
  731. this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
  732. return
  733. }
  734. this.ServeSuccessJSON(map[string]interface{}{
  735. "msg": "审核成功",
  736. })
  737. }
  738. func (this *CustomAPIController) CreateFollowInfo() {
  739. ctime := time.Now().Unix()
  740. mtime := time.Now().Unix()
  741. customID, _ := this.GetInt64("custom_id")
  742. desc := this.GetString("desc")
  743. // 创建 KyyChargeFollow 对象,并设置每个字段的值
  744. follow := models.KyyChargeFollow{
  745. Ctime: ctime,
  746. Mtime: mtime,
  747. Creator: this.GetAdminInfo().ID,
  748. CustomId: customID,
  749. Desc: desc,
  750. Status: 1,
  751. }
  752. err := service.SaveChargeFollow(&follow)
  753. if err != nil {
  754. this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
  755. return
  756. }
  757. this.ServeSuccessJSON(map[string]interface{}{
  758. "follow": follow,
  759. })
  760. }
  761. func (this *CustomAPIController) GetFollowInfoList() {
  762. list, _ := service.GetAllChargeFollow()
  763. this.ServeSuccessJSON(map[string]interface{}{
  764. "list": list,
  765. })
  766. }
  767. func (this *CustomAPIController) GetFollowInfo() {
  768. id, _ := this.GetInt64("id")
  769. follow, _ := service.FindChargeFollowInfo(id)
  770. if follow.ID == 0 {
  771. this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
  772. return
  773. }
  774. this.ServeSuccessJSON(map[string]interface{}{
  775. "follow": follow,
  776. })
  777. }
  778. func (this *CustomAPIController) EditFollowInfo() {
  779. id, _ := this.GetInt64("id")
  780. desc := this.GetString("desc")
  781. chargeFollow, _ := service.FindChargeFollowInfo(id)
  782. chargeFollow.Desc = desc
  783. chargeFollow.Mtime = time.Now().Unix()
  784. err := service.SaveChargeFollow(&chargeFollow)
  785. if err != nil {
  786. this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
  787. return
  788. }
  789. this.ServeSuccessJSON(map[string]interface{}{
  790. "follow": chargeFollow,
  791. })
  792. }
  793. func (this *CustomAPIController) DeleteFollowInfo() {
  794. id, _ := this.GetInt64("id")
  795. follow, _ := service.FindChargeFollowInfo(id)
  796. if follow.ID == 0 {
  797. this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
  798. return
  799. }
  800. follow.Status = 0
  801. err := service.SaveChargeFollow(&follow)
  802. if err != nil {
  803. this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
  804. return
  805. }
  806. this.ServeSuccessJSON(map[string]interface{}{
  807. "msg": "删除成功",
  808. })
  809. }
  810. func (this *CustomAPIController) CheckFollowInfo() {
  811. id, _ := this.GetInt64("id")
  812. follow, _ := service.FindChargeFollowInfoTwo(id)
  813. if len(follow) == 0 {
  814. this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
  815. return
  816. }
  817. var ids []int64
  818. for _, item := range follow {
  819. ids = append(ids, item.ID)
  820. }
  821. err := service.CheckChargeFollowTwo(ids)
  822. if err != nil {
  823. this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
  824. return
  825. }
  826. this.ServeSuccessJSON(map[string]interface{}{
  827. "msg": "审核成功",
  828. })
  829. }
  830. func (this *CustomAPIController) CreateDemandInfo() {
  831. demandType, _ := this.GetInt64("demand_type")
  832. demandDesc := this.GetString("demand_desc")
  833. demandStatus, _ := this.GetInt64("demand_status")
  834. demandCreator := this.GetString("demand_creator")
  835. demandCreateDate := this.GetString("demand_create_date")
  836. demandDirector := this.GetString("demand_director")
  837. ctime := time.Now().Unix()
  838. mtime := time.Now().Unix()
  839. customID, _ := this.GetInt64("custom_id")
  840. demandFinishDate := this.GetString("demand_finish_date")
  841. demandDetail := this.GetString("demand_detail")
  842. // 创建 KyyChargeDemand 对象,并设置每个字段的值
  843. demand := models.KyyChargeDemand{
  844. DemandType: demandType,
  845. DemandDesc: demandDesc,
  846. DemandStatus: demandStatus,
  847. DemandCreator: demandCreator,
  848. DemandCreateDate: demandCreateDate,
  849. DemandDirector: demandDirector,
  850. Ctime: ctime,
  851. Mtime: mtime,
  852. Status: 1,
  853. CustomId: customID,
  854. DemandFinishDate: demandFinishDate,
  855. DemandDetail: demandDetail,
  856. }
  857. err := service.SaveChargeDemand(&demand)
  858. if err != nil {
  859. this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
  860. return
  861. }
  862. this.ServeSuccessJSON(map[string]interface{}{
  863. "demand": demand,
  864. })
  865. }
  866. func (this *CustomAPIController) GetDemandInfoList() {
  867. list, _ := service.GetAllChargeDemand()
  868. this.ServeSuccessJSON(map[string]interface{}{
  869. "list": list,
  870. })
  871. }
  872. func (this *CustomAPIController) GetDemandInfo() {
  873. id, _ := this.GetInt64("id")
  874. cd, _ := service.FindChargeDemandInfo(id)
  875. if cd.ID == 0 {
  876. this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
  877. return
  878. }
  879. this.ServeSuccessJSON(map[string]interface{}{
  880. "charge_demand": cd,
  881. })
  882. }
  883. func (this *CustomAPIController) EditDemandInfo() {
  884. id, _ := this.GetInt64("id")
  885. demandType, _ := this.GetInt64("demand_type")
  886. demandDesc := this.GetString("demand_desc")
  887. demandStatus, _ := this.GetInt64("demand_status")
  888. demandCreator := this.GetString("demand_creator")
  889. demandCreateDate := this.GetString("demand_create_date")
  890. demandFinishDate := this.GetString("demand_finish_date")
  891. demandDetail := this.GetString("demand_detail")
  892. demandDirector := this.GetString("demand_director")
  893. cd, _ := service.FindChargeDemandInfo(id)
  894. cd.DemandType = demandType
  895. cd.DemandDesc = demandDesc
  896. cd.DemandStatus = demandStatus
  897. cd.DemandCreator = demandCreator
  898. cd.DemandCreateDate = demandCreateDate
  899. cd.DemandFinishDate = demandFinishDate
  900. cd.DemandDirector = demandDirector
  901. cd.DemandDetail = demandDetail
  902. cd.Mtime = time.Now().Unix()
  903. err := service.SaveChargeDemand(&cd)
  904. if err != nil {
  905. this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
  906. return
  907. }
  908. this.ServeSuccessJSON(map[string]interface{}{
  909. "demand": cd,
  910. })
  911. }
  912. func (this *CustomAPIController) DeleteDemandInfo() {
  913. id, _ := this.GetInt64("id")
  914. cd, _ := service.FindChargeDemandInfo(id)
  915. if cd.ID == 0 {
  916. this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
  917. return
  918. }
  919. cd.Status = 0
  920. err := service.SaveChargeDemand(&cd)
  921. if err != nil {
  922. this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
  923. return
  924. }
  925. this.ServeSuccessJSON(map[string]interface{}{
  926. "msg": "删除成功",
  927. })
  928. }
  929. func (this *CustomAPIController) CheckDemandInfo() {
  930. id, _ := this.GetInt64("id")
  931. cd, _ := service.FindChargeDemandInfo(id)
  932. if cd.ID == 0 {
  933. this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
  934. return
  935. }
  936. cd.IsCheck = 1
  937. //chargeContract
  938. cd.CheckPerson = this.GetAdminInfo().Name
  939. err := service.SaveChargeDemand(&cd)
  940. if err != nil {
  941. this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
  942. return
  943. }
  944. this.ServeSuccessJSON(map[string]interface{}{
  945. "msg": "审核成功",
  946. })
  947. }
  948. func (this *CustomAPIController) CreateRenewalInfo() {
  949. types, _ := this.GetInt64("type")
  950. startTime := this.GetString("start_time")
  951. endTime := this.GetString("end_time")
  952. signingPersonal := this.GetString("signing_personal")
  953. customID, _ := this.GetInt64("custom_id")
  954. signTime := this.GetString("sign_time")
  955. checkPersonal := this.GetString("check_personal")
  956. ctime := time.Now().Format("2006-01-02 15:04:05") // 使用当前时间
  957. mtime := time.Now().Format("2006-01-02 15:04:05") // 使用当前时间
  958. remark := this.GetString("remark")
  959. // 创建 KyyChargeRenewal 对象,并设置每个字段的值
  960. renewal := models.KyyChargeRenewal{
  961. Type: types,
  962. StartTime: startTime,
  963. EndTime: endTime,
  964. SigningPersonal: signingPersonal,
  965. CustomId: customID,
  966. SignTime: signTime,
  967. CheckPersonal: checkPersonal,
  968. Ctime: ctime,
  969. Mtime: mtime,
  970. Status: 1,
  971. Remark: remark,
  972. }
  973. err := service.SaveChargeRenewal(&renewal)
  974. if err != nil {
  975. this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
  976. return
  977. }
  978. this.ServeSuccessJSON(map[string]interface{}{
  979. "renewal": renewal,
  980. })
  981. }
  982. func (this *CustomAPIController) GetRenewalInfoList() {
  983. list, _ := service.GetAllChargeRenewal()
  984. this.ServeSuccessJSON(map[string]interface{}{
  985. "list": list,
  986. })
  987. }
  988. func (this *CustomAPIController) GetRenewalInfo() {
  989. id, _ := this.GetInt64("id")
  990. cr, _ := service.FindChargeRenewalInfo(id)
  991. if cr.ID == 0 {
  992. this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
  993. return
  994. }
  995. this.ServeSuccessJSON(map[string]interface{}{
  996. "charge_renewal": cr,
  997. })
  998. }
  999. func (this *CustomAPIController) EditRenewalInfo() {
  1000. types, _ := this.GetInt64("type")
  1001. id, _ := this.GetInt64("id")
  1002. startTime := this.GetString("start_time")
  1003. endTime := this.GetString("end_time")
  1004. signingPersonal := this.GetString("signing_personal")
  1005. customID, _ := this.GetInt64("custom_id")
  1006. signTime := this.GetString("sign_time")
  1007. remark := this.GetString("remark")
  1008. checkPersonal := this.GetString("check_personal")
  1009. mtime := time.Now().Format("2006-01-02 15:04:05") // 使用当前时间
  1010. cr, _ := service.FindChargeRenewalInfo(id)
  1011. if cr.ID == 0 {
  1012. this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
  1013. return
  1014. }
  1015. cr.Type = types
  1016. cr.CustomId = customID
  1017. cr.StartTime = startTime
  1018. cr.EndTime = endTime
  1019. cr.SigningPersonal = signingPersonal
  1020. cr.SignTime = signTime
  1021. cr.Mtime = mtime
  1022. cr.Remark = remark
  1023. cr.CheckPersonal = checkPersonal
  1024. err := service.SaveChargeRenewal(&cr)
  1025. if err != nil {
  1026. this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
  1027. return
  1028. }
  1029. this.ServeSuccessJSON(map[string]interface{}{
  1030. "cr": cr,
  1031. })
  1032. }
  1033. func (this *CustomAPIController) DeleteRenewalInfo() {
  1034. id, _ := this.GetInt64("id")
  1035. cr, _ := service.FindChargeRenewalInfo(id)
  1036. if cr.ID == 0 {
  1037. this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
  1038. return
  1039. }
  1040. cr.Status = 0
  1041. err := service.SaveChargeRenewal(&cr)
  1042. if err != nil {
  1043. this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
  1044. return
  1045. }
  1046. this.ServeSuccessJSON(map[string]interface{}{
  1047. "msg": "删除成功",
  1048. })
  1049. }
  1050. func (this *CustomAPIController) CheckRenewalInfo() {
  1051. id, _ := this.GetInt64("id")
  1052. cr, _ := service.FindChargeRenewalInfo(id)
  1053. if cr.ID == 0 {
  1054. this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
  1055. return
  1056. }
  1057. cr.IsCheck = 1
  1058. cr.CheckPerson = this.GetAdminInfo().Name
  1059. err := service.SaveChargeRenewal(&cr)
  1060. if err != nil {
  1061. this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
  1062. return
  1063. }
  1064. this.ServeSuccessJSON(map[string]interface{}{
  1065. "msg": "审核成功",
  1066. })
  1067. }
  1068. func (c *CustomAPIController) GetQNUpToken() {
  1069. redisClient := service.RedisClient()
  1070. defer redisClient.Close()
  1071. token, err := redisClient.Get("qn_token").Result()
  1072. if err != nil {
  1073. defer fmt.Println(err)
  1074. c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeGetQiniuUpToken)
  1075. return
  1076. }
  1077. c.ServeSuccessJSON(map[string]interface{}{
  1078. "uptoken": token,
  1079. })
  1080. return
  1081. }