|
@@ -129,7 +129,7 @@ func (e *Entry) CowEstrusWarning(pastureId int64, xToday *XToday) (err error) {
|
|
b48 = t3.Sub(t1).Hours()
|
|
b48 = t3.Sub(t1).Hours()
|
|
}
|
|
}
|
|
|
|
|
|
- if (int32(maxCft) > before3Data.DayHigh || b48 > 48) && int32(maxCft)+cowEstrus.HadJust > int32(xToday.ActiveLow) {
|
|
|
|
|
|
+ if (int32(maxCft) > before3Data.DayHigh || b48 > 48) && int32(maxCft)+cowEstrus.HadJust > xToday.ActiveLow {
|
|
level := calculateLevel(maxCft, cowEstrus, xToday)
|
|
level := calculateLevel(maxCft, cowEstrus, xToday)
|
|
cowInfo := e.FindCowInfoByNeckRingNumber(cowHabitList[0].NeckRingNumber)
|
|
cowInfo := e.FindCowInfoByNeckRingNumber(cowHabitList[0].NeckRingNumber)
|
|
isShow := pasturePb.IsShow_Ok
|
|
isShow := pasturePb.IsShow_Ok
|
|
@@ -138,11 +138,11 @@ func (e *Entry) CowEstrusWarning(pastureId int64, xToday *XToday) (err error) {
|
|
}
|
|
}
|
|
dayHigh := int32(maxCft) + cowEstrus.HadJust
|
|
dayHigh := int32(maxCft) + cowEstrus.HadJust
|
|
lastEstrusDate := cowEstrus.ActiveDate
|
|
lastEstrusDate := cowEstrus.ActiveDate
|
|
- result := getResult(before3Data, maxCft, cowEstrus)
|
|
|
|
|
|
+ checkResult := getResult(before3Data, maxCft, cowEstrus)
|
|
isPeak := pasturePb.IsShow_Ok
|
|
isPeak := pasturePb.IsShow_Ok
|
|
zaplog.Info("CowEstrusWarning",
|
|
zaplog.Info("CowEstrusWarning",
|
|
zap.Any("level", level),
|
|
zap.Any("level", level),
|
|
- zap.Any("result", result),
|
|
|
|
|
|
+ zap.Any("checkResult", checkResult),
|
|
zap.Any("isShow", isShow),
|
|
zap.Any("isShow", isShow),
|
|
zap.Any("isPeak", isPeak),
|
|
zap.Any("isPeak", isPeak),
|
|
zap.Any("lastEstrusDate", lastEstrusDate),
|
|
zap.Any("lastEstrusDate", lastEstrusDate),
|
|
@@ -155,7 +155,7 @@ func (e *Entry) CowEstrusWarning(pastureId int64, xToday *XToday) (err error) {
|
|
zap.Any("cowHabitList", cowHabitList),
|
|
zap.Any("cowHabitList", cowHabitList),
|
|
)
|
|
)
|
|
newEstrus := model.NewEventEstrus(
|
|
newEstrus := model.NewEventEstrus(
|
|
- pastureId, pasturePb.ExposeEstrusType_Neck_Ring, level, result, isShow,
|
|
|
|
|
|
+ pastureId, pasturePb.ExposeEstrusType_Neck_Ring, level, checkResult, isShow,
|
|
isPeak, lastEstrusDate, activeDate, dayHigh, maxHigh, cowInfo,
|
|
isPeak, lastEstrusDate, activeDate, dayHigh, maxHigh, cowInfo,
|
|
)
|
|
)
|
|
eventEstrusList = append(eventEstrusList, newEstrus)
|
|
eventEstrusList = append(eventEstrusList, newEstrus)
|