csx 3 years ago
parent
commit
a9e7632a5d
1 changed files with 11 additions and 6 deletions
  1. 11 6
      service/bl_service.go

+ 11 - 6
service/bl_service.go View File

239
 }
239
 }
240
 
240
 
241
 func GetResultRecord() (record []CmResult, err error) {
241
 func GetResultRecord() (record []CmResult, err error) {
242
-	err = dataBase.Model(&CmResult{}).Order("barcode asc").Find(&record).Error
242
+	err = dataBase.Model(&CmResult{}).Where("repdate >= 2021-08-12 00:00:00").Order("barcode asc").Find(&record).Error
243
 	return
243
 	return
244
 }
244
 }
245
 
245
 
246
 func GetResultRecordByID(id int64) (record []CmResult, err error) {
246
 func GetResultRecordByID(id int64) (record []CmResult, err error) {
247
-	err = readDb.Model(&CmResult{}).Where("barcode > ?", id).Order("barcode asc").Find(&record).Error
247
+	err = readDb.Model(&CmResult{}).Where("barcode > ? AND repdate >= 2021-08-12 00:00:00", id).Order("barcode asc").Find(&record).Error
248
 	return
248
 	return
249
 }
249
 }
250
 
250
 
535
 
535
 
536
 			//插入到系统检验检查数据
536
 			//插入到系统检验检查数据
537
 			for _, item := range list {
537
 			for _, item := range list {
538
-				fmt.Println(item)
539
-
540
 				project_id := int64(0)
538
 				project_id := int64(0)
541
-				if len("180") > 0 {
539
+				if len(item.Barcode) > 0 {
542
 					project_id, _ = GetBljhProjectID(org_id, item.Groupname)
540
 					project_id, _ = GetBljhProjectID(org_id, item.Groupname)
543
 				} else {
541
 				} else {
544
 					continue
542
 					continue
545
 				}
543
 				}
546
-				printInfo, _ := GetHisLabelPrintInfoById("180")
544
+				printInfo, _ := GetHisLabelPrintInfoById(item.Barcode)
545
+
546
+				if printInfo.ID == 0 {
547
+					fmt.Println(item)
548
+					fmt.Println(printInfo)
549
+					fmt.Println("数据查询不到")
550
+					continue
551
+				}
547
 
552
 
548
 				item_id, _ := GetBlItemID(org_id, item.Groupname, item.Itemname, project_id)
553
 				item_id, _ := GetBlItemID(org_id, item.Groupname, item.Itemname, project_id)
549
 
554