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=[' ...
随机推荐
- Arcengine10下载地址
ed2k://|file|%5BArcGIS.Engine.Developer.kit.10.%E8%8B%B1%E6%96%87%E7%89%88%5D.ArcGIS.Engine.Develope ...
- Windows批处理(cmd/bat)常用命令小结
转载自:“趣IT”微信公共号 前言 批处理文件(batch file)包含一系列 DOS命令,通常用于自动执行重复性任务.用户只需双击批处理文件便可执行任务,而无需重复输入相同指令.编写批处理文件非常 ...
- 《Mysql 公司职员学习篇》 第二章 小A的惊喜
第二章 小A的惊喜 ---- 认识数据库 吃完饭后,小Y和小A回到了家里,并打开电脑开始学习Mysql. 小Y:"小A,你平时的Excell文件很多的情况下,怎么样存放Exce ...
- NGINX server配置中if的用法
server的配置以php为例,如下: 1 server{ 2 root /var/webproject/www/mytools-php; 3 index index.html index.php; ...
- readint writeint
inline int readint() { char c = getchar(); while(!isdigit(c)) c = getchar(); ; while(isdigit(c)) { x ...
- 设置checkbox选中,设置radio选中,根据值设置checkbox选中,checkbox勾选
设置checkbox选中,设置radio选中,根据值设置checkbox选中,checkbox勾选 >>>>>>>>>>>>&g ...
- 一点关于this的理解
关于this,是很多前端面试必考的题目,有时候在网上看到这些题目,自己试了一下,额,还真的错了!在实际开发中,也会遇到 this 的问题(虽然一些类库会帮我们处理),例如在使用一些框架的时候,例如:k ...
- ASP连接MYSQL数据库
<% strconnection="driver={mysql odbc 3.51 driver};database=weste_net;server=localhost;uid=ro ...
- 使用SQLdiag Utility搜集SQL Server诊断信息
SQLdiag Utility用于搜集诊断信息,给Microsoft技术支持人员做为判断依据. 使用SQLdiag 会进行信息搜集类型 Windows 系统性能日志 Windows 系统日志 SQL ...
- 对 ASP.NET 页面进行跟踪(Control Tree)
在页面头部加入属性 : Trace="True" 参考MSDN: https://msdn.microsoft.com/zh-cn/library/94c55d08(v=vs.10 ...