Commit bbc2226a authored by didonet's avatar didonet

Added a new alert to show when students what sections with duplicated

codes.
parent 89cda4b2
......@@ -92,11 +92,19 @@ public class Configuration {
}
public static Object findActiveDuplicatedCodes(){
return entityManager().createNativeQuery("select c.code, e.name, count(*) from transcript a, " +
"section_pos b, course c, registration d, person e where a.transcript_section = b.id " +
"and b.course = c.id and a.student = d.id and d.student = e.id and " +
"d.reg_status='Ativa' group by c.code, e.name having count(*) > 1 order by 2,1",
SectionPos.class).getResultList();
return entityManager().createNativeQuery("select " +
"a1.*, c1.code, e1.name " +
"from " +
"transcript a1, section_pos b1, course c1, registration d1, person e1 " +
"where " +
"a1.transcript_section = b1.id and b1.course = c1.id and a1.student = d1.id and d1.student = e1.id " +
"and d1.reg_status='Ativa' and " +
"exists ( select e.name, c.code from transcript a, section_pos b, course c, registration d, person e " +
"where a.transcript_section = b.id and b.course = c.id and a.student = d.id and d.student = " +
"e.id and d.reg_status='Ativa' group by c.code, e.name having count(*) > 1 and" +
" c1.code=c.code and e1.name = e.name) " +
"order by e1.name, c1.code ",
Transcript.class).getResultList();
}
......
......@@ -39,7 +39,7 @@ public class ConfigurationController {
model.addAttribute("registeredWithDefense", Configuration.findRegisteredStudentsWithDefense());
model.addAttribute("endGrant", Configuration.findNearEndGrants());
model.addAttribute("gradeEmpty", Configuration.findLastPeriodBlankConcepts());
// model.addAttribute("duplicatedCodes", Configuration.findActiveDuplicatedCodes());
model.addAttribute("duplicateCodes", Configuration.findActiveDuplicatedCodes());
model.addAttribute("travelrequisition", Configuration.findAllOpenTravelRequisitions());
return "configurations/alert";
}
......
......@@ -147,5 +147,22 @@
</table:table>
</page:list>
<br/><br/>
<b>Código de disciplina duplicado</b>
<page:list id="pl_br_ufpr_c3sl_sapos_models_people_Professor" items="${duplicateCodes}" emptyLabels="true" z="XkBEOi8+LWqvFKK06b3mq90KI1U=">
<table:table data="${duplicateCodes}" id="l_br_ufpr_c3sl_sapos_models_scholar_Transcript" path="/transcripts" create="false" z="57/qLH4Y2mwQJG9RQk+tGXo2kpw=">
<table:column id="c_br_ufpr_c3sl_sapos_models_scholar_Transcript_student" navigation="true" property="student.student.name" z="user-managed"/>
<table:column id="c_br_ufpr_c3sl_sapos_models_scholar_Registration_regKind" navigation="true" property="student.regKind" z="user-managed"/>
<table:column id="c_br_ufpr_c3sl_sapos_models_scholar_Course_code" navigation="true" property="transcriptSection.course.code" z="9ecOZUPR3CIVL2XOtG9aRmLJzn4="/>
<table:column id="c_br_ufpr_c3sl_sapos_models_scholar_SectionPos_professor" navigation="true" property="transcriptSection.professor.name" z="user-managed"/>
<table:column id="c_br_ufpr_c3sl_sapos_models_scholar_SectionPos_sectionYear" navigation="true" property="transcriptSection.sectionYear" z="user-managed"/>
<table:column id="c_br_ufpr_c3sl_sapos_models_scholar_SectionPos_period" navigation="true" property="transcriptSection.period" z="user-managed"/>
<table:column id="c_br_ufpr_c3sl_sapos_models_scholar_Transcript_transcriptSection" navigation="true" property="transcriptSection.course.name" z="user-managed"/>
<table:column id="c_br_ufpr_c3sl_sapos_models_scholar_Transcript_situation" property="situation" z="iq+rXnC/oF96+jdqVt0v2XQMzZw=" nullvalue="Nulo"/>
</table:table>
</page:list>
</div>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment