qryQhj.go 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410
  1. /**
  2. * @Author: zou.yingbin
  3. * @Create : 2021/6/1 14:59
  4. * @Modify : 2021/6/1 14:59
  5. */
  6. package qhj
  7. import (
  8. "mtp2_if/global/app"
  9. "mtp2_if/models"
  10. "mtp2_if/mtpcache"
  11. "github.com/gin-gonic/gin"
  12. )
  13. // QueryContract
  14. // @Summary 查询融资明细(合同)
  15. // @Produce json
  16. // @Security ApiKeyAuth
  17. // @Param userid query int true "用户ID"
  18. // @Param scfcontractid query int false "scf合同id"
  19. // @Success 200 {array} models.QhjContract
  20. // @Failure 500 {object} app.Response
  21. // @Router /Qhj/QueryContract [get]
  22. // @Tags 大连千海金
  23. func QueryContract(c *gin.Context) {
  24. a := app.GinUtils{Gin: app.Gin{C: c}}
  25. req := struct {
  26. USERID int64 `form:"userid" binding:"required"` // 用户id
  27. SCFCONTRACTID int64 `form:"scfcontractid"` // scf合同id
  28. }{}
  29. a.DoBindReq(&req)
  30. m := models.QhjContract{USERID: req.USERID}
  31. a.DoGetDataI(&m)
  32. }
  33. // QueryContractLog
  34. // @Summary 查询融资明细流水(融资明细详情页中的流水)
  35. // @Produce json
  36. // @Security ApiKeyAuth
  37. // @Param scfcontractid query int true "scf合同id"
  38. // @Param amounttype query string false "资金类型(逗号隔开) - 1:首付款 2:尾款 3:利息 4:追加款"
  39. // @Success 200 {array} models.QhjContractLog
  40. // @Failure 500 {object} app.Response
  41. // @Router /Qhj/QueryContractLog [get]
  42. // @Tags 大连千海金
  43. func QueryContractLog(c *gin.Context) {
  44. a := app.GinUtils{Gin: app.Gin{C: c}}
  45. req := struct {
  46. SCFCONTRACTID int64 `form:"scfcontractid" binding:"required"` // scf合同id
  47. AMOUNTTYPE string `form:"amounttype"` // 资金类型(逗号隔开) - 1:首付款2:尾款 3:利息 4:追加款
  48. }{}
  49. a.DoBindReq(&req)
  50. m := models.QhjContractLog{SCFCONTRACTID: req.SCFCONTRACTID, FilterType: req.AMOUNTTYPE}
  51. a.DoGetDataI(&m)
  52. }
  53. // QueryRStrategy
  54. // @Summary 查询定投设置(我的定投/历史定投[状态=已终止])
  55. // @Produce json
  56. // @Security ApiKeyAuth
  57. // @Param userid query int true "用户ID"
  58. // @Param status query string false "策略状态(可多选,逗号隔开) - 1:正常 2:暂停 3:终止"
  59. // @Success 200 {array} models.QhjRStrategy
  60. // @Failure 500 {object} app.Response
  61. // @Router /Qhj/QueryRStrategy [get]
  62. // @Tags 大连千海金
  63. func QueryRStrategy(c *gin.Context) {
  64. a := app.GinUtils{Gin: app.Gin{C: c}}
  65. req := struct {
  66. USERID int64 `form:"userid" binding:"required"` // 用户id
  67. STATUS string `form:"status"` // 状态
  68. }{}
  69. a.DoBindReq(&req)
  70. m := models.QhjRStrategy{USERID: req.USERID, FilterStatus: req.STATUS}
  71. a.DoGetDataI(&m)
  72. }
  73. // QueryRSTriggerLog
  74. // @Summary 查询定投记录(定投管理/详情/定投记录)
  75. // @Produce json
  76. // @Security ApiKeyAuth
  77. // @Param userid query int true "用户ID"
  78. // @Param regularlystrategyid query int false "定投策略id"
  79. // @Success 200 {array} models.QhjRSTriggerLog
  80. // @Failure 500 {object} app.Response
  81. // @Router /Qhj/QueryRSTriggerLog [get]
  82. // @Tags 大连千海金
  83. func QueryRSTriggerLog(c *gin.Context) {
  84. a := app.GinUtils{Gin: app.Gin{C: c}}
  85. req := struct {
  86. USERID int64 `form:"userid" binding:"required"` // 用户id
  87. REGULARLYSTRATEGYID int64 `form:"regularlystrategyid"` // 策略id
  88. }{}
  89. a.DoBindReq(&req)
  90. m := models.QhjRSTriggerLog{USERID: req.USERID, REGULARLYSTRATEGYID: req.REGULARLYSTRATEGYID}
  91. a.DoGetDataI(&m)
  92. }
  93. // QueryUserReceiveInfo
  94. // @Summary 查询收货地址信息
  95. // @Produce json
  96. // @Security ApiKeyAuth
  97. // @Param userid query int true "用户ID"
  98. // @Success 200 {array} models.UserReceiveInfo
  99. // @Failure 500 {object} app.Response
  100. // @Router /Qhj/QueryUserReceiveInfo [get]
  101. // @Tags 大连千海金
  102. func QueryUserReceiveInfo(c *gin.Context) {
  103. a := app.GinUtils{Gin: app.Gin{C: c}}
  104. req := struct {
  105. USERID int64 `form:"userid" binding:"required"` // 用户id
  106. }{}
  107. a.DoBindReq(&req)
  108. m := models.UserReceiveInfo{USERID: req.USERID}
  109. a.DoGetDataI(&m)
  110. }
  111. // QueryUserCollectConfig
  112. // @Summary 查询提现账户设置
  113. // @Produce json
  114. // @Security ApiKeyAuth
  115. // @Param userid query int true "用户ID"
  116. // @Success 200 {array} models.UserCollectConfig
  117. // @Failure 500 {object} app.Response
  118. // @Router /Qhj/QueryUserCollectConfig [get]
  119. // @Tags 大连千海金
  120. func QueryUserCollectConfig(c *gin.Context) {
  121. a := app.GinUtils{Gin: app.Gin{C: c}}
  122. req := struct {
  123. USERID int64 `form:"userid" binding:"required"` // 用户id
  124. }{}
  125. a.DoBindReq(&req)
  126. m := models.UserCollectConfig{USERID: mtpcache.GetAreaUserId(req.USERID, 0)}
  127. a.DoGetDataI(&m)
  128. }
  129. // QueryTradeGoodsPickup
  130. // @Summary 查询提货
  131. // @Produce json
  132. // @Security ApiKeyAuth
  133. // @Param userid query int true "用户ID"
  134. // @Success 200 {array} models.QhjTradeGoodsPickup
  135. // @Failure 500 {object} app.Response
  136. // @Router /Qhj/QueryTradeGoodsPickup [get]
  137. // @Tags 大连千海金
  138. func QueryTradeGoodsPickup(c *gin.Context) {
  139. a := app.GinUtils{Gin: app.Gin{C: c}}
  140. req := struct {
  141. USERID int64 `form:"userid" binding:"required"` // 用户id
  142. }{}
  143. a.DoBindReq(&req)
  144. m := models.QhjTradeGoodsPickup{USERID: req.USERID}
  145. a.DoGetDataI(&m)
  146. }
  147. // QueryPickGoods
  148. // @Summary 查询提货商品
  149. // @Produce json
  150. // @Security ApiKeyAuth
  151. // @Param status query string false "状态(可多选,逗号隔开) - 1:正常 2:停用 3:注销"
  152. // @Success 200 {array} models.QhjPickGoods
  153. // @Failure 500 {object} app.Response
  154. // @Router /Qhj/QueryPickGoods [get]
  155. // @Tags 大连千海金
  156. func QueryPickGoods(c *gin.Context) {
  157. a := app.GinUtils{Gin: app.Gin{C: c}}
  158. req := struct {
  159. STATUS string `form:"status"` // 用户id
  160. }{}
  161. a.DoBindReq(&req)
  162. m := models.QhjPickGoods{FilterStatus: req.STATUS}
  163. a.DoGetDataI(&m)
  164. }
  165. // QueryPickArea
  166. // @Summary 查询提货门店
  167. // @Produce json
  168. // @Security ApiKeyAuth
  169. // @Param userid query int false "用户ID"
  170. // @Success 200 {array} models.QhjPickArea
  171. // @Failure 500 {object} app.Response
  172. // @Router /Qhj/QueryPickArea [get]
  173. // @Tags 大连千海金
  174. func QueryPickArea(c *gin.Context) {
  175. a := app.GinUtils{Gin: app.Gin{C: c}}
  176. req := struct {
  177. USERID int64 `form:"userid"` // 用户id
  178. }{}
  179. a.DoBindReq(&req)
  180. m := models.QhjPickArea{USERID: req.USERID}
  181. a.DoGetDataI(&m)
  182. }
  183. // QueryBankAccountSign
  184. // @Summary 查询签约银行信息(提现账户管理)
  185. // @Produce json
  186. // @Security ApiKeyAuth
  187. // @Param userid query int true "用户ID"
  188. // @Success 200 {array} models.QhjBankAccountSign
  189. // @Failure 500 {object} app.Response
  190. // @Router /Qhj/QueryBankAccountSign [get]
  191. // @Tags 大连千海金
  192. func QueryBankAccountSign(c *gin.Context) {
  193. a := app.GinUtils{Gin: app.Gin{C: c}}
  194. req := struct {
  195. USERID int64 `form:"userid" binding:"required"` // 用户id
  196. }{}
  197. a.DoBindReq(&req)
  198. m := models.QhjBankAccountSign{RELATEDUSERID: req.USERID}
  199. a.DoGetDataI(&m)
  200. }
  201. // QueryBankInfo
  202. // @Summary 查询开户行
  203. // @Produce json
  204. // @Security ApiKeyAuth
  205. // @Success 200 {array} models.QhjBankInfo
  206. // @Failure 500 {object} app.Response
  207. // @Router /Qhj/QueryBankInfo [get]
  208. // @Tags 大连千海金
  209. func QueryBankInfo(c *gin.Context) {
  210. a := app.GinUtils{Gin: app.Gin{C: c}}
  211. m := models.QhjBankInfo{}
  212. a.DoGetDataI(&m)
  213. }
  214. // QueryReckonPriceLog
  215. // @Summary 查询定投价(结算价)
  216. // @Produce json
  217. // @Security ApiKeyAuth
  218. // @Param goodsid query int false "商品ID"
  219. // @Param tradedate query string false "交易日 格式(yyyymmdd)"
  220. // @Success 200 {array} models.QhjReckonPriceLog
  221. // @Failure 500 {object} app.Response
  222. // @Router /Qhj/QueryReckonPriceLog [get]
  223. // @Tags 大连千海金
  224. func QueryReckonPriceLog(c *gin.Context) {
  225. a := app.GinUtils{Gin: app.Gin{C: c}}
  226. m := models.QhjReckonPriceLog{}
  227. a.DoBindReq(&m)
  228. a.DoGetDataI(&m)
  229. }
  230. // QueryCustomerInfo
  231. // @Summary 查询客户资料
  232. // @Produce json
  233. // @Security ApiKeyAuth
  234. // @Param userid query int true "用户ID"
  235. // @Param querytype query int true "查询类型 1:未提交(网上开户表) 2:待审核(网上开户表) 3:正常 4:停用"
  236. // @Param userinfotype query int false "客户类型 1-个人 2-企业"
  237. // @Param customername query string false "客户名称(模糊匹配)"
  238. // @Param nickname query string false "昵称(模糊匹配)"
  239. // @Param includesub query int false "是否包含子级 1-包含"
  240. // @Success 200 {array} models.QhjCustomer
  241. // @Failure 500 {object} app.Response
  242. // @Router /Qhj/QueryCustomerInfo [get]
  243. // @Tags 大连千海金
  244. func QueryCustomerInfo(c *gin.Context) {
  245. a := app.GinUtils{Gin: app.Gin{C: c}}
  246. req := struct {
  247. USERID int64 `form:"userid" binding:"required"` // 用户id
  248. QUERYTYPE int32 `form:"querytype" binding:"required,min=1,max=4"` // 查询类型
  249. USERINFOTYPE int32 `form:"userinfotype"` // 客户类型
  250. CUSTOMERNAME string `form:"customername"` // 客户名称
  251. NICKNAME string `form:"nickname"` // 昵称
  252. INCLUDESUB int32 `form:"includesub"` // 是否包含子级
  253. }{}
  254. a.DoBindReq(&req)
  255. m := models.QhjCustomer{USERID: req.USERID, USERINFOTYPE: req.USERINFOTYPE, QUERYTYPE: req.QUERYTYPE,
  256. CUSTOMERNAME: req.CUSTOMERNAME, NICKNAME: req.NICKNAME, IncludeSub: req.INCLUDESUB}
  257. a.DoGetDataI(&m)
  258. }
  259. // QueryCusBankSignBank
  260. // @Summary 查询托管银行
  261. // @Produce json
  262. // @Security ApiKeyAuth
  263. // @Success 200 {array} models.QhjCusBankSignBankEx
  264. // @Failure 500 {object} app.Response
  265. // @Router /Qhj/QueryCusBankSignBank [get]
  266. // @Tags 大连千海金
  267. func QueryCusBankSignBank(c *gin.Context) {
  268. a := app.GinUtils{Gin: app.Gin{C: c}}
  269. m := models.QhjCusBankSignBankEx{}
  270. a.DoGetDataI(&m)
  271. }
  272. // QuerySiteColumnDetail
  273. // @Summary 查询资讯
  274. // @Produce json
  275. // @Security ApiKeyAuth
  276. // @Param userid query int true "用户ID"
  277. // @Success 200 {array} models.QhjSiteColumnDetail
  278. // @Failure 500 {object} app.Response
  279. // @Router /Qhj/QuerySiteColumnDetail [get]
  280. // @Tags 大连千海金
  281. func QuerySiteColumnDetail(c *gin.Context) {
  282. a := app.GinUtils{Gin: app.Gin{C: c}}
  283. req := struct {
  284. USERID int64 `form:"userid"` // 用户id
  285. }{}
  286. a.DoBindReq(&req)
  287. m := models.QhjSiteColumnDetail{USERID: req.USERID}
  288. a.DoGetDataI(&m)
  289. }
  290. // QueryAccountInOutApply
  291. // @Summary 查询充值提现
  292. // @Produce json
  293. // @Security ApiKeyAuth
  294. // @Param begindate query string false "申请起始日期(格式yyyymmdd)"
  295. // @Param enddate query string false "申请截止日期(格式yyyymmdd)"
  296. // @Param likename query string false "模糊搜索名称"
  297. // @Success 200 {array} models.QhjAccountOutInApply
  298. // @Failure 500 {object} app.Response
  299. // @Router /Qhj/QueryAccountInOutApply [get]
  300. // @Tags 大连千海金
  301. func QueryAccountInOutApply(c *gin.Context) {
  302. a := app.GinUtils{Gin: app.Gin{C: c}}
  303. req := struct {
  304. BEGINDATE string `form:"begindate"` // 开始申请日期
  305. ENDDATE string `form:"enddate"` // 结束申请日期
  306. LIKENAME string `form:"likename"` // 模糊搜索名称
  307. }{}
  308. a.DoBindReq(&req)
  309. a.CheckParamF(func() bool {
  310. if len(req.BEGINDATE) > 0 && len(req.BEGINDATE) != 8 {
  311. return false
  312. }
  313. if len(req.ENDDATE) > 0 && len(req.ENDDATE) != 8 {
  314. return false
  315. }
  316. for i := range req.BEGINDATE {
  317. if req.BEGINDATE[i] < '0' || req.BEGINDATE[i] > '9' {
  318. return false
  319. }
  320. }
  321. for i := range req.ENDDATE {
  322. if req.ENDDATE[i] < '0' || req.ENDDATE[i] > '9' {
  323. return false
  324. }
  325. }
  326. return true
  327. })
  328. m := models.QhjAccountOutInApply{BeginDate: req.BEGINDATE, EndDate: req.ENDDATE, FilterName: req.LIKENAME}
  329. a.DoGetDataI(&m)
  330. }
  331. // QueryPayOrder
  332. // @Summary 查询待付款单据
  333. // @Produce json
  334. // @Security ApiKeyAuth
  335. // @Param accountid query int true "资金账号id"
  336. // @Param tradeid query int false "成交单号"
  337. // @Param payflag query int false "付款标识 - 1:未支付 2:已支付 3:已过期 4:已撤销 5:结算过期 6:预售终止"
  338. // @Success 200 {array} models.QhjPayOrder
  339. // @Failure 500 {object} app.Response
  340. // @Router /Qhj/QueryPayOrder [get]
  341. // @Tags 大连千海金
  342. func QueryPayOrder(c *gin.Context) {
  343. a := app.GinUtils{Gin: app.Gin{C: c}}
  344. req := struct {
  345. ACCOUNTID int64 `form:"accountid" binding:"required"` // 用户id
  346. TRADEID string `form:"tradeid"` // 成交单号
  347. PAYFLAG int32 `form:"payflag"` // 付款标识
  348. }{}
  349. a.DoBindReq(&req)
  350. m := models.QhjPayOrder{BUYACCOUNTID: req.ACCOUNTID, TRADEID: req.TRADEID, PAYFLAG: req.PAYFLAG}
  351. a.DoGetDataI(&m)
  352. }
  353. // QueryGoodsEx
  354. // @Summary 交易商品扩展表
  355. // @Produce json
  356. // @Security ApiKeyAuth
  357. // @Param goodsid query int false "商品id"
  358. // @Success 200 {array} models.Qhjgoodsex
  359. // @Failure 500 {object} app.Response
  360. // @Router /Qhj/QueryGoodsEx [get]
  361. // @Tags 大连千海金
  362. func QueryGoodsEx(c *gin.Context) {
  363. a := app.GinUtils{Gin: app.Gin{C: c}}
  364. req := struct {
  365. GOODSID int `form:"goodsid"` // 商品id
  366. }{}
  367. a.DoBindReq(&req)
  368. m := models.Qhjgoodsex{Goodsid: int32(req.GOODSID)}
  369. a.DoGetDataI(&m)
  370. }
  371. // QueryParentAreaList
  372. // @Summary 查询所属机构列表
  373. // @Produce json
  374. // @Security ApiKeyAuth
  375. // @Param userid query int true "用户ID"
  376. // @Success 200 {array} models.QhjParentAreaList
  377. // @Failure 500 {object} app.Response
  378. // @Router /Qhj/QueryParentAreaList [get]
  379. // @Tags 大连千海金
  380. func QueryParentAreaList(c *gin.Context) {
  381. a := app.GinUtils{Gin: app.Gin{C: c}}
  382. req := struct {
  383. USERID int64 `form:"userid" binding:"required"` // 用户id
  384. }{}
  385. a.DoBindReq(&req)
  386. m := models.QhjParentAreaList{USERID: mtpcache.GetAreaUserId(req.USERID, 0)}
  387. a.DoGetDataI(&m)
  388. }