@@ -233,10 +233,27 @@ open class ProductionScheduleService( | |||||
this.isDark = row["isDark"].toString().toInt() | this.isDark = row["isDark"].toString().toInt() | ||||
this.isDense = row["isDense"].toString().toInt() | this.isDense = row["isDense"].toString().toInt() | ||||
this.isFloat = row["isFloat"].toString().toInt() | this.isFloat = row["isFloat"].toString().toInt() | ||||
val isDarkValue = row["isDark"].toString().toInt() | |||||
val isDenseValue = row["isDense"].toString().toInt() | |||||
val isFloatValue = row["isFloat"].toString().toInt() | |||||
this.weightingRef = | this.weightingRef = | ||||
(DARK_MAX_VALUE - row["isDark"].toString().toInt() ) / DARK_MAX_VALUE.toDouble() * DARK_WEIGHTING + | |||||
(DENSE_MAX_VALUE - row["isDense"].toString().toInt()) / DENSE_MAX_VALUE.toDouble() * DENSE_WEIGHTING + | |||||
(FLOAT_MAX_VALUE - row["isFloat"].toString().toInt()) / FLOAT_MAX_VALUE.toDouble() * FLOAT_WEIGHTING | |||||
if (isDarkValue > 0) { | |||||
(DARK_MAX_VALUE+1 - isDarkValue) / DARK_MAX_VALUE.toDouble() * DARK_WEIGHTING | |||||
} else { | |||||
0.0 | |||||
} + | |||||
if (isDenseValue > 0) { | |||||
(DENSE_MAX_VALUE+1 - isDenseValue) / DENSE_MAX_VALUE.toDouble() * DENSE_WEIGHTING | |||||
} else { | |||||
0.0 | |||||
} + | |||||
if (isFloatValue > 0) { | |||||
(FLOAT_MAX_VALUE+1 - isFloatValue) / FLOAT_MAX_VALUE.toDouble() * FLOAT_WEIGHTING | |||||
} else { | |||||
0.0 | |||||
} | |||||
} | } | ||||
} | } | ||||
} | } | ||||
@@ -27,7 +27,8 @@ class ProductionScheduleController( | |||||
@RequestMapping(value = ["/testDetailSchedule"], method = [RequestMethod.GET]) | @RequestMapping(value = ["/testDetailSchedule"], method = [RequestMethod.GET]) | ||||
fun generateDetailSchedule(request: HttpServletRequest?): Int { | fun generateDetailSchedule(request: HttpServletRequest?): Int { | ||||
try { | try { | ||||
productionScheduleService.generateDetailedScheduleByDay(1, LocalDateTime.of(2025,6,18,0,0,0)) | |||||
//TODO: update this to receive selectedDate and assignDate from api | |||||
productionScheduleService.generateDetailedScheduleByDay(1, LocalDateTime.of(2025,6,19,0,0,0)) | |||||
return 200 | return 200 | ||||
} catch (e: Exception) { | } catch (e: Exception) { | ||||
throw RuntimeException("Error generate schedule: ${e.message}", e) | throw RuntimeException("Error generate schedule: ${e.message}", e) | ||||