-
Notifications
You must be signed in to change notification settings - Fork 1
Thematic content fixes for whatsapp and conatct us details updated #138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -33,8 +33,8 @@ public Map<String,KilkariThematicContent> getKilkariThematicContentReportData(In | |
| Restrictions.eq("locationId",locationId.longValue()), | ||
| Restrictions.eq("locationType",locationType), | ||
| Restrictions.eq("periodType",periodType), | ||
| Restrictions.eq("date", date) | ||
| // Restrictions.eq("messageWeekNumber", week_id) | ||
| Restrictions.eq("date", date), | ||
| Restrictions.ne("messageWeekNumber", "opt") | ||
| )); | ||
|
Comment on lines
+36
to
38
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix Criteria construction; add null-safety for messageWeekNumber. Good call excluding "opt". However, Restrictions.and only accepts two Criterion; passing 5 will not compile and/or won’t work as intended. Also consider excluding null messageWeekNumber values explicitly. Apply this diff to build the predicates correctly and add isNotNull: - criteria.add(Restrictions.and(
- Restrictions.eq("locationId",locationId.longValue()),
- Restrictions.eq("locationType",locationType),
- Restrictions.eq("periodType",periodType),
- Restrictions.eq("date", date),
- Restrictions.ne("messageWeekNumber", "opt")
- ));
+ criteria.add(Restrictions.eq("locationId", locationId.longValue()));
+ criteria.add(Restrictions.eq("locationType", locationType));
+ criteria.add(Restrictions.eq("periodType", periodType));
+ criteria.add(Restrictions.eq("date", date));
+ criteria.add(Restrictions.isNotNull("messageWeekNumber"));
+ criteria.add(Restrictions.ne("messageWeekNumber", "opt"));Also applies to: 32-38 |
||
|
|
||
| List<KilkariThematicContent> result = (List<KilkariThematicContent>)criteria.list(); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Close streams and avoid crashing class initialization on missing images.
documentsinstead of re-calling retrieveDocuments().Apply this diff:
static { try { - certificateSign1Image = ImageIO.read(Files.newInputStream(Paths.get(retrieveDocuments() + "Certificate/certificate_sign1.png"))); - certificateSign2Image = ImageIO.read(Files.newInputStream(Paths.get(retrieveDocuments() + "Certificate/certificate_sign2.png"))); - certificateSign3Image = ImageIO.read(Files.newInputStream(Paths.get(retrieveDocuments() + "Certificate/certificate_sign3.png"))); - } catch (IOException e) { - throw new RuntimeException("Failed to preload signature images", e); - } + certificateSign1Image = ImageIO.read(new File(documents + "Certificate/certificate_sign1.png")); + certificateSign2Image = ImageIO.read(new File(documents + "Certificate/certificate_sign2.png")); + certificateSign3Image = ImageIO.read(new File(documents + "Certificate/certificate_sign3.png")); + } catch (IOException e) { + LOGGER.warn("Failed to preload signature images; will fall back to on-demand loading.", e); + certificateSign1Image = null; + certificateSign2Image = null; + certificateSign3Image = null; + } }Optionally add a tiny helper and fallback usage (outside this hunk) to on-demand load if cached is null:
And replace uses with requireSignImage(certificateSign1Image, "Certificate/certificate_sign1.png") etc.
🤖 Prompt for AI Agents