|
|
@@ -1,10 +1,12 @@
|
|
|
package szdz
|
|
|
|
|
|
import (
|
|
|
+ "fmt"
|
|
|
"mtp2_if/db"
|
|
|
"mtp2_if/global/app"
|
|
|
"mtp2_if/global/e"
|
|
|
"mtp2_if/logger"
|
|
|
+ "mtp2_if/models"
|
|
|
"net/http"
|
|
|
|
|
|
"github.com/gin-gonic/gin"
|
|
|
@@ -99,7 +101,54 @@ func QueryRecieptOrder(c *gin.Context) {
|
|
|
}
|
|
|
datas = append(datas, d2...)
|
|
|
|
|
|
+ // FIXME: - 排序 & 分页
|
|
|
+
|
|
|
// 查询成功返回
|
|
|
logger.GetLogger().Infof("QueryRecieptOrder successed: %v", datas)
|
|
|
appG.Response(http.StatusOK, e.SUCCESS, datas)
|
|
|
}
|
|
|
+
|
|
|
+// QueryGoodsPickupReq 商品提货单查询请求参数
|
|
|
+type QueryGoodsPickupReq struct {
|
|
|
+ AccountID string `form:"accountID" binding:"required"`
|
|
|
+ TakeOrderStatus int `form:"takeOrderStatus"`
|
|
|
+}
|
|
|
+
|
|
|
+// QueryGoodsPickup 商品提货单查询
|
|
|
+// @Summary 商品提货单查询
|
|
|
+// @Produce json
|
|
|
+// @Security ApiKeyAuth
|
|
|
+// @Param accountID query string true "资金账户 - 格式:1,2,3"
|
|
|
+// @Param takeOrderStatus query int false "提货状态 - 1:待发货 2:已发货 3:已收货"
|
|
|
+// @Success 200 {object} models.Szdz3goodspickup
|
|
|
+// @Failure 500 {object} app.Response
|
|
|
+// @Router /SZDZ/QueryGoodsPickup [get]
|
|
|
+// @Tags 尚志大宗
|
|
|
+func QueryGoodsPickup(c *gin.Context) {
|
|
|
+ appG := app.Gin{C: c}
|
|
|
+
|
|
|
+ // 获取请求参数
|
|
|
+ var req QueryGoodsPickupReq
|
|
|
+ if err := appG.C.ShouldBindQuery(&req); err != nil {
|
|
|
+ logger.GetLogger().Errorf("QueryGoodsPickup failed: %s", err.Error())
|
|
|
+ appG.Response(http.StatusBadRequest, e.INVALID_PARAMS, nil)
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ datas := make([]models.Szdz3goodspickup, 0)
|
|
|
+ engine := db.GetEngine()
|
|
|
+ s := engine.Where(fmt.Sprintf(`ACCOUNTID in (%s)`, req.AccountID))
|
|
|
+ if req.TakeOrderStatus > 0 {
|
|
|
+ s = s.And("TAKEORDERSTATUS = ?", req.TakeOrderStatus)
|
|
|
+ }
|
|
|
+ if err := s.Find(&datas); err != nil {
|
|
|
+ // 查询失败
|
|
|
+ logger.GetLogger().Errorf("QueryGoodsPickup failed: %s", err.Error())
|
|
|
+ appG.Response(http.StatusBadRequest, e.ERROR_QUERY_FAIL, nil)
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ // 查询成功返回
|
|
|
+ logger.GetLogger().Infof("QueryGoodsPickup successed: %v", datas)
|
|
|
+ appG.Response(http.StatusOK, e.SUCCESS, datas)
|
|
|
+}
|