Bladeren bron

Merge branch 'master' of 192.168.30.132:MTP2.0/MTP20_IF

zhou.xiaoning 4 jaren geleden
bovenliggende
commit
d961e55b8e
3 gewijzigde bestanden met toevoegingen van 10 en 5 verwijderingen
  1. 2 1
      controllers/ermcp/qryMiddleGoods.go
  2. 2 1
      controllers/ermcp/qryWrstandard.go
  3. 6 3
      models/ermcpWrstandard.go

+ 2 - 1
controllers/ermcp/qryMiddleGoods.go

@@ -69,6 +69,7 @@ func QueryMiddleGoodsDetail(c *gin.Context) {
 	if d, err := m.GetData(); err == nil {
 		appG.Response(http.StatusOK, e.SUCCESS, d)
 	} else {
-		appG.Response(http.StatusBadRequest, e.ERROR_QUERY_FAIL, nil)
+		//appG.Response(http.StatusBadRequest, e.ERROR_QUERY_FAIL, nil)
+		appG.Response(http.StatusOK, e.SUCCESS, nil)
 	}
 }

+ 2 - 1
controllers/ermcp/qryWrstandard.go

@@ -84,6 +84,7 @@ func QueryWrStandardDetail(c *gin.Context) {
 	if d, err := m.GetData(); err == nil {
 		appG.Response(http.StatusOK, e.SUCCESS, d)
 	} else {
-		appG.Response(http.StatusBadRequest, e.ERROR_QUERY_FAIL, nil)
+		//appG.Response(http.StatusBadRequest, e.ERROR_QUERY_FAIL, nil)
+		appG.Response(http.StatusOK, e.SUCCESS, nil)
 	}
 }

+ 6 - 3
models/ermcpWrstandard.go

@@ -49,11 +49,14 @@ func (r *ErmcpWrstandard) buildSql() string {
 		"       REMARK," +
 		"       AREAUSERID" +
 		"  from wrstandard t" +
-		" where t.AREAUSERID=%v and t.ISVALID=%v"
-	sqlId := fmt.Sprintf(str, r.AREAUSERID, r.ISVALID)
+		" where t.AREAUSERID=%v"
+	sqlId := fmt.Sprintf(str, r.AREAUSERID)
 	if r.WRSTANDARDID > 0 {
 		sqlId = sqlId + fmt.Sprintf(" and WRSTANDARDID=%v", r.WRSTANDARDID)
 	}
+	if r.ISVALID >= 0{
+		sqlId = sqlId + fmt.Sprintf(" and t.ISVALID=%v", r.ISVALID)
+	}
 	return sqlId
 }
 
@@ -205,7 +208,7 @@ type ErmcpWrstandDetail struct {
 // 查询现货商品详细
 func (r *ErmcpWrstandDetail) GetData() (ErmcpWrstandDetail, error) {
 	// 获取基本信息
-	m := ErmcpWrstandard{AREAUSERID: r.Wrd.AREAUSERID, WRSTANDARDID: r.Wrd.WRSTANDARDID}
+	m := ErmcpWrstandard{AREAUSERID: r.Wrd.AREAUSERID, WRSTANDARDID: r.Wrd.WRSTANDARDID, ISVALID: -1}
 	d, err := m.GetData()
 	if err != nil {
 		return ErmcpWrstandDetail{}, err