create table wb_flow
(
    FLOW_ID      varchar(13)  not null
        primary key,
    FLOW_NAME    varchar(200) not null,
    MODIFY_USER  varchar(13)  not null,
    MODIFY_DATE  datetime     not null,
    REMARK       text         null,
    FLOW_CONTENT longtext     null,
    constraint WB_FLOW_FLOW_NAME
        unique (FLOW_NAME)
);

INSERT INTO ag_devmysql.wb_flow (FLOW_ID, FLOW_NAME, MODIFY_USER, MODIFY_DATE, REMARK, FLOW_CONTENT) VALUES ('003ZOUKX8NB2T', '费用报销', 'admin', '2016-08-19 15:06:56', null, '{"list":[{"box":{"x":40,"y":32,"w":150},"isObj":true,"script":"var amount = 0,\\n  recs = Wb.decode(route.get(\'applyGrid\'));\\nWb.each(recs, function(rec) {\\n  amount += rec.fee;\\n});\\n//如果报销合计金额大于10000需要由上级经理审批，否则直接提交财务审核处理\\nif (amount > 10000) route.to(\'上级经理审批\');\\nelse route.to(\'财务审核处理\');\\nreturn false; //默认不自动流转（已经由route.to方法流转）","label":"部门经理审批"},{"box":{"x":240,"y":32,"w":150},"isObj":true,"script":"","label":"上级经理审批"},{"box":{"x":40,"y":80,"w":150},"isObj":true,"script":"route.set(\'STATUS\', \'完成\');\\njava.lang.System.out.println(route.get(\'sys.username\') + \'报销到账\');\\n//实际业务中可执行银行转账和邮件通知操作","label":"财务审核处理"},{"box":{"x":40,"y":128,"w":150},"isObj":true,"script":"","label":"完成"},{"isObj":false,"box":{"x":191,"y":43.5,"w":48}},{"isObj":false,"box":{"x":115,"y":56,"w":0}},{"isObj":false,"box":{"x":191,"y":43.5,"w":48}},{"isObj":false,"box":{"x":115,"y":104,"w":0}}],"conn":[{"dst":"上级经理审批","src":"部门经理审批"},{"dst":"财务审核处理","src":"部门经理审批"},{"dst":"财务审核处理","src":"上级经理审批"},{"dst":"完成","src":"财务审核处理"}]}');
INSERT INTO ag_devmysql.wb_flow (FLOW_ID, FLOW_NAME, MODIFY_USER, MODIFY_DATE, REMARK, FLOW_CONTENT) VALUES ('003ZOUKX8NB32', '合同审批', 'admin', '2016-03-30 14:10:06', null, '{"conn":[{"dst":"部门审核","src":"起草合同"},{"dst":"合同主管部门审核","src":"部门审核"},{"dst":"法务部门审核","src":"合同主管部门审核"},{"dst":"财务部门审核","src":"合同主管部门审核"},{"dst":"办公会议审核","src":"合同主管部门审核"},{"dst":"合同主管部门汇总修改","src":"法务部门审核"},{"dst":"合同主管部门汇总修改","src":"财务部门审核"},{"dst":"合同主管部门汇总修改","src":"办公会议审核"},{"dst":" 常务副总审核","src":"合同主管部门汇总修改"},{"dst":" 总裁审核","src":" 常务副总审核"},{"dst":"合同主管部门存档","src":" 总裁审核"},{"dst":"承办部门实施","src":" 总裁审核"},{"dst":"重新修改合同","src":"合同主管部门汇总修改"},{"dst":"部门审核","src":"重新修改合同"}],"name":"合同审批","list":[{"box":{"x":24,"y":24,"w":150},"isObj":true,"script":"","label":"起草合同"},{"box":{"x":200,"y":24,"w":150},"isObj":true,"script":"","label":"部门审核"},{"box":{"x":376,"y":24,"w":150},"isObj":true,"script":"//未指定默认流转到所有目标节点","label":"合同主管部门审核"},{"box":{"x":200,"y":72,"w":150},"isObj":true,"script":"route.set(\'法务审核\',true);","label":"法务部门审核"},{"box":{"x":376,"y":72,"w":150},"isObj":true,"script":"route.set(\'财务审核\',true);","label":"财务部门审核"},{"box":{"x":552,"y":72,"w":150},"isObj":true,"script":"route.set(\'办公会议审核\',true);","label":"办公会议审核"},{"box":{"x":376,"y":120,"w":150},"isObj":true,"script":"return route.get(\'法务审核\')get(\'财务审核\')get(\'办公会议审核\');","label":"合同主管部门汇总修改"},{"box":{"x":376,"y":168,"w":150},"isObj":true,"script":"","label":" 常务副总审核"},{"box":{"x":376,"y":216,"w":150},"isObj":true,"script":"","label":" 总裁审核"},{"box":{"x":288,"y":264,"w":150},"isObj":true,"script":"","label":"合同主管部门存档"},{"box":{"x":464,"y":264,"w":150},"isObj":true,"script":"","label":"承办部门实施"},{"isObj":false,"box":{"x":175,"y":35.5,"w":24}},{"isObj":false,"box":{"x":351,"y":35.5,"w":24}},{"isObj":false,"box":{"x":351,"y":35.5,"w":24}},{"isObj":false,"box":{"x":451,"y":48,"w":0}},{"isObj":false,"box":{"x":527,"y":35.5,"w":24}},{"isObj":false,"box":{"x":351,"y":83.5,"w":24}},{"isObj":false,"box":{"x":451,"y":96,"w":0}},{"isObj":false,"box":{"x":527,"y":83.5,"w":24}},{"isObj":false,"box":{"x":451,"y":144,"w":0}},{"isObj":false,"box":{"x":451,"y":192,"w":0}},{"isObj":false,"box":{"x":363,"y":227.5,"w":12}},{"isObj":false,"box":{"x":527,"y":227.5,"w":12}},{"box":{"x":24,"y":120,"w":150},"isObj":true,"script":"//任意节点拒绝可使用route.to(\'重新修改合同\')来实现节点的跳转","label":"重新修改合同"},{"isObj":false,"box":{"x":175,"y":131.5,"w":200}},{"isObj":false,"box":{"x":175,"y":35.5,"w":24}}]}');
INSERT INTO ag_devmysql.wb_flow (FLOW_ID, FLOW_NAME, MODIFY_USER, MODIFY_DATE, REMARK, FLOW_CONTENT) VALUES ('0045WE4ZK7STI', '委托费用审核', 'admin', '2018-04-01 10:53:17', null, '{"list":[{"label":"兰总审批","isObj":true,"script":"","box":{"x":128,"y":104,"w":150}},{"label":"完成","isObj":true,"script":"","box":{"x":128,"y":168,"w":150}},{"label":"开始","isObj":true,"script":"","box":{"x":128,"y":40,"w":150}},{"isObj":false,"box":{"x":203,"y":64,"w":0}},{"isObj":false,"box":{"x":203,"y":128,"w":0}}],"conn":[{"src":"开始","dst":"兰总审批"},{"src":"兰总审批","dst":"完成"}]}');
