|
|
@@ -316,3 +316,56 @@ func SearchWhite(c *gin.Context) {
|
|
|
logger.GetLogger().Infof("SearchWhite successed: %v", datas)
|
|
|
appG.Response(http.StatusOK, e.SUCCESS, datas)
|
|
|
}
|
|
|
+
|
|
|
+// QueryConvertConfigReq 查询交易系统转换设置请求参数
|
|
|
+type QueryConvertConfigReq struct {
|
|
|
+ ConvertType int `form:"convertType"` // 转换类型 - 1:金点赞转交易 2:金点拍转交易
|
|
|
+ OuterGoodsCode string `form:"outerGoodsCode"` // 外部商品代码[JD\PD]
|
|
|
+ InnerGoodsIDs string `form:"innerGoodsIDs"` // 内部商品ID列表[交易]
|
|
|
+}
|
|
|
+
|
|
|
+// QueryConvertConfig 查询交易系统转换设置
|
|
|
+// @Summary 查询交易系统转换设置
|
|
|
+// @Produce json
|
|
|
+// @Security ApiKeyAuth
|
|
|
+// @Param convertType query int false "转换类型 - 1:金点赞转交易 2:金点拍转交易"
|
|
|
+// @Param outerGoodsCode query string false "外部商品代码[JD\PD]"
|
|
|
+// @Param innerGoodsIDs query string false "内部商品ID列表[交易],格式:1,2,3"
|
|
|
+// @Success 200 {object} models.Szdz3convertconfig
|
|
|
+// @Failure 500 {object} app.Response
|
|
|
+// @Router /SZDZ/QueryConvertConfig [get]
|
|
|
+// @Tags 定制【尚志大宗】
|
|
|
+func QueryConvertConfig(c *gin.Context) {
|
|
|
+ appG := app.Gin{C: c}
|
|
|
+
|
|
|
+ // 获取请求参数
|
|
|
+ var req QueryConvertConfigReq
|
|
|
+ if err := appG.C.ShouldBindQuery(&req); err != nil {
|
|
|
+ logger.GetLogger().Errorf("QueryConvertConfigReq failed: %s", err.Error())
|
|
|
+ appG.Response(http.StatusBadRequest, e.INVALID_PARAMS, nil)
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ datas := make([]models.Szdz3convertconfig, 0)
|
|
|
+ engine := db.GetEngine()
|
|
|
+ s := engine.Table("SZDZ3_CONVERTCONFIG")
|
|
|
+ if req.ConvertType > 0 {
|
|
|
+ s = s.And("CONVERTTYPE = ?", req.ConvertType)
|
|
|
+ }
|
|
|
+ if len(req.OuterGoodsCode) > 0 {
|
|
|
+ s = s.And("OUTERGOODSCODE = ?", req.OuterGoodsCode)
|
|
|
+ }
|
|
|
+ if len(req.InnerGoodsIDs) > 0 {
|
|
|
+ s = s.And(fmt.Sprintf("INNERGOODSID in (%s)", req.InnerGoodsIDs))
|
|
|
+ }
|
|
|
+ if err := s.Find(&datas); err != nil {
|
|
|
+ // 查询失败
|
|
|
+ logger.GetLogger().Errorf("QueryConvertConfigReq failed: %s", err.Error())
|
|
|
+ appG.Response(http.StatusBadRequest, e.ERROR_QUERY_FAIL, nil)
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ // 查询成功返回
|
|
|
+ logger.GetLogger().Infof("QueryConvertConfigReq successed: %v", datas)
|
|
|
+ appG.Response(http.StatusOK, e.SUCCESS, datas)
|
|
|
+}
|