Ver Fonte

crontab: heathle update

Yi há 2 semanas atrás
pai
commit
d8a62592dc

+ 2 - 1
module/crontab/cow_neck_ring_error.go

@@ -103,7 +103,7 @@ func (e *Entry) CowNeckRingError(pastureId int64) {
 				Status:      pasturePb.IsShow_No,
 				ErrorKind:   c4,
 				ErrorReason: errorMap[c4],
-				Describe:    errorMap[c4],
+				Describe:    "",
 			}
 		}
 
@@ -121,6 +121,7 @@ func (e *Entry) CowNeckRingError(pastureId int64) {
 		}
 	}
 
+	zaplog.Info("CowNeckRingError", zap.Any("updateNeckRingMap", updateNeckRingMap))
 	if len(updateNeckRingMap) > 0 {
 		for id, v := range updateNeckRingMap {
 			if err := e.DB.Model(new(model.NeckRing)).

+ 2 - 1
module/crontab/health_waning.go

@@ -148,7 +148,8 @@ func (e *Entry) FindNeckRingError(pastureId int64, neckRingNumber string) bool {
 		Where("pasture_id = ?", pastureId).
 		Where("neck_ring_number = ?", neckRingNumber).
 		Where("status = ?", pasturePb.IsShow_No).
-		Where("error_kind = ?", pasturePb.NeckRingNumberError_Suspected_Fall_Off).
+		Where(e.DB.Where("error_kind = ?", pasturePb.NeckRingNumberError_Suspected_Fall_Off).
+			Or("error_kind = ?", pasturePb.NeckRingNumberError_Receiving_Less)).
 		Count(&count).Error; err != nil {
 		return false
 	}

+ 0 - 2
module/crontab/neck_ring_estrus.go

@@ -400,7 +400,6 @@ func calculateActiveLevel(cft float32, cowEstrus *CowEstrus, xToday *XToday) pas
 // getResult 根据b3数据计算结果
 func getResult(b3 *model.NeckRingEstrus, cft float32, cowEstrus *CowEstrus) pasturePb.CheckResult_Kind {
 	result := pasturePb.CheckResult_Pending
-
 	if b3.CheckResult == pasturePb.CheckResult_Correct {
 		result = pasturePb.CheckResult_Correct
 	}
@@ -408,6 +407,5 @@ func getResult(b3 *model.NeckRingEstrus, cft float32, cowEstrus *CowEstrus) past
 	if b3.CheckResult == pasturePb.CheckResult_Fail && b3.DayHigh > int32(cft)+cowEstrus.HadJust {
 		result = pasturePb.CheckResult_Fail
 	}
-
 	return result
 }

+ 4 - 0
module/crontab/other.go

@@ -108,6 +108,10 @@ func (e *Entry) NeckRingErrorEnumList(isAll string) []*pasturePb.ConfigOptionsLi
 		Value:    int32(pasturePb.NeckRingNumberError_Receiving_Less),
 		Label:    "接受率低",
 		Disabled: true,
+	}, &pasturePb.ConfigOptionsList{
+		Value:    int32(pasturePb.NeckRingNumberError_Low_Battery),
+		Label:    "低电量",
+		Disabled: true,
 	}, &pasturePb.ConfigOptionsList{
 		Value:    int32(pasturePb.NeckRingNumberError_Data_Latency),
 		Label:    "数据延迟",