|
@@ -38,7 +38,7 @@ class UomConversionController( |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@RequestMapping(value = ["/testRoughSchedule"], method = [RequestMethod.GET]) |
|
|
@RequestMapping(value = ["/testRoughSchedule"], method = [RequestMethod.GET]) |
|
|
fun generateRoughSchedule(request: HttpServletRequest?): HashMap<RoughScheduleObj, Double> { |
|
|
|
|
|
|
|
|
fun generateRoughSchedule(request: HttpServletRequest?): List<HashMap<RoughScheduleObj, Double>> { |
|
|
try { |
|
|
try { |
|
|
val demoFGList = arrayListOf<FinishedGood>( |
|
|
val demoFGList = arrayListOf<FinishedGood>( |
|
|
FinishedGood( |
|
|
FinishedGood( |
|
@@ -67,15 +67,19 @@ class UomConversionController( |
|
|
), |
|
|
), |
|
|
); |
|
|
); |
|
|
|
|
|
|
|
|
val result: HashMap<RoughScheduleObj, Double> = schedulingService.generateRoughScheduleByWeek(demoFGList); |
|
|
|
|
|
|
|
|
val result: HashMap<RoughScheduleObj, Double> = schedulingService.generateRoughScheduleByWeek(demoFGList) |
|
|
val sortedEntries = result.entries.sortedBy { it.value } |
|
|
val sortedEntries = result.entries.sortedBy { it.value } |
|
|
|
|
|
|
|
|
for ((roughScheduleRecord, totalDifference) in result) { |
|
|
|
|
|
println("[totalDifference:" + sortedEntries + "] - " + sortedEntries.toString()) |
|
|
|
|
|
|
|
|
for ((roughScheduleRecord, totalDifference) in sortedEntries) { |
|
|
|
|
|
println("[totalDifference:" + totalDifference + "] - " + roughScheduleRecord.toString()) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Convert to List<HashMap<RoughScheduleObj, Double>> |
|
|
|
|
|
return sortedEntries.map { entry -> |
|
|
|
|
|
hashMapOf(entry.key to entry.value) |
|
|
} |
|
|
} |
|
|
return result; |
|
|
|
|
|
} catch (e: Exception) { |
|
|
} catch (e: Exception) { |
|
|
throw RuntimeException("Error genereate schedule: ${e.message}", e) |
|
|
|
|
|
|
|
|
throw RuntimeException("Error generate schedule: ${e.message}", e) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |