python 脚本
mag3.py
1,import
import sys
from org.eclipse.jface.dialogs import MessageDialog
from org.eclipse.core.databinding.validation import ValidationStatus
from com.ifs.btt.cbs.dm import DomainManager
from com.ifs.btt.transport.factory import TransportFactory
from com.ifs.btt.context.global import GlobalContext
from javax.persistence import NoResultException
from java.math import BigDecimal
from java.math import BigInteger
from org.eclipse.swt.layout import GridData
from com.ifs.btt.context.model import AuthItem
from com.ifs.btt.event.manager import EventManager
from com.ifs.btt.event.tran import TranEvent
from java.lang import Math
from java.lang import Long
from com.ifs.btt.message.internal import MessageDataAccessor
from com.ifs.btt.message.xml.convertor import XMLMessageConvertor
from com.ifs.btt.message.xml.impl import XMLMessage
from com.ifs.btt.ui.xwt.scripts import ScriptLoader
from java.util import ArrayList
from java.text import SimpleDateFormat
from jarray import array
from java.lang import String
from com.ifs.btt.ui.xwt.widgets.fields import FComposite
#修改交易菜单检查
def update_tran_menus_init():
context = GlobalContext.getInstance().getTranContext()
tran_code = context.getTranTask().getCode()
load_tran_first_menus_update()
load_tran_second_menus_update()
return True
#加载更新一级菜单
def load_tran_first_menus_update():
context = GlobalContext.getInstance().getTranContext()
screen = context.getScreen()
group = u"交易菜单维护"
name = group + u".一级菜单"
f=DomainManager.getInstance().getFacadeContext()
widget=screen.getWidget(name)
fcombo=widget.getField()
l=list()
for v in f.nativeFetchMany(" select classification.id, classification.value from class_rollup,classification where relation_type_code ='TRAN_MENU_CLASSIFY' and class_rollup.parent_id is null and class_rollup.child_id = classification.id and classification.class_type_code ='TRAN_MENU_CLASS' order by classification.id asc ", []):
l.append(str(v[0]) + "#" + v[1])
fcombo.setOptions(",".join(l))
return True
#加载更新二级菜单
def load_tran_second_menus_update():
context = GlobalContext.getInstance().getTranContext()
screen = context.getScreen()
group = u"交易菜单维护"
name = group + u".二级菜单"
first_class = screen.getValue(group + u".一级菜单")
if first_class is None or first_class =="" :
return False
f=DomainManager.getInstance().getFacadeContext()
widget=screen.getWidget(name)
fcombo=widget.getField()
l=list()
for v in f.nativeFetchMany(" select classification.id, classification.value from class_rollup,classification where relation_type_code ='TRAN_MENU_CLASSIFY' and class_rollup.parent_id = %s and class_rollup.child_id = classification.id and classification.class_type_code ='TRAN_MENU_CLASS' order by classification.id asc "%(first_class), []):
l.append(str(v[0]) + "#" + v[1])
fcombo.setOptions(",".join(l))
fcombo.setIndex(-1)
return True
#交易码维护检查
def update_check_tran_code():
context = GlobalContext.getInstance().getTranContext()
screen = context.getScreen()
group = u"原交易信息"
name = group + u".交易代码"
f=DomainManager.getInstance().getFacadeContext()
tran_code = screen.getValue(name)
if tran_code is None or tran_code =="":
if len(tran_code) != 6:
MessageDialog.openError(None, "Error", u"交易代码长度不正确")
return False
tran=f.fetchOne("Tran","Tran","where code=?1",[tran_code])
if tran is None or tran == "":
MessageDialog.openError(None, "Error", u"交易码[%s]不存在" % tran_code)
else:
screen.setValue(group+u".交易名称", tran.getName())
screen.setValue(group+u".交易状态", tran.getTran_status())
screen.setValue(group+u".交易说明", tran.getDescription())
if tran.getControl_level() == "":
screen.setValue(group+u".重点监督级别", u"无")
else :
screen.setValue(group+u".重点监督级别", tran.getControl_level())
if tran.getAuthz_class() == "" :
screen.setValue(group+u".授权类型", u"")
else :
screen.setValue(group+u".授权类型", tran.getAuthz_class())
if tran.getTran_status() == "Y":
screen.setValue(group+u".是否允许反交易", u"是")
else :
screen.setValue(group+u".是否允许反交易", u"否")
tran_task=f.fetchOne("TranTask","TranTask","where code=?1",[tran_code])
if tran_task is None or tran_task == "":
return False
else :
screen.setValue(group+u".服务名称", tran_task.getService())
if tran_task.getTran_task_type_code()=="NORMAL_TASK":
screen.setValue(group+u".交易类型", u"普通交易任务")
elif tran_task.getTran_task_type_code()=="AUTH_TASK":
screen.setValue(group+u".交易类型", u"授权交易任务")
elif tran_task.getTran_task_type_code()=="DELETE_TASK":
screen.setValue(group+u".交易类型", u"删除交易任务")
elif tran_task.getTran_task_type_code()=="INPUT_TASK":
screen.setValue(group+u".交易类型", u"录入交易任务")
elif tran_task.getTran_task_type_code()=="MODIFY_TASK":
screen.setValue(group+u".交易类型", u"修改交易任务")
elif tran_task.getTran_task_type_code()=="PROCESS_TASK":
screen.setValue(group+u".交易类型", u"流程交易任务")
elif tran_task.getTran_task_type_code()=="REVIEW_TASK":
screen.setValue(group+u".交易类型", u"复核交易任务")
screen.setValue(group+u".交易状态", tran.getTran_status())
if tran.getTran_status() == "Y":
screen.setValue(group+u".是否允许反交易", u"是")
else :
screen.setValue(group+u".是否允许反交易", u"否")
#按照交易码取对应允许操作岗位
oper_position = f.nativeFetchOne(" select ac.id,ac.authc_type_code,ac.value from tran t,tran_authc ta ,authc ac where t.id =ta.tran_id and ac.id=ta.authc_id and ac.authc_type_code ='TRAN_OPER_POSITION' and t.id = ?1 ", [tran.getId()])
if oper_position is None:
MessageDialog.openError(None, "Error", u"操作岗位不存在")
return False
screen.getField(group+u".允许操作岗位").setValue(oper_position[2])
#按照交易码取对应的授权模式
authz_class = f.nativeFetchOne(" select atype.code, atype.name from tran t,tran_authz ta ,authz az,authz_type atype where t.id =ta.tran_id and az.id=ta.authz_id and az.authz_type_code=atype.code and atype.code !='REMOTE_REVIEW_AUTH' and t.id= ?1 ",[tran.getId()])
if authz_class is None :
screen.getField(group+u".授权模式", u"不授权")
else:
screen.getField(group+u".授权模式").setValue(authz_class[1])
#从交易码查对应的一级菜单和二级菜单
classification2 = f.fetchOne("classification", "Tran.classification", "where Tran.code = ?1" , [tran_code])
if classification2 is None:
return False
screen.getField(group+u".原归属二级菜单").setValue(classification2.getValue())
classification1 = f.nativeFetchOne(" select classification.id, classification.value from class_rollup,classification where relation_type_code ='TRAN_MENU_CLASSIFY' and class_rollup.child_id = ?1 and class_rollup.parent_id = classification.id and classification.class_type_code ='TRAN_MENU_CLASS' ", [classification2.getId()])
screen.getField(group+u".原归属一级菜单").setValue(classification1[1])
return True
python 脚本的更多相关文章
- freeswitch嵌入python脚本
操作系统:debian8.5_x64 freeswitch 版本 : 1.6.8 python版本:2.7.9 开启python模块 安装python lib库 apt-get install pyt ...
- python脚本后台运行
问题描述: 环境: CentOS6.4 一个用python写的监控脚本test1.py,用while True方式一直运行,在ssh远程(使用putty终端)时通过以下命令启动脚本: python t ...
- 某互联网后台自动化组合测试框架RF+Sikuli+Python脚本
某互联网后台自动化组合测试框架RF+Sikuli+Python脚本 http://www.jianshu.com/p/b3e204c8651a 字数949 阅读323 评论1 喜欢0 一.**Robo ...
- 动态执行python脚本
前言 存在许多独立的python脚本,这些脚本可能会增加,也可能会减少,现在需要按照某种顺序调度这些程序.在python的standard library中,有一个模块imp可以实现动态的调用ptho ...
- 一个获取指定目录下一定格式的文件名称和文件修改时间并保存为文件的python脚本
摘自:http://blog.csdn.net/forandever/article/details/5711319 一个获取指定目录下一定格式的文件名称和文件修改时间并保存为文件的python脚本 ...
- SecureCRT中python脚本编写
SecureCRT中python脚本编写学习指南 SecureCRT python 引言 在测试网络设备中,通常使用脚本对设备端进行配置和测试以及维护:对于PE设备的测试维护人员来说使用较多是Secu ...
- Python脚本配合Linux计划任务工作
经常遇到直接运行Python脚本没有问题,但是一放入/etc/crontab之后就歇菜的情况,总结了一下,大致需要注意以下几点: 1. 脚本首行加入#!/usr/bin/env python 2. 脚 ...
- Labview调用Python脚本
Labview程序框图如下: Python脚本如下: #!/usr/bin/env pythonimport sys #Command Line Arguements are stored in li ...
- 使用Runtime.getRuntime().exec()在java中调用python脚本
举例有一个Python脚本叫test.py,现在想要在Java里调用这个脚本.假定这个test.py里面使用了拓展的包,使得pythoninterpreter之类内嵌的编译器无法使用,那么只能采用ja ...
- FTP弱口令猜解【python脚本】
ftp弱口令猜解 python脚本: #! /usr/bin/env python # _*_ coding:utf-8 _*_ import ftplib,time username_list=[' ...
随机推荐
- Helpers\Assets
Helpers\Assets The assets helper is for loading CSS and JS files rather than writing out the full sc ...
- 去model化开发
前言 去model化是一种框架设计上的做法,其中的model并不是指架构中的model层,套用Casa大神博客中的原文就是: model化就是使用数据对象,去model化就是不使用数据对象. 常见的去 ...
- Arp欺骗攻击的另类应用之屌丝泡妞记
http://www.2cto.com/Article/201210/163974.html arp欺骗,我想大家都应该知道怎么回事了.不知道的去问度娘... 就不废话了,还是直接上图上教程比 ...
- AngularJS中在前后端分离模式下实现权限控制 - 基于RBAC
一:RBAC 百科解释: 基于角色的访问控制(Role-Based Access Control)作为传统访问控制(自主访问,强制访问)的有前景的代替受到广泛的关注.在RBAC中,权限与角色相关联,用 ...
- [转]ORACLE日期时间函数大全
本文转自:http://www.cnblogs.com/chuncn/archive/2009/04/29/1381282.html ORACLE日期时间函数大全 TO_DATE格式(以时间: ::2 ...
- HTTP层 —— 控制器
1.简介 将所有的请求处理逻辑都放在单个 routes.php 中显然是不合理的,你也许还希望使用控制器类组织管理这些行为.控制器可以将相关的 HTTP 请求封装到一个类中进行处理.通常控制器存放在 ...
- oracle-替换 换行符和空格符
--换行或空格: )), '') --换行及空格: update tableName set columnName= ), ), '')
- 解决某些手机RadioGroup中的RadioButton不居中的问题
问题:RadioButton中使用android:gravity="center"使其图片文字居中,在我的华为荣耀7手机上居中显示了,但在HUAWEI G606-T00却显示在右侧 ...
- 使用struts+spring+hibernate组装web应用
这篇文章将讨论怎样组合几个着名的框架去做到松耦合的目的,怎样建立你的构架,怎样让你的各个应用层保持一致.富于挑战的是:组合这些框架使得每一层都以一种松耦合的方式彼此沟通,而与底层的技术无关.这篇文章将 ...
- Spring集成PageHelper的简单用法
1.Maven依赖,注意使用PageHelper时的版本必须与Mybatis版本对应 <!-- 添加Mybatis依赖 --> <dependency> <groupId ...