Jelajahi Sumber

后端: 获取缺资质的准入列表

baichengfei 4 tahun lalu
induk
melakukan
a2df32ba40
1 mengubah file dengan 15 tambahan dan 19 penghapusan
  1. 15 19
      src/dashoo.cn/backend/api/controllers/oilsupplier/supplier.go

+ 15 - 19
src/dashoo.cn/backend/api/controllers/oilsupplier/supplier.go

@@ -3807,9 +3807,6 @@ func (this *OilSupplierController) CheckSupplierFileList() {
 }
 
 func (this *OilSupplierController) markLackCert(file supplierfile.CheckFile) {
-	//var file supplierfile.CheckFile
-	var jsonBlob = this.Ctx.Input.RequestBody
-	json.Unmarshal(jsonBlob, &file)
 	//获取主表信息
 	var supplierEntity supplier.OilSupplier
 	supplierService := supplier.GetOilSupplierService(utils.DBE)
@@ -3965,19 +3962,6 @@ func (this *OilSupplierController) markLackCert(file supplierfile.CheckFile) {
 		}
 
 	}
-	var certList1 []suppliercert.OilSupplierCert
-	var total int64
-	where3 := "IsLack = 2 "
-
-	total = certService.GetPagingEntitiesWithOrderBytbl("", file.CurrentPage, file.Size, "Id", true, &certList1, where3)
-
-	var datainfo DataInfo
-	datainfo.CurrentItemCount = total
-	datainfo.PageIndex = file.CurrentPage
-	datainfo.ItemsPerPage = file.Size
-	datainfo.Items = certList1
-	this.Data["json"] = &datainfo
-	this.ServeJSON()
 }
 
 // @Title 对外-招投标系统
@@ -4051,16 +4035,28 @@ func (this *OilSupplierController) GetSupplierCertId() {
 // @Success 200 {object}
 // @router /lack-cert-list [get]
 func (this *OilSupplierController) GetLackCertList() {
+	supService := supplier.GetOilSupplierService(utils.DBE)
+	var supEntity supplier.OilSupplier
 	certService := suppliercert.GetOilSupplierCertService(utils.DBE)
 	var allCertList []suppliercert.OilSupplierCert
-	where := " Status = '8' or Status = '11' "
-	certService.GetEntitysByWhere(OilSupplierCertName, where, &allCertList)
+	whereCert := " Status = '8' or Status = '11' "
+	certService.GetEntitysByWhere(OilSupplierCertName, whereCert, &allCertList)
 	if len(allCertList) > 0 {
+		log.Println("共查询到准入条数:", len(allCertList))
 		for _, certEntity := range allCertList {
+			supService.GetEntityById(certEntity.SupplierId, &supEntity)
 			var file supplierfile.CheckFile
-			file.CertId = string(certEntity.Id)
+			file.CertId = strconv.Itoa(certEntity.Id)
+			file.SupplierId = certEntity.SupplierId
+			file.Grade = supEntity.Grade
+			if supEntity.OperType == "制造商" {
+				file.Type = 1
+			} else if supEntity.OperType == "非制造商" {
+				file.Type = 2
+			}
 			// 其他字段值
 			this.markLackCert(file)
+			log.Println("标记准入缺资质")
 		}
 	}
 }