contract_api.go 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568
  1. /*
  2. * @description: 合同管理 相关API
  3. * @Author: CP
  4. * @Date: 2020-10-26 15:27:04
  5. * @FilePath: \construction_management\web\api\contract_api.go
  6. */
  7. package api
  8. import (
  9. "fmt"
  10. "github.com/kataras/iris/v12"
  11. "go.mod/lib"
  12. "go.mod/models"
  13. "go.mod/services"
  14. "go.mod/web/utils"
  15. "go.mod/web/viewmodels"
  16. )
  17. type ContractApi struct {
  18. //框架-web应用上下文环境
  19. Ctx iris.Context
  20. // // 需要用的service
  21. ServiceTree services.TreeService
  22. ServiceContract services.ContractService
  23. // ServiceLogin services.LoginService
  24. // ServiceProject services.ProjectService
  25. }
  26. // @Summary 获得合同目录和标段
  27. // @Tags 合同管理
  28. // @Description 获得合同目录和标段
  29. // @Accept json
  30. // @Produce json
  31. // @Param bidsectionType path string true "标段类型0合同1安全2质量"
  32. // @Success 200 {object} viewmodels.FolderContract "{code:0成功,-1参数类错误,data:viewmodels.ProjectAccount,msg:错误信息}"
  33. // @Router /api/contract/folder [get]
  34. func (c *ContractApi) GetFolder() {
  35. bidTypeData, err := c.ServiceTree.ValidRuleBidsectionType(c.Ctx)
  36. if err != nil {
  37. ErrMsg := utils.FormValidError(err)
  38. c.Ctx.JSON(iris.Map{"code": -1, "msg": ErrMsg})
  39. return
  40. }
  41. // 获得项目ID
  42. projectId, err := utils.GetProjectId(c.Ctx)
  43. if err != nil {
  44. c.Ctx.JSON(iris.Map{"code": -1, "msg": err})
  45. return
  46. }
  47. // 获得项目账号ID
  48. // projectAccountId, err := utils.GetProjectAccountId(c.Ctx)
  49. // if err != nil {
  50. // c.Ctx.JSON(iris.Map{"code": -1, "msg": err})
  51. // return
  52. // }
  53. account := c.Ctx.Values().Get("account").(*models.CmProjectAccount)
  54. // 获得层级文件夹
  55. FolderData := c.ServiceTree.GetAllContract(projectId, account, bidTypeData.BidsectionType)
  56. c.Ctx.JSON(iris.Map{
  57. "code": 0,
  58. "msg": "",
  59. "data": FolderData,
  60. })
  61. }
  62. // @Summary 获得标段收入-项目节信息
  63. // @Tags 合同管理-收入合同
  64. // @Description 未设置合同项目节 返回项目节模板信息
  65. // @Accept json
  66. // @Produce json
  67. // @Security ApiKeyAuth
  68. // @Param bidsectionId path string true "标段ID"
  69. // @Success 200 {object} viewmodels.TreeSectionContract "{code:0成功,-1参数类错误,data:viewmodels.TreeSectionContract,msg:错误信息}"
  70. // @Router /api/contract/income/section/all [get]
  71. func (c *ContractApi) GetIncomeSectionAll() {
  72. sectionData := viewmodels.TreeSectionContract{}
  73. err := c.Ctx.ReadForm(&sectionData)
  74. if err != nil {
  75. c.Ctx.JSON(iris.Map{"code": -1, "msg": "ReadJSON转换异常,请检查参数"})
  76. return
  77. }
  78. if sectionData.BidsectionId == "" {
  79. c.Ctx.JSON(iris.Map{"code": -1, "msg": "ReadJSON转换异常,请检查参数"})
  80. return
  81. }
  82. bidsectionId, err := utils.GetDecryptId(sectionData.BidsectionId)
  83. if err != nil {
  84. c.Ctx.JSON(iris.Map{"code": -1, "msg": "ReadJSON转换异常,请检查参数"})
  85. return
  86. }
  87. // 项目ID
  88. projectIdInt, err := utils.GetProjectId(c.Ctx)
  89. if err != nil {
  90. c.Ctx.JSON(iris.Map{"code": -1, "msg": err})
  91. return
  92. }
  93. //获得合同项目节
  94. sectionTree := c.ServiceContract.GetSecionTree(bidsectionId, projectIdInt, 0)
  95. // 1.未设置了项目节
  96. if len(sectionTree.Children) == 0 {
  97. // 返回项目节2个基础模板
  98. templateTree1 := lib.NewItemSection().TemplateTree1
  99. templateTree2 := lib.NewItemSection().TemplateTree2
  100. c.Ctx.JSON(iris.Map{
  101. "code": 0,
  102. "msg": "",
  103. "isTemplate": 1,
  104. "sectionTemplate1": templateTree1,
  105. "sectionTemplate2": templateTree2,
  106. })
  107. return
  108. //2.项目节已设置
  109. } else {
  110. // 2.已设置项目节
  111. c.Ctx.JSON(iris.Map{
  112. "code": 0,
  113. "msg": "",
  114. "isTemplate": 0,
  115. "sectionTree": sectionTree,
  116. })
  117. return
  118. // 返回项目相关所有信息
  119. }
  120. }
  121. // @Summary 单个合同和项目节
  122. // @Tags 合同管理-收入合同
  123. // @Description 获得合同详情和项目节详情
  124. // @Accept json
  125. // @Produce json
  126. // @Security ApiKeyAuth
  127. // @Param id path string true "项目节ID"
  128. // @Param bidsectionId path string true "标段ID"
  129. // @Success 200 {object} viewmodels.TreeSectionContract "{code:0成功,-1参数类错误,isContract:是否有合同(包含孩子们),section:viewmodels.TreeSectionContract,msg:错误信息}"
  130. // @Router /api/contract/income [get]
  131. func (c *ContractApi) GetIncome() {
  132. // 1.规则验证
  133. sectionData, err := c.ServiceContract.ValidRuleGet(c.Ctx)
  134. if err != nil {
  135. c.Ctx.JSON(iris.Map{"code": -1, "msg": err})
  136. return
  137. }
  138. // 2.项目ID
  139. projectId, err := utils.GetProjectId(c.Ctx)
  140. if err != nil {
  141. c.Ctx.JSON(iris.Map{"code": -1, "msg": err})
  142. return
  143. }
  144. // 3.标段ID
  145. bidsectionId, err := utils.GetDecryptId(sectionData.BidsectionId)
  146. if err != nil {
  147. c.Ctx.JSON(iris.Map{"code": -1, "msg": err})
  148. return
  149. }
  150. // 4.树ID
  151. treeId, err := utils.GetDecryptId(sectionData.Id)
  152. if err != nil {
  153. c.Ctx.JSON(iris.Map{"code": -1, "msg": err})
  154. return
  155. }
  156. // 获得项目节详情
  157. section := c.ServiceContract.Get(treeId, bidsectionId, projectId, 0)
  158. // 该项目节 子树下是否有合同
  159. isContract := true
  160. contractList := c.ServiceContract.GetSectionTreeContract(section.Attribution, bidsectionId, projectId, 0)
  161. if len(contractList) == 0 {
  162. isContract = false
  163. }
  164. // 获得合同详情
  165. contractId, _ := utils.GetDecryptId(section.ContractId)
  166. contract := &viewmodels.Contracts{}
  167. if contractId != 0 {
  168. contract = c.ServiceContract.GetContract(contractId)
  169. }
  170. c.Ctx.JSON(iris.Map{
  171. "code": 0,
  172. "msg": "",
  173. "section": section,
  174. "isContract": isContract, //该项目节(包含子孙)下是否有合同
  175. "contract": contract,
  176. })
  177. }
  178. // @Summary 新增合同
  179. // @Tags 合同管理-收入合同
  180. // @Description 新增合同
  181. // @Accept json
  182. // @Produce json
  183. // @Security ApiKeyAuth
  184. // @Param treeId path string true "项目节ID"
  185. // @Param bidsectionId path string true "标段ID"
  186. // @Param code path string true "合同编号"
  187. // @Param name path string true "合同名称"
  188. // @Param contractsType path int true "合同类型(1)"
  189. // @Param price path string true "合同金额"
  190. // @Success 200 {object} viewmodels.TreeSectionContract "{code:0成功,-1参数类错误,msg:错误信息}"
  191. // @Router /api/contract/income/create [post]
  192. func (c *ContractApi) PostIncomeCreate() {
  193. // 验证参数
  194. contractData, err := c.ServiceContract.ValidRuleContractAdd(c.Ctx)
  195. if err != nil {
  196. c.Ctx.JSON(iris.Map{"code": -1, "msg": fmt.Sprintf("%s", err)})
  197. return
  198. }
  199. // 项目ID
  200. projectIdInt, err := utils.GetProjectId(c.Ctx)
  201. if err != nil {
  202. c.Ctx.JSON(iris.Map{"code": -1, "msg": fmt.Sprintf("%s", err)})
  203. return
  204. }
  205. // 标段ID
  206. bidsectionId, err := utils.GetDecryptId(contractData.BidsectionId)
  207. if err != nil {
  208. c.Ctx.JSON(iris.Map{"code": -1, "msg": fmt.Sprintf("%s", err)})
  209. return
  210. }
  211. // 项目节ID
  212. treeId, err := utils.GetDecryptId(contractData.TreeId)
  213. if err != nil {
  214. c.Ctx.JSON(iris.Map{"code": -1, "msg": fmt.Sprintf("%s", err)})
  215. return
  216. }
  217. // 可优化-事务问题
  218. // 先添加项目节
  219. // 1.新建合同,项目层级必须在第二层以下,当第一层没有孩子可以添加合同
  220. sectionData := &viewmodels.TreeSectionContract{}
  221. sectionData.Id = contractData.TreeId
  222. sectionData.Name = " "
  223. sectionResult, err := c.ServiceContract.ContractSectionAdd(sectionData, bidsectionId, projectIdInt, 0)
  224. if err != nil {
  225. c.Ctx.JSON(iris.Map{"code": -1, "msg": fmt.Sprintf("%s", err)})
  226. return
  227. }
  228. // 在添加合同
  229. err = c.ServiceContract.Add(contractData, projectIdInt, bidsectionId, sectionResult.Id)
  230. if err != nil {
  231. // 需要删除项目节-有问题
  232. c.ServiceContract.SectionDelete(sectionResult.Id, bidsectionId, projectIdInt, 0)
  233. c.Ctx.JSON(iris.Map{"code": -1, "msg": fmt.Sprintf("%s", err)})
  234. return
  235. }
  236. // 获得项目节
  237. sectionDetail := c.ServiceContract.Get(treeId, bidsectionId, projectIdInt, 0)
  238. // 合同ID
  239. contractId, _ := utils.GetDecryptId(sectionDetail.ContractId)
  240. contractDetail := c.ServiceContract.GetContract(contractId)
  241. c.Ctx.JSON(iris.Map{
  242. "code": 0,
  243. "msg": "新增成功",
  244. "contract": contractDetail,
  245. })
  246. }
  247. // @Summary 编辑合同
  248. // @Tags 合同管理-收入合同
  249. // @Description 编辑合同
  250. // @Accept json
  251. // @Produce json
  252. // @Security ApiKeyAuth
  253. // @Param id path string true "合同ID"
  254. // @Param treeId path string true "项目节ID"
  255. // @Param bidsectionId path string true "标段ID"
  256. // @Param content path string true "合同内容"
  257. // @Param name path string true "合同名称"
  258. // @Param price path string true "合同金额"
  259. // @Param partyA path string true "甲方"
  260. // @Param partyASigner path string true "甲方签约人"
  261. // @Param partyB path string true "已方"
  262. // @Param partyBSigner path string true "已方签约人"
  263. // @Param signerTime path string true "签约时间"
  264. // @Param remarks path string true "备注"
  265. // @Success 200 {object} viewmodels.TreeSectionContract "{code:0成功,-1参数类错误,msg:错误信息}"
  266. // @Router /api/contract/income/update [post]
  267. func (c *ContractApi) PostIncomeUpdate() {
  268. // 验证参数
  269. contractData, err := c.ServiceContract.ValidRuleContractEdi(c.Ctx)
  270. if err != nil {
  271. c.Ctx.JSON(iris.Map{"code": -1, "msg": fmt.Sprintf("%s", err)})
  272. return
  273. }
  274. // 项目ID
  275. projectIdInt, err := utils.GetProjectId(c.Ctx)
  276. if err != nil {
  277. c.Ctx.JSON(iris.Map{"code": -1, "msg": fmt.Sprintf("%s", err)})
  278. return
  279. }
  280. // 标段ID
  281. bidsectionId, err := utils.GetDecryptId(contractData.BidsectionId)
  282. if err != nil {
  283. c.Ctx.JSON(iris.Map{"code": -1, "msg": fmt.Sprintf("%s", err)})
  284. return
  285. }
  286. // 项目节ID
  287. treeId, err := utils.GetDecryptId(contractData.TreeId)
  288. if err != nil {
  289. c.Ctx.JSON(iris.Map{"code": -1, "msg": fmt.Sprintf("%s", err)})
  290. return
  291. }
  292. err = c.ServiceContract.Update(contractData, projectIdInt, bidsectionId, treeId)
  293. if err != nil {
  294. c.Ctx.JSON(iris.Map{"code": -1, "msg": fmt.Sprintf("%s", err)})
  295. return
  296. }
  297. //2.请求当前项目信息
  298. // 1.验证项目节ID
  299. sectionDetail := c.ServiceContract.Get(treeId, bidsectionId, projectIdInt, 0)
  300. // 合同ID
  301. contractId, _ := utils.GetDecryptId(sectionDetail.ContractId)
  302. contractDetail := c.ServiceContract.GetContract(contractId)
  303. c.Ctx.JSON(iris.Map{
  304. "code": 0,
  305. "msg": "编辑成功",
  306. "section": sectionDetail,
  307. "contract": contractDetail,
  308. })
  309. }
  310. // @Summary 删除合同
  311. // @Tags 合同管理-收入合同
  312. // @Description 删除合同
  313. // @Accept json
  314. // @Produce json
  315. // @Security ApiKeyAuth
  316. // @Param id path string true "合同ID"
  317. // @Param treeId path string true "项目节ID"
  318. // @Param bidsectionId path string true "标段ID"
  319. // @Success 200 {object} viewmodels.TreeSectionContract "{code:0成功,-1参数类错误,msg:错误信息}"
  320. // @Router /api/contract [delete]
  321. func (c *ContractApi) Delete() {
  322. // 验证参数
  323. contractData, err := c.ServiceContract.ValidRuleContractDel(c.Ctx)
  324. if err != nil {
  325. c.Ctx.JSON(iris.Map{"code": -1, "msg": fmt.Sprintf("%s", err)})
  326. return
  327. }
  328. // 项目ID
  329. projectIdInt, err := utils.GetProjectId(c.Ctx)
  330. if err != nil {
  331. c.Ctx.JSON(iris.Map{"code": -1, "msg": fmt.Sprintf("%s", err)})
  332. return
  333. }
  334. // 标段ID
  335. bidsectionId, err := utils.GetDecryptId(contractData.BidsectionId)
  336. if err != nil {
  337. c.Ctx.JSON(iris.Map{"code": -1, "msg": fmt.Sprintf("%s", err)})
  338. return
  339. }
  340. // 项目节ID
  341. treeId, err := utils.GetDecryptId(contractData.TreeId)
  342. if err != nil {
  343. c.Ctx.JSON(iris.Map{"code": -1, "msg": fmt.Sprintf("%s", err)})
  344. return
  345. }
  346. // 合同ID
  347. id, err := utils.GetDecryptId(contractData.Id)
  348. if err != nil {
  349. c.Ctx.JSON(iris.Map{"code": -1, "msg": fmt.Sprintf("%s", err)})
  350. return
  351. }
  352. // 删除合同
  353. err = c.ServiceContract.Delete(projectIdInt, bidsectionId, treeId, id)
  354. if err != nil {
  355. c.Ctx.JSON(iris.Map{"code": -1, "msg": fmt.Sprintf("%s", err)})
  356. return
  357. }
  358. //2.请求当前项目信息--需求变更 删除合同要删除项目节,不需要返回项目节信息
  359. // 1.验证项目节ID
  360. // sectionDetail := c.ServiceContract.Get(treeId, bidsectionId, projectIdInt, 0)
  361. c.Ctx.JSON(iris.Map{"code": 0, "msg": "删除成功", "section": ""})
  362. }
  363. // @Summary 关闭合同
  364. // @Tags 合同管理
  365. // @Description 关闭合同
  366. // @Accept json
  367. // @Produce json
  368. // @Security ApiKeyAuth
  369. // @Param id path string true "合同ID"
  370. // @Param treeId path string true "项目节ID"
  371. // @Param bidsectionId path string true "标段ID"
  372. // @Success 200 {object} viewmodels.TreeSectionContract "{code:0成功,-1参数类错误,msg:错误信息}"
  373. // @Router /api/contract/close [post]
  374. func (c *ContractApi) PostClose() {
  375. // 验证参数
  376. contractData, err := c.ServiceContract.ValidRuleContractClose(c.Ctx)
  377. if err != nil {
  378. c.Ctx.JSON(iris.Map{"code": -1, "msg": fmt.Sprintf("%s", err)})
  379. return
  380. }
  381. // 项目ID
  382. projectIdInt, err := utils.GetProjectId(c.Ctx)
  383. if err != nil {
  384. c.Ctx.JSON(iris.Map{"code": -1, "msg": fmt.Sprintf("%s", err)})
  385. return
  386. }
  387. // 标段ID
  388. bidsectionId, err := utils.GetDecryptId(contractData.BidsectionId)
  389. if err != nil {
  390. c.Ctx.JSON(iris.Map{"code": -1, "msg": fmt.Sprintf("%s", err)})
  391. return
  392. }
  393. // 项目节ID
  394. treeId, err := utils.GetDecryptId(contractData.TreeId)
  395. if err != nil {
  396. c.Ctx.JSON(iris.Map{"code": -1, "msg": fmt.Sprintf("%s", err)})
  397. return
  398. }
  399. // 合同ID
  400. id, err := utils.GetDecryptId(contractData.Id)
  401. if err != nil {
  402. c.Ctx.JSON(iris.Map{"code": -1, "msg": fmt.Sprintf("%s", err)})
  403. return
  404. }
  405. err = c.ServiceContract.Close(projectIdInt, bidsectionId, treeId, id, contractData.TreeType, contractData.SettlementCode)
  406. if err != nil {
  407. c.Ctx.JSON(iris.Map{"code": -1, "msg": fmt.Sprintf("%s", err)})
  408. return
  409. }
  410. // 1.项目节信息
  411. sectionDetail := c.ServiceContract.Get(treeId, bidsectionId, projectIdInt, 0)
  412. contractDetail := c.ServiceContract.GetContract(id)
  413. c.Ctx.JSON(iris.Map{"code": 0, "msg": "关闭成功", "section": sectionDetail, "contract": contractDetail})
  414. }
  415. // @Summary 解锁合同
  416. // @Tags 合同管理
  417. // @Description 解锁合同
  418. // @Accept json
  419. // @Produce json
  420. // @Security ApiKeyAuth
  421. // @Param id path string true "合同ID"
  422. // @Param treeId path string true "项目节ID"
  423. // @Param bidsectionId path string true "标段ID"
  424. // @Success 200 {object} viewmodels.TreeSectionContract "{code:0成功,-1参数类错误,msg:错误信息}"
  425. // @Router /api/contract/unlock [post]
  426. func (c *ContractApi) PostUnlock() {
  427. // 验证参数
  428. contractData, err := c.ServiceContract.ValidRuleContractClose(c.Ctx)
  429. if err != nil {
  430. c.Ctx.JSON(iris.Map{"code": -1, "msg": fmt.Sprintf("%s", err)})
  431. return
  432. }
  433. // 项目ID
  434. projectIdInt, err := utils.GetProjectId(c.Ctx)
  435. if err != nil {
  436. c.Ctx.JSON(iris.Map{"code": -1, "msg": fmt.Sprintf("%s", err)})
  437. return
  438. }
  439. // 标段ID
  440. bidsectionId, err := utils.GetDecryptId(contractData.BidsectionId)
  441. if err != nil {
  442. c.Ctx.JSON(iris.Map{"code": -1, "msg": fmt.Sprintf("%s", err)})
  443. return
  444. }
  445. // 项目节ID
  446. treeId, err := utils.GetDecryptId(contractData.TreeId)
  447. if err != nil {
  448. c.Ctx.JSON(iris.Map{"code": -1, "msg": fmt.Sprintf("%s", err)})
  449. return
  450. }
  451. // 合同ID
  452. id, err := utils.GetDecryptId(contractData.Id)
  453. if err != nil {
  454. c.Ctx.JSON(iris.Map{"code": -1, "msg": fmt.Sprintf("%s", err)})
  455. return
  456. }
  457. err = c.ServiceContract.Unlock(projectIdInt, bidsectionId, treeId, id, contractData.TreeType)
  458. if err != nil {
  459. c.Ctx.JSON(iris.Map{"code": -1, "msg": fmt.Sprintf("%s", err)})
  460. return
  461. }
  462. // 1.项目节信息
  463. sectionDetail := c.ServiceContract.Get(treeId, bidsectionId, projectIdInt, 0)
  464. contractDetail := c.ServiceContract.GetContract(id)
  465. c.Ctx.JSON(iris.Map{"code": 0, "msg": "解锁成功", "section": sectionDetail, "contract": contractDetail})
  466. }
  467. // @Summary 合同概述
  468. // @Tags 合同管理
  469. // @Description 合同概述
  470. // @Accept json
  471. // @Produce json
  472. // @Security ApiKeyAuth
  473. // @Param bidsectionId path string true "标段ID"
  474. // @Success 200 {object} viewmodels.TreeSectionContract "{code:0成功,-1参数类错误,msg:错误信息}"
  475. // @Router /api/contract/survey [get]
  476. func (c *ContractApi) GetSurvey() {
  477. sectionData := viewmodels.Contracts{}
  478. err := c.Ctx.ReadForm(&sectionData)
  479. if err != nil {
  480. c.Ctx.JSON(iris.Map{"code": -1, "msg": "ReadJSON转换异常,请检查参数"})
  481. return
  482. }
  483. err = sectionData.ValidateBidsectionId()
  484. if err != nil {
  485. c.Ctx.JSON(iris.Map{"code": -1, "msg": fmt.Sprintf("%s", err)})
  486. return
  487. }
  488. // 标段ID
  489. bidsectionId, err := utils.GetDecryptId(sectionData.BidsectionId)
  490. if err != nil {
  491. c.Ctx.JSON(iris.Map{"code": -1, "msg": "ReadJSON转换异常,请检查参数"})
  492. return
  493. }
  494. // 项目ID
  495. projectId, err := utils.GetProjectId(c.Ctx)
  496. if err != nil {
  497. c.Ctx.JSON(iris.Map{"code": -1, "msg": err})
  498. return
  499. }
  500. // 账号ID
  501. // accountId, err := utils.GetProjectAccountId(c.Ctx)
  502. // if err != nil {
  503. // c.Ctx.JSON(iris.Map{"code": -1, "msg": fmt.Sprintf("%s", err)})
  504. // return
  505. // }
  506. // 缓存标段ID-用于权限
  507. // key := fmt.Sprintf("pm_%d_%d", projectId, accountId)
  508. // lib.NewRedis().SetBidsectionIdByCache(key, bidsectionId)
  509. incomeData := c.ServiceContract.GetSurvey(bidsectionId, projectId, 1)
  510. expenditureData := c.ServiceContract.GetSurvey(bidsectionId, projectId, 2)
  511. data := map[string]interface{}{
  512. "incomeData": incomeData,
  513. "expenditureData": expenditureData,
  514. }
  515. c.Ctx.JSON(iris.Map{
  516. "code": 0,
  517. "msg": "",
  518. "data": data,
  519. })
  520. }