本文整理汇总了Python中DoctorSpring.models.Diagnose.getDiagnoseByDiagnoseSeriesNo方法的典型用法代码示例。如果您正苦于以下问题:Python Diagnose.getDiagnoseByDiagnoseSeriesNo方法的具体用法?Python Diagnose.getDiagnoseByDiagnoseSeriesNo怎么用?Python Diagnose.getDiagnoseByDiagnoseSeriesNo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DoctorSpring.models.Diagnose
的用法示例。
在下文中一共展示了Diagnose.getDiagnoseByDiagnoseSeriesNo方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: AlipayCallbackUrl
# 需要导入模块: from DoctorSpring.models import Diagnose [as 别名]
# 或者: from DoctorSpring.models.Diagnose import getDiagnoseByDiagnoseSeriesNo [as 别名]
def AlipayCallbackUrl():
userId='9'
if session.has_key('userId'):
userId=session['userId']
if userId is None:
redirect(LOGIN_URL)
params=AlipayCallBackInfo(request.args)
payRecord=AlipayChargeRecord(params.diagnoseSeriesNumber,params.buyer_email,params.buyer_id,params.is_success,params.notify_time,
params.notify_type,params.total_fee,params.trade_no,params.trade_status,params.out_trade_no)
AlipayChargeRecord.save(payRecord)
if params.is_success=='T' and params.trade_status=='TRADE_SUCCESS':
diagnose=Diagnose.getDiagnoseByDiagnoseSeriesNo(params.diagnoseSeriesNumber)
if diagnose:
diagnoseId=diagnose.id
alipayLog=AlipayLog(userId,diagnoseId,constant.AlipayLogAction.PayFilished)
AlipayLog.save(alipayLog)
diagnose.status=constant.DiagnoseStatus.NeedTriage
Diagnose.save(diagnose)
result=rs.ResultStatus(rs.SUCCESS.status,'支付成功')
return json.dumps(result.__dict__,ensure_ascii=False)
else:
# alipayLog=AlipayLog(userId,params.diagnoseSeriesNumber,constant.AlipayLogAction.PayFilished)
# AlipayLog.save(alipayLog)
LOG.error("支付成功,但系统诊断已经取消(诊断序列号:%s)",params.diagnoseSeriesNumber)
result=rs.ResultStatus(rs.SUCCESS.status,'支付成功,但系统诊断已经取消')
return json.dumps(result.__dict__,ensure_ascii=False)
# alipayLog=AlipayLog(userId,params.diagnoseSeriesNumber,constant.AlipayLogAction.PayFailure)
# AlipayLog.save(alipayLog)
LOG.error("支付失败(诊断序列号:%s)",params.diagnoseSeriesNumber)
result=rs.ResultStatus(rs.FAILURE.status,'支付失败')
return json.dumps(result.__dict__,ensure_ascii=False)
示例2: AlipayCallbackUrl
# 需要导入模块: from DoctorSpring.models import Diagnose [as 别名]
# 或者: from DoctorSpring.models.Diagnose import getDiagnoseByDiagnoseSeriesNo [as 别名]
def AlipayCallbackUrl():
params=AlipayCallBackInfo(request.args)
if params.diagnoseSeriesNumber is None:
LOG.error("支付回调出错,无法拿到diagnoseSeriesNumber")
return redirect(ERROR_URL)
if (not params.trade_no) or (not params.out_trade_no) or (not params.trade_status):
LOG.error("支付回调出错,tradeNo")
return redirect(ERROR_URL)
diagnose=Diagnose.getDiagnoseByDiagnoseSeriesNo(params.diagnoseSeriesNumber)
if diagnose is None or (not hasattr(diagnose,"patient")) or diagnose.patient.userID is None:
LOG.error("支付回调出错,无法拿到诊断[diagnoseSeriesNumber%s]"%params.diagnoseSeriesNumber)
#跳过验证,以后再测试,必须传入notify_id
# verfyParams={}
# verfyParams['out_trade_no']=params.out_trade_no
# verfyParams['trade_status']='TRADE_SUCCESS'
# verfyParams['trade_no']=params.trade_no
# verfyParams['sign']= params.sign
# veryResult=alipay.notify_verify(request.args)
# if not veryResult:
# LOG.error("支付交易出错,无法拿到诊断[diagnoseSeriesNumber%s]"%params.diagnoseSeriesNumber)
userId= diagnose.patient.userID
payRecord=AlipayChargeRecord(params.diagnoseSeriesNumber,params.buyer_email,params.buyer_id,params.is_success,params.notify_time,
params.notify_type,params.total_fee,params.trade_no,params.trade_status,params.out_trade_no)
AlipayChargeRecord.save(payRecord)
if params.is_success=='T' and params.trade_status=='TRADE_SUCCESS':
diagnose=Diagnose.getDiagnoseByDiagnoseSeriesNo(params.diagnoseSeriesNumber)
if diagnose:
diagnoseId=diagnose.id
alipayLog=AlipayLog(userId,diagnoseId,constant.AlipayLogAction.PayFilished)
AlipayLog.save(alipayLog)
diagnose.status=constant.DiagnoseStatus.NeedTriage
Diagnose.save(diagnose)
result=rs.ResultStatus(rs.SUCCESS.status,'支付成功')
return json.dumps(result.__dict__,ensure_ascii=False)
else:
# alipayLog=AlipayLog(userId,params.diagnoseSeriesNumber,constant.AlipayLogAction.PayFilished)
# AlipayLog.save(alipayLog)
LOG.error("支付成功,但系统诊断已经取消(诊断序列号:%s)",params.diagnoseSeriesNumber)
result=rs.ResultStatus(rs.SUCCESS.status,'支付成功,但系统诊断已经取消')
return json.dumps(result.__dict__,ensure_ascii=False)
# alipayLog=AlipayLog(userId,params.diagnoseSeriesNumber,constant.AlipayLogAction.PayFailure)
# AlipayLog.save(alipayLog)
LOG.error("支付失败(诊断序列号:%s)",params.diagnoseSeriesNumber)
result=rs.ResultStatus(rs.FAILURE.status,'支付失败')
return json.dumps(result.__dict__,ensure_ascii=False)
示例3: copyObjects
# 需要导入模块: from DoctorSpring.models import Diagnose [as 别名]
# 或者: from DoctorSpring.models.Diagnose import getDiagnoseByDiagnoseSeriesNo [as 别名]
def copyObjects():
oss = OssAPI(HOST, ACCESS_ID, SECRET_ACCESS_KEY)
bucket="solidmedicaltest"
prefix = "1_c4ca4238a0b923820dcc509a6f75849b/"
marker = ""
delimiter = "/"
maxkeys = "100"
headers = {}
res = oss.get_bucket(bucket, prefix, marker, delimiter, maxkeys, headers)
if (res.status / 100) == 2:
body = res.read()
#print body
h = GetBucketXml(body)
(file_list, common_list) = h.list()
print "object list is:"
for i in file_list:
fileName= i[0]
diagnoseId=getDiagnoseIdFromFileName(fileName)
diagnose=Diagnose.getDiagnoseByDiagnoseSeriesNo(diagnoseId)
if diagnose:
res=oss.copy_object(bucket,fileName,bucket,diagnoseId)
if (res.status / 100) == 2:
fileUrl='http://%s.%s/%s'%(bucket,WEB_HOST,diagnoseId)
Diagnose.setDiagnoseUploaded(diagnoseId)