[update] Refactor CheckUpPage to separate regular medications and supplements in invoice generation. Update Medicine entity to include supplement flag and adjust database queries accordingly. Enhance error handling for medicine data validation.

This commit is contained in:
Lê Thành Đạt committed 2025-07-24 20:13:13 +07:00
1 parent c4fe96929e
commit 7acda1f4ab
3 files changed
+27 -16

No files matched your search

@@ -374,7 +374,7 @@ public class ServerHandler extends SimpleChannelInboundHandler<TextWebSocketFram
log.debug("Received GetMedInfoRequest");
try {
ResultSet rs = statement.executeQuery(
"select med_id, med_name, med_company, med_description, quantity, med_unit, med_selling_price, preference_note\n" +
"select med_id, med_name, med_company, med_description, quantity, med_unit, med_selling_price, preference_note, supplement\n" +
" from Medicine"
);
@@ -391,10 +391,11 @@ public class ServerHandler extends SimpleChannelInboundHandler<TextWebSocketFram
String medUnit = rs.getString("med_unit");
String medSellingPrice = rs.getString("med_selling_price");
String preferenceNote = rs.getString("preference_note");
String supplement = rs.getString("supplement");
String result = String.join("|",medId, medName, medCompany, medDescription, quantity, medUnit,
medSellingPrice, preferenceNote != null ? preferenceNote : "");
medSellingPrice, preferenceNote != null ? preferenceNote : "", supplement != null ? supplement : "0");
resultList.add(result);
}