|
|
@ -250,7 +250,11 @@ public class ShelterResucueService { |
|
|
public List<Map<String, Object>> getQuestionsCategory() { |
|
|
public List<Map<String, Object>> getQuestionsCategory() { |
|
|
String sql = "SELECT * FROM question_category_resuce_master where isactive=1 and isdelete=0 order by orderby"; |
|
|
String sql = "SELECT * FROM question_category_resuce_master where isactive=1 and isdelete=0 order by orderby"; |
|
|
return jdbcShelterRescueTemplate.queryForList(sql); |
|
|
return jdbcShelterRescueTemplate.queryForList(sql); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public List<Map<String, Object>> getResuceDesignationCategory() { |
|
|
|
|
|
String sql = "SELECT id, english_name FROM resuce_designation_master where isactive=1 and isdelete=0 order by orderby"; |
|
|
|
|
|
return jdbcShelterRescueTemplate.queryForList(sql); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public List<Map<String, Object>> getDistricts(String sid) { |
|
|
public List<Map<String, Object>> getDistricts(String sid) { |
|
|
@ -351,6 +355,13 @@ public class ShelterResucueService { |
|
|
String latitude = params.get("latitude"); |
|
|
String latitude = params.get("latitude"); |
|
|
String longitude = params.get("longitude"); |
|
|
String longitude = params.get("longitude"); |
|
|
String shelterId = params.get("shelter_id"); |
|
|
String shelterId = params.get("shelter_id"); |
|
|
|
|
|
|
|
|
|
|
|
String resuceDesignation = params.get("resuce_designation"); |
|
|
|
|
|
String hospitalName = params.get("hospital_name"); |
|
|
|
|
|
|
|
|
|
|
|
System.out.println(" resuceDesignation: " + resuceDesignation); |
|
|
|
|
|
System.out.println(" hospitalName: " + hospitalName); |
|
|
|
|
|
|
|
|
//String address = params.get("address"); ) |
|
|
//String address = params.get("address"); ) |
|
|
// System.out.println(" surveyId: " + surveyId); |
|
|
// System.out.println(" surveyId: " + surveyId); |
|
|
// System.out.println(" cid: " + cid); |
|
|
// System.out.println(" cid: " + cid); |
|
|
@ -417,9 +428,14 @@ public class ShelterResucueService { |
|
|
// first (like in child_survey) |
|
|
// first (like in child_survey) |
|
|
if (cid != null && cid.equals("1") && (zone != null || resolvedLat != null || resolvedLng != null)) { |
|
|
if (cid != null && cid.equals("1") && (zone != null || resolvedLat != null || resolvedLng != null)) { |
|
|
try { |
|
|
try { |
|
|
|
|
|
// String logindetailsSql = "INSERT INTO surveyor_location_resuce_details " + |
|
|
|
|
|
// "(loginId, zone, ward, latitude, longitude, shelter_id, is_active, is_delete, cdate) " + |
|
|
|
|
|
// "VALUES (?, ?, ?, ?, ?, ?, 1, 0, NOW())"; |
|
|
|
|
|
|
|
|
String logindetailsSql = "INSERT INTO surveyor_location_resuce_details " + |
|
|
String logindetailsSql = "INSERT INTO surveyor_location_resuce_details " + |
|
|
"(loginId, zone, ward, latitude, longitude, shelter_id, is_active, is_delete, cdate) " + |
|
|
|
|
|
"VALUES (?, ?, ?, ?, ?, ?, 1, 0, NOW())"; |
|
|
|
|
|
|
|
|
"(loginId, zone, ward, latitude, longitude, shelter_id, " + |
|
|
|
|
|
"resuce_designation, hospital_name, is_active, is_delete, cdate) " + |
|
|
|
|
|
"VALUES (?, ?, ?, ?, ?, ?, ?, ?, 1, 0, NOW())"; |
|
|
|
|
|
|
|
|
org.springframework.jdbc.support.KeyHolder keyHolder = new org.springframework.jdbc.support.GeneratedKeyHolder(); |
|
|
org.springframework.jdbc.support.KeyHolder keyHolder = new org.springframework.jdbc.support.GeneratedKeyHolder(); |
|
|
|
|
|
|
|
|
@ -440,6 +456,9 @@ public class ShelterResucueService { |
|
|
ps.setString(4, finalLat); |
|
|
ps.setString(4, finalLat); |
|
|
ps.setString(5, finalLng); |
|
|
ps.setString(5, finalLng); |
|
|
ps.setString(6, shelterId); |
|
|
ps.setString(6, shelterId); |
|
|
|
|
|
|
|
|
|
|
|
ps.setString(7, resuceDesignation); |
|
|
|
|
|
ps.setString(8, hospitalName); |
|
|
return ps; |
|
|
return ps; |
|
|
}, |
|
|
}, |
|
|
keyHolder); |
|
|
keyHolder); |
|
|
@ -553,10 +572,14 @@ public class ShelterResucueService { |
|
|
+ |
|
|
+ |
|
|
"VALUES (?, ?, ?, ?, ?, ?, ?, NOW(), 1, 0)"; |
|
|
"VALUES (?, ?, ?, ?, ?, ?, ?, NOW(), 1, 0)"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String insertSql = "INSERT INTO shelter_resuce_response (qid, answer, others_answer, survey_id, cid, cby, parent_answer_id, cdate, isactive, isdelete) " |
|
|
String insertSql = "INSERT INTO shelter_resuce_response (qid, answer, others_answer, survey_id, cid, cby, parent_answer_id, cdate, isactive, isdelete) " |
|
|
+ |
|
|
+ |
|
|
"VALUES (?, ?, ?, ?, ?, ?, ?, NOW(), 1, 0)"; |
|
|
"VALUES (?, ?, ?, ?, ?, ?, ?, NOW(), 1, 0)"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String qSql = "SELECT qid, question_type, field_name, q_english FROM shelter_resuce_questions_master " |
|
|
String qSql = "SELECT qid, question_type, field_name, q_english FROM shelter_resuce_questions_master " |
|
|
+ "WHERE cid = ? AND (isactive = 1 AND isdelete = 0 OR (cid = '1' AND field_name IN ('q2', 'q78', 'q11', 'q8', 'q9', 'q10', 'q77')))"; |
|
|
+ "WHERE cid = ? AND (isactive = 1 AND isdelete = 0 OR (cid = '1' AND field_name IN ('q2', 'q78', 'q11', 'q8', 'q9', 'q10', 'q77')))"; |
|
|
List<Map<String, Object>> questions = jdbcShelterRescueTemplate.queryForList(qSql, cid); |
|
|
List<Map<String, Object>> questions = jdbcShelterRescueTemplate.queryForList(qSql, cid); |
|
|
@ -749,8 +772,8 @@ public class ShelterResucueService { |
|
|
|
|
|
|
|
|
if (isNotWilling) { |
|
|
if (isNotWilling) { |
|
|
jdbcShelterRescueTemplate.update(insertparticipateSql, qid, answer, othersAnswer, surveyId, |
|
|
jdbcShelterRescueTemplate.update(insertparticipateSql, qid, answer, othersAnswer, surveyId, |
|
|
cid, cby, |
|
|
|
|
|
parentAnswerId); |
|
|
|
|
|
|
|
|
cid, cby,parentAnswerId); |
|
|
|
|
|
|
|
|
// System.out.println("--- DB SAVE (Participate) --- QID: " + qid + " | |
|
|
// System.out.println("--- DB SAVE (Participate) --- QID: " + qid + " | |
|
|
// FieldName: " + fieldName + " | Answer: " + answer + " | OthersAnswer: " + |
|
|
// FieldName: " + fieldName + " | Answer: " + answer + " | OthersAnswer: " + |
|
|
// othersAnswer); |
|
|
// othersAnswer); |
|
|
@ -758,6 +781,7 @@ public class ShelterResucueService { |
|
|
if (!hasNotWillingResponse) { |
|
|
if (!hasNotWillingResponse) { |
|
|
jdbcShelterRescueTemplate.update(insertSql, qid, answer, othersAnswer, surveyId, cid, cby, |
|
|
jdbcShelterRescueTemplate.update(insertSql, qid, answer, othersAnswer, surveyId, cid, cby, |
|
|
parentAnswerId); |
|
|
parentAnswerId); |
|
|
|
|
|
|
|
|
// System.out.println("--- DB SAVE (Response) --- QID: " + qid + " | FieldName: |
|
|
// System.out.println("--- DB SAVE (Response) --- QID: " + qid + " | FieldName: |
|
|
// " + fieldName + " | Answer: " + answer + " | OthersAnswer: " + othersAnswer); |
|
|
// " + fieldName + " | Answer: " + answer + " | OthersAnswer: " + othersAnswer); |
|
|
} |
|
|
} |
|
|
@ -1179,7 +1203,7 @@ public class ShelterResucueService { |
|
|
} else if ("gender".equals(cleanKey)) { |
|
|
} else if ("gender".equals(cleanKey)) { |
|
|
qid = 9; |
|
|
qid = 9; |
|
|
} |
|
|
} |
|
|
else if ("shelter_assigned".equals(cleanKey)) { |
|
|
|
|
|
|
|
|
else if ("remark".equals(cleanKey)) { |
|
|
qid = 10; |
|
|
qid = 10; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|