def mernis_kimlik_bilgileri_getir(self): tckn = self.current.input['form']['tckn'] # Personelin daha önce bulunup bulunmadığını kontrol et try: Personel.objects.get(tckn=tckn) self.current.task_data['mernis_tamam'] = False self.current.task_data['hata_msg'] = _( u"Personel Daha Önce Kaydedilmiş") except ObjectDoesNotExist: from ulakbus.services.zato_wrapper import MernisKimlikBilgileriGetir, \ MernisCuzdanBilgileriGetir # Kimlik bilgileri mernis servisi üzerinden çekilecek mernis_bilgileri = MernisKimlikBilgileriGetir(tckn=str(tckn)) response = mernis_bilgileri.zato_request() self.current.task_data['mernis_tamam'] = True self.current.task_data['kimlik_bilgileri'] = response # Cüzdan bilgileri mernis servisi üzerinden çekilecek mernis_bilgileri = MernisCuzdanBilgileriGetir(tckn=str(tckn)) response = mernis_bilgileri.zato_request() self.current.task_data['cuzdan_tamam'] = True self.current.task_data['cuzdan_bilgileri'] = response self.current.task_data['tckn'] = tckn self.current.set_message( title=_(u'%s TC no için Mernis servisi başlatıldı') % tckn, msg='', typ=1, url="/wftoken/%s" % self.current.token)
def mernis_kimlik_sorgula(self): """Mernis Sorgulama Zato wrapper metodlarıyla Mernis servisine bağlanır, servisten dönen değerlerle nesneyi doldurup kaydeder. """ zs = MernisKimlikBilgileriGetir(tckn=self.object.tckn) response = zs.zato_request() self.object(**response) self.object.save()