qryErmcp3Report.go 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444
  1. /**
  2. * @Author: zou.yingbin
  3. * @Create : 2021/4/16 18:40
  4. * @Modify : 2021/4/16 18:40
  5. */
  6. package ermcp3
  7. import (
  8. "github.com/gin-gonic/gin"
  9. "mtp2_if/global/app"
  10. "mtp2_if/global/e"
  11. "mtp2_if/models"
  12. "net/http"
  13. "strconv"
  14. )
  15. // 查询日期
  16. type QueryDate string
  17. // IsNumberic 判断是否为数字, queryType 1:8位日期 2:6位日期
  18. func (v QueryDate) IsNumberic(queryType int32) bool {
  19. if queryType == 1 {
  20. // 日报表 日期长度YYYYMMDD
  21. if len(v) != 8 {
  22. return false
  23. }
  24. } else if queryType == 2 {
  25. // 月报表 日期长度YYYYMM
  26. if len(v) != 6 {
  27. return false
  28. }
  29. }
  30. // 判断是否为数字
  31. if _, err := strconv.ParseInt(string(v), 10, 32); err != nil {
  32. return false
  33. }
  34. return true
  35. }
  36. // 检查周期类型、周期时间
  37. type CycleTypeCheck struct {
  38. CYCLETYPE int32 `json:"cycletype" xorm:"'cycletype'"` // 周期类型 - 1:月 2:季 3:年 4:周 5:全报表【原值】
  39. CYCLETIME string `json:"cycletime" xorm:"'cycletime'"` // 周期时间 月(YYYYMM) 季(YYYYQ) 年(YYYY) 周(YYYYIW) 全(0)【原值】
  40. }
  41. func (r *CycleTypeCheck) Check() bool {
  42. if r.CYCLETYPE < 1 || r.CYCLETYPE > 5 {
  43. return false
  44. }
  45. nLen := len(r.CYCLETIME)
  46. // 判断是否为数字
  47. if _, err := strconv.ParseInt(r.CYCLETIME, 10, 32); err != nil {
  48. return false
  49. }
  50. // 判断长度
  51. switch r.CYCLETYPE {
  52. case 1:
  53. if nLen != 6 {
  54. return false
  55. }
  56. case 2:
  57. if nLen != 5 {
  58. return false
  59. }
  60. case 3:
  61. if nLen != 4 {
  62. return false
  63. }
  64. case 4:
  65. if nLen != 6 {
  66. return false
  67. }
  68. case 5:
  69. if r.CYCLETIME != "0" {
  70. return false
  71. }
  72. }
  73. return true
  74. }
  75. // QryReportReq 查报表请求
  76. // @Param userid query int true "用户ID"
  77. // @Param querytype query int true "查询类型 1-日报表 2-周期报表 3-日报表(指定时间段[开始交易日,结束交易日]) 4-日报表明细"
  78. // @Param tradedate query string false "交易日(格式yyyymmdd)"
  79. // @Param cycletype query int false "周期类型 - 1:月 2:季 3:年 4:周 5:全报表【原值】"
  80. // @Param cycletime query string false "周期时间 月(YYYYMM) 季(YYYYQ) 年(YYYY) 周(YYYYIW) 全(0)【原值】"
  81. // @Param begindate query string false "开始交易日(格式yyyymmdd)"
  82. // @Param enddate query string false "结束交易日(格式yyyymmdd)"
  83. type QryReportReq struct {
  84. USERID int64 `form:"userid" binding:"required"` // 用户id
  85. QUERYTYPE int32 `form:"querytype" binding:"required"` // 查询类型
  86. TRADEDATE string `form:"tradedate"` // 交易日
  87. CYCLETYPE int32 `form:"cycletype"` // 周期类型 - 1:月 2:季 3:年 4:周 5:全报表【原值】
  88. CYCLETIME string `form:"cycletime"` // 周期时间 月(YYYYMM) 季(YYYYQ) 年(YYYY) 周(YYYYIW) 全(0)【原值】
  89. BEGINDATE string `form:"begindate"` // 开始交易日
  90. ENDDATE string `form:"enddate"` // 结束交易日
  91. }
  92. // Check 参数检查
  93. func (r *QryReportReq) Check() bool {
  94. // 参数检查
  95. switch r.QUERYTYPE {
  96. case 1, 4:
  97. return QueryDate(r.TRADEDATE).IsNumberic(1)
  98. case 2:
  99. switch r.CYCLETYPE {
  100. case 1, 2, 3, 5:
  101. p := CycleTypeCheck{CYCLETYPE: r.CYCLETYPE, CYCLETIME: r.CYCLETIME}
  102. return p.Check()
  103. case 4:
  104. return QueryDate(r.CYCLETIME).IsNumberic(1)
  105. default:
  106. return false
  107. }
  108. case 3:
  109. return QueryDate(r.BEGINDATE).IsNumberic(1) && QueryDate(r.ENDDATE).IsNumberic(1)
  110. }
  111. return true
  112. }
  113. // QryReportDaySpotDetail 查询现货日报表详情(菜单:报表查询/现货报表/现货日报表详情) - 作废
  114. func QryReportDaySpotDetail(c *gin.Context) {
  115. a := app.GinUtils{Gin: app.Gin{C: c}}
  116. req := struct {
  117. USERID int64 `form:"userid" binding:"required"` // 用户id
  118. TRADEDATE string `form:"tradedate" binding:"required"` // 交易日
  119. DELIVERYGOODSID int32 `form:"deliverygoodsid" binding:"required"` // 现货商品id
  120. SPOTGOODSBRANDID int32 `form:"spotgoodsbrandid"` // 品牌id
  121. WRSTANDARDID int32 `form:"wrstandardid"` // 品类id
  122. }{}
  123. a.DoBindReq(&req)
  124. m := models.Ermcp3ReportOPLog{USERID: req.USERID, DELIVERYGOODSID: req.DELIVERYGOODSID,
  125. TRADEDATE: req.TRADEDATE, SPOTGOODSBRANDID: req.SPOTGOODSBRANDID, WRSTANDARDID: req.WRSTANDARDID,
  126. LogTypeFilter: "2,3,24,25,26,27"}
  127. a.DoGetDataI(&m)
  128. }
  129. // QryReportDayFinanceKx 查询财务日报表款项(菜单:报表查询/财务报表/日报表/款项) - 作废
  130. func QryReportDayFinanceKx(c *gin.Context) {
  131. a := app.GinUtils{Gin: app.Gin{C: c}}
  132. req := struct {
  133. USERID int64 `form:"userid" binding:"required"` // 用户id
  134. TRADEDATE string `form:"tradedate" binding:"required"` // 交易日
  135. }{}
  136. a.DoBindReq(&req)
  137. m := models.Ermcp3ReportOPLog{USERID: req.USERID, TRADEDATE: req.TRADEDATE, LogTypeFilter: "8,9,10"}
  138. a.DoGetDataI(&m)
  139. }
  140. // QryReportDayFinanceFp 查询财务日报表发票(菜单:报表查询/财务报表/日报表/发票) - 作废
  141. func QryReportDayFinanceFp(c *gin.Context) {
  142. a := app.GinUtils{Gin: app.Gin{C: c}}
  143. req := struct {
  144. USERID int64 `form:"userid" binding:"required"` // 用户id
  145. TRADEDATE string `form:"tradedate" binding:"required"` // 交易日
  146. }{}
  147. a.DoBindReq(&req)
  148. m := models.Ermcp3ReportOPLog{USERID: req.USERID, TRADEDATE: req.TRADEDATE, LogTypeFilter: "11, 12"}
  149. a.DoGetDataI(&m)
  150. }
  151. // QryReportDaySpot 查询现货日报表(菜单:报表查询/现货报表/现货日报表) - 作废
  152. func QryReportDaySpot(c *gin.Context) {
  153. a := app.GinUtils{Gin: app.Gin{C: c}}
  154. m := models.Ermcp3ReckonAreaSpotSub{}
  155. a.DoBindReq(&m)
  156. a.DoGetDataI(&m)
  157. }
  158. // QryReportMonthSpot
  159. // 查询现货月报表(菜单:报表查询/现货报表/现货月报表) - 作废
  160. func QryReportMonthSpot(c *gin.Context) {
  161. a := app.GinUtils{Gin: app.Gin{C: c}}
  162. m := models.Ermcp3ReportAreaSpotSub{}
  163. a.DoBindReq(&m)
  164. a.DoGetDataI(&m)
  165. }
  166. // QryReportMonthSpotDetail 查询现货月报表详情(菜单:报表查询/现货月报表/现货月报表详情) - 作废
  167. func QryReportMonthSpotDetail(c *gin.Context) {
  168. a := app.GinUtils{Gin: app.Gin{C: c}}
  169. req := models.Ermcp3ReportAreaSpotSub{}
  170. a.DoBindReq(&req)
  171. if req.CYCLETYPE != 1 || len(req.CYCLETIME) != 6 {
  172. // 目前仅支持月报表明细, 月报表的日期应是6位,如 202101
  173. a.Response(http.StatusBadRequest, e.INVALID_PARAMS, nil)
  174. return
  175. }
  176. t1 := req.CYCLETIME + "01"
  177. t2 := req.CYCLETIME + "31"
  178. // 月报表明细 = 01~31 日报表
  179. m := models.Ermcp3ReckonAreaSpotSub{
  180. AREAUSERID: req.AREAUSERID, DELIVERYGOODSID: req.DELIVERYGOODSID, ACCOUNTID: req.ACCOUNTID,
  181. WRSTANDARDID: req.WRSTANDARDID, SPOTGOODSBRANDID: req.SPOTGOODSBRANDID, BeginDate: t1, EndDate: t2}
  182. a.DoGetDataI(&m)
  183. }
  184. // QryAreaExpourseReport
  185. // @Summary 查询敞口报表
  186. // @Produce json
  187. // @Security ApiKeyAuth
  188. // @Param userid query int true "用户ID"
  189. // @Param querytype query int true "查询类型 1-日报表 2-周期报表 3-日报表(指定时间段[开始交易日,结束交易日]) 4-日报表明细"
  190. // @Param tradedate query string false "交易日(格式yyyymmdd)"
  191. // @Param cycletype query int false "周期类型 - 1:月 2:季 3:年 4:周 5:全报表【原值】"
  192. // @Param cycletime query string false "周期时间 月(YYYYMM) 季(YYYYQ) 年(YYYY) 周(YYYYIW) 全(0)【原值】"
  193. // @Param begindate query string false "开始交易日(格式yyyymmdd)"
  194. // @Param enddate query string false "结束交易日(格式yyyymmdd)"
  195. // @Success 200 {array} models.Ermcp3ExpourseReport
  196. // @Failure 500 {object} app.Response
  197. // @Router /Ermcp3/QryAreaExpourseReport [get]
  198. // @Tags 企业风险管理v3(app)
  199. func QryAreaExpourseReport(c *gin.Context) {
  200. a := app.GinUtils{Gin: app.Gin{C: c}}
  201. req := QryReportReq{}
  202. a.DoBindReq(&req)
  203. a.CheckParam(&req)
  204. m := models.Ermcp3ExpourseReport{AREAUSERID: req.USERID, QueryType: req.QUERYTYPE,
  205. CYCLETYPE: req.CYCLETYPE, CYCLETIME: req.CYCLETIME, BeginDate: req.BEGINDATE, EndDate: req.ENDDATE}
  206. a.DoGetDataI(&m)
  207. }
  208. // QryAreaExpourseContractDetail
  209. // @Summary 查询敞口合同明细(敞口报表/现货合同明细)
  210. // @Produce json
  211. // @Security ApiKeyAuth
  212. // @Param userid query int true "用户ID"
  213. // @Param middlegoodsid query int true "套保商品id"
  214. // @Param tradedate query string true "交易日(格式yyyymmdd)"
  215. // @Success 200 {array} models.Ermcp3ExposureContractDetail
  216. // @Failure 500 {object} app.Response
  217. // @Router /Ermcp3/QryAreaExpourseContractDetail [get]
  218. // @Tags 企业风险管理v3(app)
  219. func QryAreaExpourseContractDetail(c *gin.Context) {
  220. a := app.GinUtils{Gin: app.Gin{C: c}}
  221. req := struct {
  222. USERID int64 `form:"userid" binding:"required"` // 用户id
  223. MIDDLEGOODSID int32 `form:"middlegoodsid" binding:"required"` // 套保商品id
  224. TRADEDATE string `form:"tradedate" binding:"required"` // 交易日(格式yyyymmdd)
  225. }{}
  226. a.DoBindReq(&req)
  227. m := models.Ermcp3ExposureContractDetail{USERID: req.USERID,
  228. MIDDLEGOODSID: req.MIDDLEGOODSID, TRADEDATE: req.TRADEDATE}
  229. a.DoGetDataI(&m)
  230. }
  231. // QryAreaExpourseHedgeplanDetail
  232. // @Summary 查询敞口套保计划明细(敞口报表/套保计划明细)
  233. // @Produce json
  234. // @Security ApiKeyAuth
  235. // @Param userid query int true "用户ID"
  236. // @Param middlegoodsid query int true "套保商品id"
  237. // @Param tradedate query string true "交易日(格式yyyymmdd)"
  238. // @Success 200 {array} models.Ermcp3ExposureHedgeplanDetail
  239. // @Failure 500 {object} app.Response
  240. // @Router /Ermcp3/QryAreaExpourseHedgeplanDetail [get]
  241. // @Tags 企业风险管理v3(app)
  242. func QryAreaExpourseHedgeplanDetail(c *gin.Context) {
  243. a := app.GinUtils{Gin: app.Gin{C: c}}
  244. req := struct {
  245. USERID int64 `form:"userid" binding:"required"` // 用户id
  246. MIDDLEGOODSID int32 `form:"middlegoodsid" binding:"required"` // 套保商品id
  247. TRADEDATE string `form:"tradedate" binding:"required"` // 交易日(格式yyyymmdd)
  248. }{}
  249. a.DoBindReq(&req)
  250. m := models.Ermcp3ExposureHedgeplanDetail{USERID: req.USERID,
  251. MIDDLEGOODSID: req.MIDDLEGOODSID, TRADEDATE: req.TRADEDATE}
  252. a.DoGetDataI(&m)
  253. }
  254. // QryAreaSpotplReport
  255. // @Summary 查询现货报表
  256. // @Produce json
  257. // @Security ApiKeyAuth
  258. // @Param userid query int true "用户ID"
  259. // @Param querytype query int true "查询类型 1-日报表 2-周期报表 3-日报表(指定时间段[开始交易日,结束交易日])"
  260. // @Param tradedate query string false "交易日(格式yyyymmdd)"
  261. // @Param cycletype query int false "周期类型 - 1:月 2:季 3:年 4:周 5:全报表【原值】"
  262. // @Param cycletime query string false "周期时间 月(YYYYMM) 季(YYYYQ) 年(YYYY) 周(YYYYIW) 全(0)【原值】"
  263. // @Param begindate query string false "开始交易日(格式yyyymmdd)"
  264. // @Param enddate query string false "结束交易日(格式yyyymmdd)"
  265. // @Success 200 {array} models.Ermcp3AreaSpotPLReport
  266. // @Failure 500 {object} app.Response
  267. // @Router /Ermcp3/QryAreaSpotplReport [get]
  268. // @Tags 企业风险管理v3(app)
  269. func QryAreaSpotplReport(c *gin.Context) {
  270. a := app.GinUtils{Gin: app.Gin{C: c}}
  271. req := QryReportReq{}
  272. a.DoBindReq(&req)
  273. a.CheckParam(&req)
  274. m := models.Ermcp3AreaSpotPLReport{AREAUSERID: req.USERID, QueryType: req.QUERYTYPE, RECKONDATE: req.TRADEDATE,
  275. CYCLETYPE: req.CYCLETYPE, CYCLETIME: req.CYCLETIME, BeginDate: req.BEGINDATE, EndDate: req.ENDDATE}
  276. a.DoGetDataI(&m)
  277. }
  278. // QryFinanceReport
  279. // @Summary 查询财务报表
  280. // @Produce json
  281. // @Security ApiKeyAuth
  282. // @Param userid query int true "用户ID"
  283. // @Param querytype query int true "查询类型 1-日报表 2-周期报表 3-日报表(指定时间段[开始交易日,结束交易日]) 4-日报表明细"
  284. // @Param tradedate query string false "交易日(格式yyyymmdd)"
  285. // @Param cycletype query int false "周期类型 - 1:月 2:季 3:年 4:周 5:全报表【原值】"
  286. // @Param cycletime query string false "周期时间 月(YYYYMM) 季(YYYYQ) 年(YYYY) 周(YYYYIW) 全(0)【原值】"
  287. // @Param begindate query string false "开始交易日(格式yyyymmdd)"
  288. // @Param enddate query string false "结束交易日(格式yyyymmdd)"
  289. // @Param currencyid query int false "币种id(日报表明细)"
  290. // @Success 200 {array} models.Ermcp3FinanceReport
  291. // @Failure 500 {object} app.Response
  292. // @Router /Ermcp3/QryFinanceReport [get]
  293. // @Tags 企业风险管理v3(app)
  294. func QryFinanceReport(c *gin.Context) {
  295. a := app.GinUtils{Gin: app.Gin{C: c}}
  296. req := QryReportReq{}
  297. a.DoBindReq(&req)
  298. a.CheckParam(&req)
  299. req2 := struct {
  300. CURRENCYID int32 `form:"currencyid"` // 币种id
  301. }{}
  302. a.DoBindReq(&req2)
  303. a.CheckParamF(func() bool {
  304. if req.QUERYTYPE == 4 {
  305. return req2.CURRENCYID > 0
  306. }
  307. return true
  308. })
  309. m := models.Ermcp3FinanceReport{AREAUSERID: req.USERID, QueryType: req.QUERYTYPE, RECKONDATE: req.TRADEDATE,
  310. CYCLETYPE: req.CYCLETYPE, CYCLETIME: req.CYCLETIME, BeginDate: req.BEGINDATE, EndDate: req.ENDDATE, CURRENCYID: req2.CURRENCYID}
  311. a.DoGetDataI(&m)
  312. }
  313. // QryAreaStockReport
  314. // @Summary 查询库存报表
  315. // @Produce json
  316. // @Security ApiKeyAuth
  317. // @Param userid query int true "用户ID"
  318. // @Param querytype query int true "查询类型 1-日报表 2-周期报表 3-日报表(指定时间段[开始交易日,结束交易日])"
  319. // @Param tradedate query string false "交易日(格式yyyymmdd)"
  320. // @Param cycletype query int false "周期类型 - 1:月 2:季 3:年 4:周 5:全报表【原值】"
  321. // @Param cycletime query string false "周期时间 月(YYYYMM) 季(YYYYQ) 年(YYYY) 周(YYYYIW) 全(0)【原值】"
  322. // @Param begindate query string false "开始交易日(格式yyyymmdd)"
  323. // @Param enddate query string false "结束交易日(格式yyyymmdd)"
  324. // @Param deliverygoodsid query int false "现货商品ID"
  325. // @Param wrstandardid query int false "品类ID"
  326. // @Param spotgoodsbrandid query int false "品牌ID"
  327. // @Param warehouseinfoid query int false "仓库ID"
  328. // @Success 200 {array} models.Ermcp3AreaStockReport
  329. // @Failure 500 {object} app.Response
  330. // @Router /Ermcp3/QryAreaStockReport [get]
  331. // @Tags 企业风险管理v3(app)
  332. func QryAreaStockReport(c *gin.Context) {
  333. a := app.GinUtils{Gin: app.Gin{C: c}}
  334. req := QryReportReq{}
  335. req2 := struct {
  336. DELIVERYGOODSID int32 `form:"deliverygoodsid"` // 现货品种id
  337. WRSTANDARDID int32 `form:"wrstandardid"` // 品类ID
  338. SPOTGOODSBRANDID int32 `form:"spotgoodsbrandid"` // 品牌id
  339. WAREHOUSEINFOID string `form:"warehouseinfoid"` // 现货仓库ID
  340. }{}
  341. a.DoBindReq(&req)
  342. a.DoBindReq(&req2)
  343. a.CheckParam(&req)
  344. m := models.Ermcp3AreaStockReport{USERID: req.USERID, QueryType: req.QUERYTYPE, RECKONDATE: req.TRADEDATE,
  345. CYCLETYPE: req.CYCLETYPE, CYCLETIME: req.CYCLETIME, BeginDate: req.BEGINDATE, EndDate: req.ENDDATE,
  346. DELIVERYGOODSID: req2.DELIVERYGOODSID, WRSTANDARDID: req2.WRSTANDARDID, SPOTGOODSBRANDID: req2.SPOTGOODSBRANDID,
  347. WAREHOUSEINFOID: req2.WAREHOUSEINFOID}
  348. a.DoGetDataI(&m)
  349. }
  350. // QueryAreaStockReportDetail
  351. // 查询库存报表明细 - 作废(库存报表明细就是查库存申请记录,直接调用其接口)
  352. func QueryAreaStockReportDetail(c *gin.Context) {
  353. a := app.GinUtils{Gin: app.Gin{C: c}}
  354. req := struct {
  355. USERID int64 `form:"userid" binding:"required"` // 机构ID
  356. DELIVERYGOODSID int32 `form:"deliverygoodsid"` // 现货品种id
  357. WRSTANDARDID int32 `form:"wrstandardid"` // 品类ID
  358. SPOTGOODSBRANDID int32 `form:"spotgoodsbrandid"` // 品牌id
  359. WAREHOUSEINFOID string `form:"warehouseinfoid"` // 现货仓库ID
  360. QUERYTYPE int32 `form:"querytype" binding:"required"` // 查询类型
  361. QUERYDATE string `form:"querydate" binding:"required"` // 查询日期
  362. DETAILTYPE int32 `form:"detailtype" binding:"required"` // 明细类型
  363. }{}
  364. a.DoBindReq(&req)
  365. if QueryDate(req.QUERYDATE).IsNumberic(req.QUERYTYPE) {
  366. var beginDate, endDate string
  367. if req.QUERYTYPE == 1 {
  368. beginDate = req.QUERYDATE
  369. endDate = beginDate
  370. } else if req.QUERYTYPE == 2 {
  371. beginDate = req.QUERYDATE + "01"
  372. endDate = req.QUERYDATE + "31"
  373. }
  374. m := models.Ermcp3AreaStockApply{USERID: req.USERID, WRSTANDARDID: req.WRSTANDARDID,
  375. SPOTGOODSBRANDID: req.SPOTGOODSBRANDID, DELIVERYGOODSID: req.DELIVERYGOODSID,
  376. WAREHOUSEINFOID: req.WAREHOUSEINFOID, BeginDate: beginDate, EndDate: endDate, APPLYSTATUS: 2}
  377. // 出入库类型(可多项,逗号隔开) 1:采购入库 2:销售出库 3:生产入库 4:生产出库"
  378. if req.DETAILTYPE == 1 {
  379. m.FilterType = "1,3"
  380. } else if req.DETAILTYPE == 2 {
  381. m.FilterType = "2,4"
  382. }
  383. a.DoGetDataI(&m)
  384. } else {
  385. a.Gin.Response(http.StatusBadRequest, e.INVALID_PARAMS, nil)
  386. }
  387. }
  388. // QryAreaSumPL
  389. // @Summary 查询汇总损益表
  390. // @Produce json
  391. // @Security ApiKeyAuth
  392. // @Param userid query int true "用户ID"
  393. // @Param querytype query int true "查询类型 1-日报表 2-周期报表 3-日报表(指定时间段[开始交易日,结束交易日]) 4-日报表明细"
  394. // @Param tradedate query string false "交易日(格式yyyymmdd)"
  395. // @Param cycletype query int false "周期类型 - 1:月 2:季 3:年 4:周 5:全报表【原值】"
  396. // @Param cycletime query string false "周期时间 月(YYYYMM) 季(YYYYQ) 年(YYYY) 周(YYYYIW) 全(0)【原值】"
  397. // @Param begindate query string false "开始交易日(格式yyyymmdd)"
  398. // @Param enddate query string false "结束交易日(格式yyyymmdd)"
  399. // @Param currencyid query int false "币种id(日报表明细)"
  400. // @Success 200 {array} models.Ermcp3ArealSumPL
  401. // @Failure 500 {object} app.Response
  402. // @Router /Ermcp3/QryAreaSumPL [get]
  403. // @Tags 企业风险管理v3(app)
  404. func QryAreaSumPL(c *gin.Context) {
  405. a := app.GinUtils{Gin: app.Gin{C: c}}
  406. req := QryReportReq{}
  407. a.DoBindReq(&req)
  408. a.CheckParam(&req)
  409. req2 := struct {
  410. CURRENCYID int32 `form:"currencyid"` // 币种id
  411. }{}
  412. a.DoBindReq(&req2)
  413. a.CheckParamF(func() bool {
  414. if req.QUERYTYPE == 4 {
  415. return req2.CURRENCYID > 0
  416. }
  417. return true
  418. })
  419. m := models.Ermcp3ArealSumPL{AREAUSERID: req.USERID, QueryType: req.QUERYTYPE, RECKONDATE: req.TRADEDATE,
  420. CYCLETYPE: req.CYCLETYPE, CYCLETIME: req.CYCLETIME, BeginDate: req.BEGINDATE, EndDate: req.ENDDATE, CURRENCYID: req2.CURRENCYID}
  421. a.DoGetDataI(&m)
  422. }