Commit b2da3882 authored by Kostas G's avatar Kostas G

sde in second period

parent b1d94bed
...@@ -134,6 +134,8 @@ class WSConsumer extends ControllerBase ...@@ -134,6 +134,8 @@ class WSConsumer extends ControllerBase
$sCon->condition('gel_app.lastschool_schoolyear','2017-2018', '<'); $sCon->condition('gel_app.lastschool_schoolyear','2017-2018', '<');
$sCon->condition('gel_app.myschool_id',NULL, 'IS NOT'); $sCon->condition('gel_app.myschool_id',NULL, 'IS NOT');
$sCon->condition('gel_app.delapp',0, '='); $sCon->condition('gel_app.delapp',0, '=');
$sCon->condition('gel_app.second_period',1, '=');
$students_promotions = $sCon->execute()->fetchAll(\PDO::FETCH_OBJ); $students_promotions = $sCon->execute()->fetchAll(\PDO::FETCH_OBJ);
foreach ($students_promotions as $student) { foreach ($students_promotions as $student) {
...@@ -151,14 +153,16 @@ class WSConsumer extends ControllerBase ...@@ -151,14 +153,16 @@ class WSConsumer extends ControllerBase
} }
if ($result==NULL){ if ($result==NULL){
$this->logger->warning($count.",".$student->myschool_id.", null response"); $this->logger->warning($count.",".$student->myschool_id.", null result");
} }
else{ else{
$promotion=json_decode($result); $promotion=json_decode($result);
if ($promotion==NULL){ if ($promotion==NULL){
$this->logger->warning($count.",".$student->myschool_id.", null response"); $this->logger->warning($count.",".$student->myschool_id.", null promotion");
$promotion=0;
} }
$transaction = $this->connection->startTransaction(); $transaction = $this->connection->startTransaction();
...@@ -194,6 +198,8 @@ class WSConsumer extends ControllerBase ...@@ -194,6 +198,8 @@ class WSConsumer extends ControllerBase
$sCon->condition('epal_app.lastschool_schoolyear','2017-2018', '<'); $sCon->condition('epal_app.lastschool_schoolyear','2017-2018', '<');
$sCon->condition('epal_app.myschool_id',NULL, 'IS NOT'); $sCon->condition('epal_app.myschool_id',NULL, 'IS NOT');
$sCon->condition('epal_app.delapp',0, '='); $sCon->condition('epal_app.delapp',0, '=');
$sCon->condition('gel_app.second_period',1, '=');
$students_promotions = $sCon->execute()->fetchAll(\PDO::FETCH_OBJ); $students_promotions = $sCon->execute()->fetchAll(\PDO::FETCH_OBJ);
foreach ($students_promotions as $student) { foreach ($students_promotions as $student) {
...@@ -211,14 +217,15 @@ class WSConsumer extends ControllerBase ...@@ -211,14 +217,15 @@ class WSConsumer extends ControllerBase
} }
if ($result==NULL){ if ($result==NULL){
$this->logger->warning($count.",".$student->myschool_id.", null response"); $this->logger->warning($count.",".$student->myschool_id.", null result");
} }
else{ else{
$promotion=json_decode($result); $promotion=json_decode($result);
if ($promotion==NULL){ if ($promotion==NULL){
$this->logger->warning($count.",".$student->myschool_id.", null response"); $this->logger->warning($count.",".$student->myschool_id.", null promotion");
$promotion=0;
} }
$transaction = $this->connection->startTransaction(); $transaction = $this->connection->startTransaction();
......
...@@ -3970,7 +3970,35 @@ public function Initializationbperiod(Request $request) ...@@ -3970,7 +3970,35 @@ public function Initializationbperiod(Request $request)
$entity_storage_student->save($entity_object); $entity_storage_student->save($entity_object);
} }
$this->logger->warning("sde prin");
$student = array();
//initialazation for sde
$sCon = $this->connection->select('gel_student', 'gStudent');
$sCon->fields('gStudent', array('id', 'lastschool_registrynumber','lastschool_unittypeid','lastschool_class','nextclass','second_period'))
->condition('gStudent.lastschool_unittypeid', 40 , '=')
->condition('gStudent.delapp', 0, '=');
$schools = $sCon->execute()->fetchAll(\PDO::FETCH_OBJ);
//$this->logger->warning("9");
foreach ($schools as $school) {
$student = array(
'langcode' => 'el',
'id' => $school ->id,
'student_id' => $school ->id,
'taxi' => $school-> nextclass,
'dide' => 0,//$school ->edu_admin_id,
'second_period' => 1,
);
$entity_storage_student = $this->entityTypeManager->getStorage('gelstudenthighschool');
$entity_object = $entity_storage_student->create($student);
$entity_storage_student->save($entity_object);
}
} }
......
...@@ -1229,11 +1229,11 @@ deletefilters(secsel,classid) ...@@ -1229,11 +1229,11 @@ deletefilters(secsel,classid)
initialized() initialized()
{ {
this.hasdone = true; //this.hasdone = true;
this.showLoader.next(false); //this.showLoader.next(false);
/* this.InitializedSub = this._hds.findIfInitialized() this.InitializedSub = this._hds.findIfInitialized()
.subscribe(data => { .subscribe(data => {
this.Initialized$.next(data); this.Initialized$.next(data);
...@@ -1254,7 +1254,7 @@ initialized() ...@@ -1254,7 +1254,7 @@ initialized()
error => { error => {
this.Initialized$.next([{}]); this.Initialized$.next([{}]);
}); */ });
} }
...@@ -1285,7 +1285,7 @@ getSDEStudents() { ...@@ -1285,7 +1285,7 @@ getSDEStudents() {
this.showLoader.next(false); this.showLoader.next(false);
}); });
this.showLoader.next(false); //this.showLoader.next(false);
} }
......
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