|
@@ -59,19 +59,23 @@ func Calculate(varietyId int, sysUserId int, sysUserName string) (err error) {
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
- var startDate, endDate time.Time
|
|
+ var startDate time.Time
|
|
|
|
|
|
maintenanceDataMap := make(map[time.Time][]float64)
|
|
maintenanceDataMap := make(map[time.Time][]float64)
|
|
|
|
|
|
for _, plantInfo := range plantList {
|
|
for _, plantInfo := range plantList {
|
|
|
|
+
|
|
|
|
+ if plantInfo.MaintenanceDate.IsZero() || plantInfo.ResumptionDate.IsZero() {
|
|
|
|
+ continue
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if plantInfo.AverageDailyCapacityReduction == 0 {
|
|
|
|
+ continue
|
|
|
|
+ }
|
|
|
|
|
|
if startDate.IsZero() || plantInfo.MaintenanceDate.Before(startDate) {
|
|
if startDate.IsZero() || plantInfo.MaintenanceDate.Before(startDate) {
|
|
startDate = plantInfo.MaintenanceDate
|
|
startDate = plantInfo.MaintenanceDate
|
|
}
|
|
}
|
|
-
|
|
|
|
- if endDate.IsZero() || plantInfo.ResumptionDate.After(endDate) {
|
|
|
|
- endDate = plantInfo.ResumptionDate
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
|
|
resumptionDate := plantInfo.ResumptionDate
|
|
resumptionDate := plantInfo.ResumptionDate
|