Explorar el Código

后端: 集中评审导出

baichengfei hace 4 años
padre
commit
c9713e5d01
Se han modificado 1 ficheros con 10 adiciones y 11 borrados
  1. 10 11
      src/dashoo.cn/backend/api/controllers/oilsupplier/supplier.go

+ 10 - 11
src/dashoo.cn/backend/api/controllers/oilsupplier/supplier.go

@@ -967,7 +967,7 @@ func (this *OilSupplierController) JzpsListExport() {
 	}
 	dir := "static/file/excel/report/" + this.GetAccode()
 	SaveDirectory(dir)
-	path := dir + "/" + utils.TimeFormat(time.Now(), "20060102") + fileTitle + ".xlsx"
+	path := dir + "/jzps_" + utils.TimeFormat(time.Now(), "20060102") + fileTitle + ".xlsx"
 	f.Save(path)
 	var sw *Seaweed
 	var filer []string
@@ -2904,7 +2904,7 @@ func (this *OilSupplierController) CheckSupplierFile() {
 		//对准入范围的判断
 		var certSubList []suppliercertsub.OilSupplierCertSub
 		certsubService := suppliercertsub.GetOilSupplierCertSubService(utils.DBE)
-		certsubService.GetEntitysByWhere(OilSupplierCertSubName, "SupplierCertId = " + strconv.Itoa(cert.Id) + " and Type != '2'", &certSubList)
+		certsubService.GetEntitysByWhere(OilSupplierCertSubName, "SupplierCertId = "+strconv.Itoa(cert.Id)+" and Type != '2'", &certSubList)
 
 		idString := ""
 		idString1 := ""
@@ -3035,7 +3035,7 @@ func (this *OilSupplierController) CheckSupplierFileNew() {
 
 	// 查询出已有哪些资质
 	var tableheaderList []qualchange.OilQualChangeDetail1
-	fileSql := "SELECT * from OilSupplierFile WHERE SupplierId = " + strconv.Itoa(file.SupplierId)  + " and SupType in (0,1,2,3,5)"
+	fileSql := "SELECT * from OilSupplierFile WHERE SupplierId = " + strconv.Itoa(file.SupplierId) + " and SupType in (0,1,2,3,5)"
 	svcHeader := tableheader.GetTableHeaderService(utils.DBE)
 	svcHeader.DBE.SQL(fileSql).Find(&tableheaderList)
 	var companyHasHeaders string
@@ -3391,7 +3391,7 @@ func (this *OilSupplierController) CheckSupplierFileList() {
 	// 查询出已有哪些资质
 	var tableheaderList []qualchange.OilQualChangeDetail1
 	whereInfoFile := ""
-	if file.CertId == "0"{
+	if file.CertId == "0" {
 		// 信息变更 不获取 增项和年审审核中的数据
 		whereInfoFile = " and SupType in (0,1,3,4,5)"
 	} else {
@@ -3408,12 +3408,12 @@ func (this *OilSupplierController) CheckSupplierFileList() {
 	filesvc := supplierfile.GetSupplierfileService(utils.DBE)
 	mergerCertSkipField := paramSvc.GetBaseparameterMessage("GFGL", "paramset", "MergerCertSkipFieldName")
 
-	for _,cert := range certList {
+	for _, cert := range certList {
 		if file.CertId != "0" && strconv.Itoa(cert.Id) != file.CertId {
 			continue
 		}
 		whereInfo := ""
-		if file.CertId == "0"{
+		if file.CertId == "0" {
 			// 信息变更 不获取 增项审核中的数据
 			whereInfo = " and Type != '2'"
 		}
@@ -3421,12 +3421,12 @@ func (this *OilSupplierController) CheckSupplierFileList() {
 		var certSubList2 suppliercertsub.OilSupplierCertSub
 		certSubList2.LackFile = ""
 		certSubList2.IsQuestion = 0
-		svcHeader.UpdateEntityBywheretbl(OilSupplierCertSubName, &certSubList2, []string{"LackFile", "IsQuestion"}, "IsQuestion = 2 and SupplierId = "+strconv.Itoa(supplierEntity.Id)+" and SupplierCertId = "+strconv.Itoa(cert.Id) + whereInfo)
+		svcHeader.UpdateEntityBywheretbl(OilSupplierCertSubName, &certSubList2, []string{"LackFile", "IsQuestion"}, "IsQuestion = 2 and SupplierId = "+strconv.Itoa(supplierEntity.Id)+" and SupplierCertId = "+strconv.Itoa(cert.Id)+whereInfo)
 
 		//对准入范围的判断
 		var certSubList []suppliercertsub.OilSupplierCertSub
 		certsubService.GetListByCertId(strconv.Itoa(cert.Id), &certSubList)
-		certsubService.GetEntitysByWhere(OilSupplierCertSubName, "SupplierCertId = " + strconv.Itoa(cert.Id) + whereInfo, &certSubList)
+		certsubService.GetEntitysByWhere(OilSupplierCertSubName, "SupplierCertId = "+strconv.Itoa(cert.Id)+whereInfo, &certSubList)
 		idString := ""
 		idString1 := ""
 		for i := 0; i < len(certSubList); i = i + 1000 {
@@ -3537,11 +3537,10 @@ func (this *OilSupplierController) CheckSupplierFileList() {
 			}
 		}
 
-
 	}
 	var certSubList1 []suppliercertsub.OilSupplierCertSub
 	var total int64
-	where3 := "IsQuestion = 2 and SupplierId = "+strconv.Itoa(supplierEntity.Id)
+	where3 := "IsQuestion = 2 and SupplierId = " + strconv.Itoa(supplierEntity.Id)
 	if file.FileName != "" {
 		where3 += " and LackFile like '%" + file.FileName + "%'"
 	}
@@ -3549,7 +3548,7 @@ func (this *OilSupplierController) CheckSupplierFileList() {
 		where3 += " and Name like '%" + file.SubName + "%'"
 	}
 	if file.CertId != "0" {
-		where3 += " and SupplierCertId = "+file.CertId
+		where3 += " and SupplierCertId = " + file.CertId
 	}
 	total = certsubService.GetPagingEntitiesWithOrderBytbl("", file.CurrentPage, file.Size, "Id", true, &certSubList1, where3)