portal开发"下拉框"“日期框”查询要怎么配置

时间:2023-03-09 16:58:01
portal开发"下拉框"“日期框”查询要怎么配置

下面的这些是我今天的成果!

portal开发"下拉框"“日期框”查询要怎么配置

总的来说是一步一步摸索出来的!还是等感谢超哥的耐心指导,犯了一些错误!

1.比如在wd配置文件中中写id=“check_it_two”,在java中写成 checki_it_two

2.页面实现水平布局用<FlowhPanel>

 <?xml version="1.0" encoding='UTF-8'?>
<UIMeta flowmode="true" id="main" preferredHeight="" preferredWidth="">
<FlowvLayout id="flowvLayout" widgetId="main">
<FlowvPanel id="g_p_1">
<CanvasLayout className="rightcanvas" id="listmenubarCanvas">
<CanvasPanel id="canvasp">
<Menubar height="100%" id="menu_list" left="0" position="relative" top="0" width="100%">
</Menubar>
</CanvasPanel>
</CanvasLayout>
</FlowvPanel>
<FlowhPanel id="panelv065281" widgetId="main">
<Label height="18" id="lable" left="0" position="relative" textAlign="left" top="0" widgetId="main">
</Label>
</FlowhPanel>
<FlowhPanel id="g_p_3" widgetId="main">
<TextField height="22" id="check_it_now" imgsrc="" left="0" position="relative" top="0" type="text" widgetId="main" width="15%">
</TextField>
</FlowhPanel>
<FlowhPanel id="g_p_4" widgetId="main">
<Button height="23" id="select_confirm" left="0" position="relative" top="0" widgetId="main" width="64">
</Button>
</FlowhPanel>
<FlowhPanel id="panelv065282" widgetId="main">
<Label height="22" id="lable1" left="0" position="relative" textAlign="left" top="0" widgetId="main">
</Label>
</FlowhPanel>
<FlowhPanel id="g_p_5" widgetId="main">
<TextField height="22" id="check_it_two" imgsrc="" left="0" position="relative" top="0" type="text" widgetId="main" width="100%">
</TextField>
</FlowhPanel>
<FlowhPanel id="g_p_6" widgetId="main">
<Button height="23" id="select_confirm_two" left="0" position="relative" top="0" widgetId="main" width="64">
</Button>
</FlowhPanel>
<FlowhPanel id="panelv065283" widgetId="main">
<Label height="22" id="lable2" left="0" position="relative" textAlign="left" top="0" widgetId="main">
</Label>
</FlowhPanel>
<FlowhPanel id="g_p_7" widgetId="main">
<TextField height="22" id="check_it_three" imgsrc="" left="0" position="relative" top="0" type="text" widgetId="main" width="100%">
</TextField>
</FlowhPanel>
<FlowhPanel id="g_p_8" widgetId="main">
<Button height="23" id="select_confirm_three" left="0" position="relative" top="0" widgetId="main" width="64">
</Button>
</FlowhPanel> <FlowvPanel id="g_p_2">
<GridComp height="100%" id="leaveapply_grid" left="0" position="relative" top="0" width="100%">
</GridComp>
</FlowvPanel>
</FlowvLayout> </UIMeta>

3.配置下拉框的时候要配置,数据来源,同时数据来源要配对应的数据来源,我当时配置到了另外一个数据源结果出来的数据是错误的!

第一个配置配置在 <Components>中,第二个配置在<Models>中

 <ComBoBoxComp i18nName="" langDir="" allowExtendValue="false" editorType="ComboBox" enabled="true" focus="false" id="check_it_two" refComboData="combo_leaveapply_approve_state" selectOnly="true" text="" textAlign="left" visible="true">
</ComBoBoxComp>
<ButtonComp i18nName="" langDir="" enabled="true" id="select_confirm_two" text="查询" visible="true">
<Events>
<Event async="true" jsEventClaszz="nc.uap.lfw.core.event.conf.MouseListener" methodName="onselect2" name="onclick" onserver="true">
<SubmitRule cardSubmit="false" panelSubmit="false" tabSubmit="false">
</SubmitRule>
<Params>
<Param>
<Name>mouseEvent</Name>
<Value>
</Value>
<Desc> <![CDATA[nc.uap.lfw.core.event.MouseEvent]]>
</Desc>
</Param>
</Params>
<Action>
</Action>
</Event>
</Events>
</ButtonComp>
 <ComboDatas>
<MDComboDataConf caption="单据状态" fullclassName="2ed33012-890c-4e5f-82a0-40ef0eeb4b45" id="combo_leaveapply_approve_state">
</MDComboDataConf>
</ComboDatas>

4.配置日期框是用的

<TextComp editorType="DateText" enabled="true" focus="false" i18nName="" id="check_it_three" langDir="" text="" textAlign="left" visible="true">
</TextComp>

在获取到日期框的时候还要转化类型

 public void onselect3(MouseEvent<MenuItem> mouseEvent){
//获取相应的TextComp的值的方法
TextComp checkComp = (TextComp) ViewUtil.getCurrentView().getViewComponents().getComponent("check_it_three");
//对获取到的checkComp获取对象的value
String checkname=checkComp.getValue()==null?"":checkComp.getValue();
//日期类型转化--获取到的String先转化为long,转化为long之后再转化为Date,转化为Date之后再转化为String
long l = Long.parseLong(checkname);
Date date = new Date(l);
SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
String checkname1=sdf.format(date)==null?"":sdf.format(date);
//调用queryVOs2包中的方法查询到相应的数据
SuperVO[] vos = queryVOs4(checkname1);
//获取页面元素的util类
LfwView viewMain = ViewUtil.getCurrentView();
//获取对应的VO。这个应该是实体表的表名“leaveapply”,在配置文件中可以找到,要一一对应哦!
Dataset ds = viewMain.getViewModels().getDataset("leaveapply");
if (ds == null) {
return;
}
//序列化
new SuperVO2DatasetSerializer().serialize(vos, ds, Row.STATE_NORMAL); }
 /**
* 按照日期by曾志伟
*
* */
protected SuperVO[] queryVOs4(String checkname1){
//StringBuffer拼接数据库语句
StringBuffer whereSQL=new StringBuffer();
//拼接你传进来值
whereSQL.append("apply_date='"+checkname1+"'");
//实体对应的VO。我的理解相当于javabean
LeaveApplyVO[] hvos=null;
try{
//调用接口相应的查询方法---超哥跟我说过/要写接口,同时也要写实现类,接口是写在public中,
//实现类是写在private中,最后在/NC_HR_WEB6.3_150915/mw/META-INF中创建**.upm文件配置
hvos = iLeaveApplyQueryMaintain.queryLeaveApplyVOByCondition(whereSQL.toString()); }catch(BusinessException e){
Logger.error(e.getMessage(),e);
} return hvos;
}

谢谢超哥的耐心指导,我会加把劲的!

portal开发"下拉框"“日期框”查询要怎么配置

出现这张截图是因为我当时那个下拉框没有配置数据来源

portal开发"下拉框"“日期框”查询要怎么配置

ctrl+H可以用关键词搜索 ,如下图

portal开发"下拉框"“日期框”查询要怎么配置

portal开发"下拉框"“日期框”查询要怎么配置

portal开发"下拉框"“日期框”查询要怎么配置

portal开发"下拉框"“日期框”查询要怎么配置

portal开发"下拉框"“日期框”查询要怎么配置

portal开发"下拉框"“日期框”查询要怎么配置

今天写的代码如下:

uimeta.um

 <?xml version="1.0" encoding='UTF-8'?>
<UIMeta flowmode="true" id="main" preferredHeight="" preferredWidth="">
<FlowvLayout id="flowvLayout" widgetId="main">
<FlowvPanel id="g_p_1">
<CanvasLayout className="rightcanvas" id="listmenubarCanvas">
<CanvasPanel id="canvasp">
<Menubar height="100%" id="menu_list" left="0" position="relative" top="0" width="100%">
</Menubar>
</CanvasPanel>
</CanvasLayout>
</FlowvPanel>
<FlowhPanel id="panelv065281" widgetId="main">
13 <Label height="18" id="lable" left="0" position="relative" textAlign="left" top="0" widgetId="main">
14 </Label>
15 </FlowhPanel>
<FlowhPanel id="g_p_3" widgetId="main">
<TextField height="22" id="check_it_now" imgsrc="" left="0" position="relative" top="0" type="text" widgetId="main" width="15%">
</TextField>
</FlowhPanel>
<FlowhPanel id="g_p_4" widgetId="main">
<Button height="23" id="select_confirm" left="0" position="relative" top="0" widgetId="main" width="64">
</Button>
</FlowhPanel>
<FlowhPanel id="panelv065282" widgetId="main">
25 <Label height="22" id="lable1" left="0" position="relative" textAlign="left" top="0" widgetId="main">
26 </Label>
27 </FlowhPanel>
28 <FlowhPanel id="g_p_5" widgetId="main">
29 <TextField height="22" id="check_it_two" imgsrc="" left="0" position="relative" top="0" type="text" widgetId="main" width="100%">
30 </TextField>
31 </FlowhPanel>
32 <FlowhPanel id="g_p_6" widgetId="main">
33 <Button height="23" id="select_confirm_two" left="0" position="relative" top="0" widgetId="main" width="64">
34 </Button>
35 </FlowhPanel>
36 <FlowhPanel id="panelv065283" widgetId="main">
37 <Label height="22" id="lable2" left="0" position="relative" textAlign="left" top="0" widgetId="main">
38 </Label>
39 </FlowhPanel>
40 <FlowhPanel id="g_p_7" widgetId="main">
41 <TextField height="22" id="check_it_three" imgsrc="" left="0" position="relative" top="0" type="text" widgetId="main" width="100%">
42 </TextField>
43 </FlowhPanel>
44 <FlowhPanel id="g_p_8" widgetId="main">
45 <Button height="23" id="select_confirm_three" left="0" position="relative" top="0" widgetId="main" width="64">
46 </Button>
47 </FlowhPanel>
48
49 <FlowvPanel id="g_p_2">
50 <GridComp height="100%" id="leaveapply_grid" left="0" position="relative" top="0" width="100%">
51 </GridComp>
52 </FlowvPanel>
</FlowvLayout> </UIMeta>

widge.wd

 <?xml version="1.0" encoding='UTF-8'?>
<Widget controllerClazz="nc.bs.hrss.hi.leave.LeaveApplyListWinMainViewCtrl" id="main" refId="main" sourcePackage="hi/src/public/">
<PlugoutDescs>
</PlugoutDescs>
<PluginDescs>
<PluginDesc id="inParam">
<PluginDescItem clazztype="java.lang.String" id="appid">
</PluginDescItem>
</PluginDesc>
<PluginDesc id="openMain">
</PluginDesc>
<PluginDesc id="refresh_plugin" methodName="pluginReSearch">
<PluginDescItem clazztype="java.lang.String" id="OPERATE_ROW">
</PluginDescItem>
</PluginDesc>
</PluginDescs>
<Connectors>
<Connector connType="6" id="listViewConnID" pluginId="refresh_plugin" plugoutId="proxyAfterSavePlugout" source="LeaveApplyList" sourceWindow="" target="main" targetWindow="">
</Connector>
</Connectors>
<Events>
<Event async="true" jsEventClaszz="nc.uap.lfw.core.event.conf.DialogListener" methodName="onBeforeShow" name="beforeShow" onserver="true">
<SubmitRule cardSubmit="false" panelSubmit="false" tabSubmit="false">
</SubmitRule>
<Params>
<Param>
<Name>dialogEvent</Name>
<Value>
</Value>
<Desc> <![CDATA[nc.uap.lfw.core.event.DialogEvent]]> </Desc>
</Param>
</Params>
<Action>
</Action>
</Event>
<!--<Event async="true" methodName="plugininParam" onserver="true">
<Params>
<Param>
<Name>keys</Name>
<Value>
</Value>
<Desc> <![CDATA[java.util.Map]]> </Desc>
</Param>
</Params>
<Action>
</Action>
</Event>
<Event async="true" methodName="pluginReSearch" onserver="true">
<Params>
<Param>
<Name>keys</Name>
<Value>
</Value>
<Desc> <![CDATA[java.util.Map]]> </Desc>
</Param>
</Params>
<Action>
</Action>
</Event>-->
</Events>
<Models>
<Datasets>
<RefMdDataset caption="用户" controlwidgetopeStatus="false" enabled="false" id="$refds_uap_user" lazyLoad="true" notNullBody="false" objMeta="uap.user" voMeta="nc.vo.sm.UserVO">
<Fields>
</Fields>
</RefMdDataset>
<MdDataset caption="休假申请" controlwidgetopeStatus="true" enabled="false" id="leaveapply" lazyLoad="true" notNullBody="false" objMeta="hrss.leaveapply" pageSize="15" voMeta="nc.vo.hrss.leaveapply.LeaveApplyVO">
<FieldRelations>
<FieldRelation id="transtypeid_rel" needProcess="true" refDataset="$refds_uap_BilltypeVO">
<MatchFields>
<Field readField="billtypename" writeField="transtypeid_name">
</Field>
</MatchFields>
<WhereField>
<Field key="pk_billtypeid" value="transtypeid">
</Field>
</WhereField>
</FieldRelation>
<FieldRelation id="pk_group_rel" needProcess="true" refDataset="$refds_uap_group" useCache="true">
<MatchFields>
<Field readField="name" writeField="pk_group_name">
</Field>
</MatchFields>
<WhereField>
<Field key="pk_group" value="pk_group">
</Field>
</WhereField>
</FieldRelation>
<FieldRelation id="pk_org_rel" needProcess="true" refDataset="$refds_uap_hrorg" useCache="true">
<MatchFields>
<Field readField="name" writeField="pk_org_name">
</Field>
</MatchFields>
<WhereField>
<Field key="pk_hrorg" value="pk_org">
</Field>
</WhereField>
</FieldRelation>
<FieldRelation id="billmaker_rel" needProcess="true" refDataset="$refds_uap_user" useCache="true">
<MatchFields>
<Field readField="user_name" writeField="billmaker_user_name">
</Field>
</MatchFields>
<WhereField>
<Field key="cuserid" value="billmaker">
</Field>
</WhereField>
</FieldRelation>
<FieldRelation id="approver_rel" needProcess="true" refDataset="$refds_uap_user" useCache="true">
<MatchFields>
<Field readField="user_name" writeField="approver_user_name">
</Field>
</MatchFields>
<WhereField>
<Field key="cuserid" value="approver">
</Field>
</WhereField>
</FieldRelation>
<FieldRelation id="creator_rel" needProcess="true" refDataset="$refds_uap_user" useCache="true">
<MatchFields>
<Field readField="user_name" writeField="creator_user_name">
</Field>
</MatchFields>
<WhereField>
<Field key="cuserid" value="creator">
</Field>
</WhereField>
</FieldRelation>
<FieldRelation id="modifier_rel" needProcess="true" refDataset="$refds_uap_user" useCache="true">
<MatchFields>
<Field readField="user_name" writeField="modifier_user_name">
</Field>
</MatchFields>
<WhereField>
<Field key="cuserid" value="modifier">
</Field>
</WhereField>
</FieldRelation>
</FieldRelations>
<Fields>
<Field dataType="String" i18nName="" id="leavetype_name" langDir="node_rm-res" nullAble="true" primaryKey="false" text="">
</Field>
</Fields>
<Events>
<Event async="true" jsEventClaszz="nc.uap.lfw.core.event.conf.DatasetListener" methodName="onDataLoad" name="onDataLoad" onserver="true">
<SubmitRule>
</SubmitRule>
<Params>
<Param>
<Name>dataLoadEvent</Name>
<Value>
</Value>
<Desc> <![CDATA[]]>
</Desc>
</Param>
</Params>
<Action>
</Action>
</Event>
<Event async="true" jsEventClaszz="nc.uap.lfw.core.event.conf.DatasetListener" methodName="onAfterRowSelect" name="onAfterRowSelect" onserver="true">
<SubmitRule>
</SubmitRule>
<Params>
<Param>
<Name>datasetEvent</Name>
<Value>
</Value>
<Desc> <![CDATA[nc.uap.lfw.core.event.DatasetEvent]]>
</Desc>
</Param>
</Params>
<Action>
</Action>
</Event>
</Events>
</MdDataset>
<RefMdDataset caption="单据类型" controlwidgetopeStatus="false" enabled="false" id="$refds_uap_BilltypeVO" lazyLoad="true" notNullBody="false" objMeta="uap.BilltypeVO" voMeta="nc.vo.pub.billtype.BilltypeVO">
<Fields>
</Fields>
</RefMdDataset>
<RefMdDataset caption="组织_集团" controlwidgetopeStatus="false" enabled="false" id="$refds_uap_group" lazyLoad="true" notNullBody="false" objMeta="uap.group" voMeta="nc.vo.org.GroupVO">
<Fields>
</Fields>
</RefMdDataset>
<RefMdDataset caption="工作记录" controlwidgetopeStatus="false" enabled="false" id="$refds_hrhi_hi_psnjob" lazyLoad="true" notNullBody="false" objMeta="hrhi.hi_psnjob" voMeta="nc.vo.hi.psndoc.PsnJobVO">
<Fields>
</Fields>
</RefMdDataset>
<RefMdDataset caption="人员基本信息" controlwidgetopeStatus="false" enabled="false" id="$refds_hrhi_bd_psndoc" lazyLoad="true" notNullBody="false" objMeta="hrhi.bd_psndoc" voMeta="nc.vo.hi.psndoc.PsndocVO">
<Fields>
</Fields>
</RefMdDataset>
<RefMdDataset caption="组织_业务单元_人力资源组织" controlwidgetopeStatus="false" enabled="false" id="$refds_uap_hrorg" lazyLoad="true" notNullBody="false" objMeta="uap.hrorg" voMeta="nc.vo.org.HROrgVO">
<Fields>
</Fields>
</RefMdDataset>
<RefMdDataset caption="岗位基本信息" controlwidgetopeStatus="false" enabled="false" id="$refds_hrjf_om_post" lazyLoad="true" notNullBody="false" objMeta="hrjf.om_post" voMeta="nc.vo.om.post.PostVO">
<Fields>
</Fields>
</RefMdDataset>
<!-- <RefMdDataset caption="请假类别(自定义档案)" controlwidgetopeStatus="false" enabled="false" id="$refds_uap_leavetype" lazyLoad="true" notNullBody="false" objMeta="uap.Defdoc-bgy-23" voMeta="nc.vo.bd.defdoc.DefdocVO">
<Fields>
</Fields>
</RefMdDataset>-->
<RefMdDataset caption="休假类别" controlwidgetopeStatus="false" enabled="false" id="$refds_hrta_leavetype" lazyLoad="true" notNullBody="false" objMeta="hrta.leavetype" voMeta="nc.vo.ta.timeitem.LeaveTypeVO">
<Fields>
</Fields>
</RefMdDataset>
<RefMdDataset caption="职级(自定义档案)" controlwidgetopeStatus="false" enabled="false" id="$refds_uap_psnrank" lazyLoad="true" notNullBody="false" objMeta="uap.Defdoc-BGY03" voMeta="nc.vo.bd.defdoc.DefdocVO">
<Fields>
</Fields>
</RefMdDataset>
<RefMdDataset caption="工作制(自定义档案)" controlwidgetopeStatus="false" enabled="false" id="$refds_uap_working" lazyLoad="true" notNullBody="false" objMeta="uap.Defdoc-BGY20" voMeta="nc.vo.bd.defdoc.DefdocVO">
<Fields>
</Fields>
</RefMdDataset>
</Datasets>
<ComboDatas>
219 <MDComboDataConf caption="单据状态" fullclassName="2ed33012-890c-4e5f-82a0-40ef0eeb4b45" id="combo_leaveapply_approve_state">
220 </MDComboDataConf>
221 </ComboDatas>

<RefNodes>
<NCRefNode allowInput="false" dataListener="" dialogHeight="" dialogWidth="" filterRefNodeNames="false" hrOrgs="false" i18nName="" id="refnode_leaveapply_creator_user_name" langDir="" multiSel="false" orgs="false" pagemeta="reference" pagemodel="" read="false" readDs="masterDs" readFields="cuserid,user_name" refId="" refcode="用户" refnodeDelegator="" relationRefNodeId="" selLeafOnly="false" text="" usePower="false" writeDs="leaveapply" writeFields="creator,creator_user_name">
</NCRefNode>
<NCRefNode allowInput="false" dataListener="" dialogHeight="" dialogWidth="" filterRefNodeNames="false" hrOrgs="false" i18nName="" id="refnode_leaveapply_billmaker_user_name" langDir="" multiSel="false" orgs="false" pagemeta="reference" pagemodel="" read="false" readDs="masterDs" readFields="cuserid,user_name" refId="" refcode="用户" refnodeDelegator="" relationRefNodeId="" selLeafOnly="false" text="" usePower="false" writeDs="leaveapply" writeFields="billmaker,billmaker_user_name">
</NCRefNode>
<NCRefNode allowInput="false" dataListener="" dialogHeight="" dialogWidth="" filterRefNodeNames="false" hrOrgs="false" i18nName="" id="refnode_leaveapply_psncode" langDir="" multiSel="false" orgs="false" pagemeta="reference" pagemodel="" read="false" readDs="masterDs" readFields="pk_psndoc,pk_psnjob,code,name,org_orgs_name,org_dept_name,postname" refId="" refcode="人员工作记录" refnodeDelegator="" relationRefNodeId="" selLeafOnly="false" text="" usePower="false" writeDs="leaveapply" writeFields="pk_psndoc,pk_psnjob,psncode,psnname,psnorg,psndept,psnpost">
</NCRefNode>
<NCRefNode allowInput="false" dataListener="" dialogHeight="" dialogWidth="" filterRefNodeNames="false" hrOrgs="false" i18nName="" id="refnode_leaveapply_pk_org_name" langDir="" multiSel="false" orgs="false" pagemeta="reference" pagemodel="" read="false" readDs="masterDs" readFields="pk_hrorg,name" refId="" refcode="人力资源组织" refnodeDelegator="" relationRefNodeId="" selLeafOnly="false" text="" usePower="false" writeDs="leaveapply" writeFields="pk_org,pk_org_name">
</NCRefNode>
<NCRefNode allowInput="false" dataListener="" dialogHeight="" dialogWidth="" filterRefNodeNames="false" hrOrgs="false" i18nName="" id="refnode_leaveapply_modifier_user_name" langDir="" multiSel="false" orgs="false" pagemeta="reference" pagemodel="" read="false" readDs="masterDs" readFields="cuserid,user_name" refId="" refcode="用户" refnodeDelegator="" relationRefNodeId="" selLeafOnly="false" text="" usePower="false" writeDs="leaveapply" writeFields="modifier,modifier_user_name">
</NCRefNode>
<!--<NCRefNode allowInput="false" dataListener="" dialogHeight="" dialogWidth="" filterRefNodeNames="false" hrOrgs="false" i18nName="" id="refnode_leaveapply_leavetype_name" langDir="" multiSel="false" orgs="false" pagemeta="reference" pagemodel="" read="false" readDs="masterDs" readFields="pk_defdoc,name" refId="" refcode="请假类别(自定义档案)" refnodeDelegator="" relationRefNodeId="" selLeafOnly="false" text="" usePower="false" writeDs="leaveapply" writeFields="leavetype,leavetype_name">
</NCRefNode>-->
<NCRefNode allowInput="false" dataListener="" dialogHeight="" dialogWidth="" filterRefNodeNames="false" hrOrgs="false" i18nName="" id="refnode_leaveapply_leavetype_name" langDir="" multiSel="false" orgs="false" pagemeta="reference" pagemodel="" read="false" readDs="masterDs" readFields="pk_timeitem,timeitemname" refId="" refcode="休假类别" refnodeDelegator="" relationRefNodeId="" selLeafOnly="false" text="" usePower="false" writeDs="leaveapply" writeFields="leavetype,leavetype_name">
</NCRefNode>
<NCRefNode allowInput="false" dataListener="" dialogHeight="" dialogWidth="" filterRefNodeNames="false" hrOrgs="false" i18nName="" id="refnode_leaveapply_pk_group_name" langDir="" multiSel="false" orgs="false" pagemeta="reference" pagemodel="" read="false" readDs="masterDs" readFields="pk_group,name" refId="" refcode="集团" refnodeDelegator="" relationRefNodeId="" selLeafOnly="false" text="" usePower="false" writeDs="leaveapply" writeFields="pk_group,pk_group_name">
</NCRefNode>
<NCRefNode allowInput="false" dataListener="" dialogHeight="" dialogWidth="" filterRefNodeNames="false" hrOrgs="false" i18nName="" id="refnode_leaveapply_approver_user_name" langDir="" multiSel="false" orgs="false" pagemeta="reference" pagemodel="" read="false" readDs="masterDs" readFields="cuserid,user_name" refId="" refcode="用户" refnodeDelegator="" relationRefNodeId="" selLeafOnly="false" text="" usePower="false" writeDs="leaveapply" writeFields="approver,approver_user_name">
</NCRefNode>
<NCRefNode allowInput="false" dataListener="" dialogHeight="" dialogWidth="" filterRefNodeNames="false" hrOrgs="false" i18nName="" id="refnode_leaveapply_transtypeid_name" langDir="" multiSel="false" orgs="false" pagemeta="reference" pagemodel="" readDs="masterDs" readFields="pk_billtypeid,billtypename,pk_billtypecode" refId="" refcode="影响因素交 易类型" refnodeDelegator="" selLeafOnly="false" text="交易类型参照" usePower="false" writeDs="leaveapply" writeFields="transtypeid,transtypeid_name,transtype">
</NCRefNode>
</RefNodes> <ComboDatas>
<DynamicComboData i18nName="" langDir="" caption="" className="nc.bs.hrss.mymsg.ctrl.BilltypeNameCombo" id="combo_billtypename">
</DynamicComboData> </ComboDatas> </Models>
<Components>
<GridComp autoRowHeight="false" canCopy="true" caption="leaveapply_grid" checkBoxModel="1" dataset="leaveapply" editable="true" enabled="true" expandTree="false" id="leaveapply_grid" multiSelect="false" multiSelectShow="true" onPaste="" pagenationTop="false" reference="false" selfDefImageBtnRender="" showColInfo="false" showForm="false" showHeader="true" showImageBtn="false" showNumCol="false" showSumRow="false" showTree="true" sortable="true" visible="true">
<Column autoExpand="false" dataType="String" editable="true" editorType="StringText" field="pk_group" fixedHeader="false" id="pk_group" imageOnly="false" langDir="leaveapply" nullAble="true" renderType="DefaultRender" showCheckBox="true" sortable="true" sumCol="false" text="所属集团" textAlign="left" visible="false" width="120">
</Column>
<Column autoExpand="false" dataType="String" editable="true" editorType="Reference" field="pk_group_name" fixedHeader="false" id="pk_group_name" imageOnly="false" nullAble="true" refNode="refnode_leaveapply_pk_group_name" renderType="DefaultRender" showCheckBox="true" sortable="true" sumCol="false" text="所属集团" textAlign="left" visible="false" width="120">
</Column>
<Column autoExpand="false" dataType="String" editable="true" editorType="StringText" field="pk_org" fixedHeader="false" id="pk_org" imageOnly="false" langDir="leaveapply" nullAble="true" renderType="DefaultRender" showCheckBox="true" sortable="true" sumCol="false" text="所属组织" textAlign="left" visible="false" width="120">
</Column>
<Column autoExpand="false" dataType="String" editable="true" editorType="Reference" field="pk_org_name" fixedHeader="false" id="pk_org_name" imageOnly="false" nullAble="true" refNode="refnode_leaveapply_pk_org_name" renderType="DefaultRender" showCheckBox="true" sortable="true" sumCol="false" text="所属组织" textAlign="left" visible="false" width="120">
</Column>
<Column autoExpand="false" dataType="String" editable="true" editorType="StringText" field="bill_code" fixedHeader="false" id="bill_code" imageOnly="false" langDir="leaveapply" nullAble="true" renderType="LnkCompRender" showCheckBox="true" sortable="true" sumCol="false" text="申请单编码" textAlign="left" visible="true" width="250">
</Column>
<Column autoExpand="false" dataType="String" editable="true" editorType="StringText" field="name" fixedHeader="false" id="name" imageOnly="false" langDir="leaveapply" nullAble="true" renderType="DefaultRender" showCheckBox="true" sortable="true" sumCol="false" text="名称" textAlign="left" visible="false" width="120">
</Column>
<Column autoExpand="false" dataType="Integer" editable="true" editorType="ComboBox" field="approve_state" fixedHeader="false" id="approve_state" imageOnly="false" langDir="leaveapply" nullAble="true" refComboData="combo_leaveapply_approve_state" renderType="ComboRender" showCheckBox="true" sortable="true" sumCol="false" text="审批状态" textAlign="left" visible="true" width="250">
</Column>
<Column autoExpand="false" dataType="String" editable="true" editorType="StringText" field="pk_billtype" fixedHeader="false" id="pk_billtype" imageOnly="false" langDir="leaveapply" nullAble="true" renderType="DefaultRender" showCheckBox="true" sortable="true" sumCol="false" text="单据状态" textAlign="left" visible="false" width="120">
</Column>
<Column autoExpand="false" dataType="String" editable="true" editorType="StringText" field="transtypeid" fixedHeader="false" id="transtypeid" imageOnly="false" langDir="leaveapply" nullAble="true" renderType="DefaultRender" showCheckBox="true" sortable="true" sumCol="false" text="流程类型id" textAlign="left" visible="false" width="120">
</Column>
<Column autoExpand="false" dataType="String" editable="true" editorType="Reference" field="transtypeid_name" fixedHeader="false" id="transtypeid_name" imageOnly="false" langDir="leaveapply" nullAble="true" refNode="refnode_leaveapply_transtypeid_name" renderType="DefaultRender" showCheckBox="true" sortable="true" sumCol="false" text="流程类型id" textAlign="left" visible="false" width="120">
</Column>
<Column autoExpand="false" dataType="String" editable="true" editorType="StringText" field="transtype" fixedHeader="false" id="transtype" imageOnly="false" langDir="leaveapply" nullAble="true" renderType="DefaultRender" showCheckBox="true" sortable="true" sumCol="false" text="流程类型" textAlign="left" visible="false" width="120">
</Column>
<Column autoExpand="false" dataType="String" editable="true" editorType="StringText" field="pk_psndoc" fixedHeader="false" id="pk_psndoc" imageOnly="false" langDir="leaveapply" nullAble="true" renderType="DefaultRender" showCheckBox="true" sortable="true" sumCol="false" text="人员主键" textAlign="left" visible="false" width="120">
</Column>
<Column autoExpand="false" dataType="String" editable="true" editorType="StringText" field="pk_psnjob" fixedHeader="false" id="pk_psnjob" imageOnly="false" langDir="leaveapply" nullAble="true" renderType="DefaultRender" showCheckBox="true" sortable="true" sumCol="false" text="人员工作主键" textAlign="left" visible="false" width="120">
</Column>
<Column autoExpand="false" dataType="String" editable="true" editorType="Reference" field="psncode" fixedHeader="false" id="psncode" imageOnly="false" nullAble="true" refNode="refnode_leaveapply_psncode" renderType="DefaultRender" showCheckBox="true" sortable="false" sumCol="false" text="人员编码" textAlign="left" visible="false" width="120">
</Column>
<Column autoExpand="false" dataType="String" editable="true" editorType="StringText" field="psnname" fixedHeader="false" id="psnname" imageOnly="false" langDir="leaveapply" nullAble="true" renderType="DefaultRender" showCheckBox="true" sortable="true" sumCol="false" text="姓名" textAlign="left" visible="false" width="120">
</Column>
<Column autoExpand="false" dataType="String" editable="true" editorType="StringText" field="psnorg" fixedHeader="false" id="psnorg" imageOnly="false" langDir="leaveapply" nullAble="true" renderType="DefaultRender" showCheckBox="true" sortable="true" sumCol="false" text="组织" textAlign="left" visible="false" width="120">
</Column>
<Column autoExpand="false" dataType="String" editable="true" editorType="StringText" field="psndept" fixedHeader="false" id="psndept" imageOnly="false" langDir="leaveapply" nullAble="true" renderType="DefaultRender" showCheckBox="true" sortable="true" sumCol="false" text="部门" textAlign="left" visible="false" width="120">
</Column>
<Column autoExpand="false" dataType="String" editable="true" editorType="StringText" field="psnpost" fixedHeader="false" id="psnpost" imageOnly="false" langDir="leaveapply" nullAble="true" renderType="DefaultRender" showCheckBox="true" sortable="true" sumCol="false" text="岗位" textAlign="left" visible="false" width="120">
</Column>
<Column autoExpand="false" dataType="String" editable="true" editorType="StringText" field="psnrank" fixedHeader="false" id="psnrank" imageOnly="false" langDir="leaveapply" nullAble="true" renderType="DefaultRender" showCheckBox="true" sortable="true" sumCol="false" text="职级" textAlign="left" visible="false" width="120">
</Column>
<Column autoExpand="false" dataType="String" editable="true" editorType="StringText" field="billmaker" fixedHeader="false" id="billmaker" imageOnly="false" langDir="leaveapply" nullAble="true" renderType="DefaultRender" showCheckBox="true" sortable="true" sumCol="false" text="申请人" textAlign="left" visible="false" width="120">
</Column>
<Column autoExpand="false" dataType="String" editable="true" editorType="Reference" field="billmaker_user_name" fixedHeader="false" id="billmaker_user_name" imageOnly="false" nullAble="true" refNode="refnode_leaveapply_billmaker_user_name" renderType="DefaultRender" showCheckBox="true" sortable="true" sumCol="false" text="申请人" textAlign="left" visible="false" width="120">
</Column>
<Column autoExpand="false" dataType="UFLiteralDate" editable="true" editorType="DateText" field="apply_date" fixedHeader="false" id="apply_date" imageOnly="false" langDir="leaveapply" nullAble="true" renderType="DefaultRender" showCheckBox="true" sortable="true" sumCol="false" text="申请日期" textAlign="left" visible="true" width="250">
</Column>
<Column autoExpand="false" dataType="String" editable="true" editorType="DateTimeText" field="approver" fixedHeader="false" id="approver" imageOnly="false" langDir="leaveapply" nullAble="true" renderType="DefaultRender" showCheckBox="true" sortable="true" sumCol="false" text="审批人" textAlign="left" visible="false" width="120">
</Column>
<Column autoExpand="false" dataType="String" editable="true" editorType="Reference" field="approver_user_name" fixedHeader="false" id="approver_user_name" imageOnly="false" nullAble="true" refNode="refnode_leaveapply_approver_user_name" renderType="DefaultRender" showCheckBox="true" sortable="true" sumCol="false" text="审批人" textAlign="left" visible="false" width="120">
</Column>
<Column autoExpand="false" dataType="String" editable="true" editorType="StringText" field="approver_note" fixedHeader="false" id="approver_note" imageOnly="false" langDir="leaveapply" nullAble="true" renderType="DefaultRender" showCheckBox="true" sortable="true" sumCol="false" text="审批意见" textAlign="left" visible="false" width="120">
</Column>
<Column autoExpand="false" dataType="UFLiteralDate" editable="true" editorType="DateTimeText" field="approver_time" fixedHeader="false" id="approver_time" imageOnly="false" langDir="leaveapply" nullAble="true" renderType="DateTimeRender" showCheckBox="true" sortable="true" sumCol="false" text="审批时间" textAlign="left" visible="true" width="250">
</Column>
<Column autoExpand="false" dataType="String" editable="true" editorType="StringText" field="creator" fixedHeader="false" id="creator" imageOnly="false" langDir="leaveapply" nullAble="true" renderType="DefaultRender" showCheckBox="true" sortable="true" sumCol="false" text="创建人" textAlign="left" visible="false" width="120">
</Column>
<Column autoExpand="false" dataType="String" editable="true" editorType="Reference" field="creator_user_name" fixedHeader="false" id="creator_user_name" imageOnly="false" nullAble="true" refNode="refnode_leaveapply_creator_user_name" renderType="DefaultRender" showCheckBox="true" sortable="true" sumCol="false" text="创建人" textAlign="left" visible="false" width="120">
</Column>
<Column autoExpand="false" dataType="UFDateTime" editable="true" editorType="DateTimeText" field="creationtime" fixedHeader="false" id="creationtime" imageOnly="false" langDir="leaveapply" nullAble="true" renderType="DateTimeRender" showCheckBox="true" sortable="true" sumCol="false" text="创建时间" textAlign="left" visible="false" width="120">
</Column>
<Column autoExpand="false" dataType="String" editable="true" editorType="StringText" field="modifier" fixedHeader="false" id="modifier" imageOnly="false" langDir="leaveapply" nullAble="true" renderType="DefaultRender" showCheckBox="true" sortable="true" sumCol="false" text="最后修改人" textAlign="left" visible="false" width="120">
</Column>
<Column autoExpand="false" dataType="String" editable="true" editorType="Reference" field="modifier_user_name" fixedHeader="false" id="modifier_user_name" imageOnly="false" nullAble="true" refNode="refnode_leaveapply_modifier_user_name" renderType="DefaultRender" showCheckBox="true" sortable="true" sumCol="false" text="最后修改人" textAlign="left" visible="false" width="120">
</Column>
<Column autoExpand="false" dataType="UFDateTime" editable="true" editorType="DateTimeText" field="modifiedtime" fixedHeader="false" id="modifiedtime" imageOnly="false" langDir="leaveapply" nullAble="true" renderType="DateTimeRender" showCheckBox="true" sortable="true" sumCol="false" text="最后修改时间" textAlign="left" visible="false" width="120">
</Column>
<Column autoExpand="false" dataType="String" editable="true" editorType="StringText" field="vmemo" fixedHeader="false" id="vmemo" imageOnly="false" langDir="leaveapply" nullAble="true" renderType="DefaultRender" showCheckBox="true" sortable="true" sumCol="false" text="备注" textAlign="left" visible="false" width="120">
</Column>
</GridComp>
<TextComp editorType="StringText" enabled="true" focus="false" i18nName="" id="check_it_now" langDir="" text="" textAlign="left" visible="true">
</TextComp>
<ButtonComp i18nName="" langDir="" enabled="true" id="select_confirm" text="查询" visible="true">
<Events>
<Event async="true" jsEventClaszz="nc.uap.lfw.core.event.conf.MouseListener" methodName="onselect1" name="onclick" onserver="true">
<SubmitRule cardSubmit="false" panelSubmit="false" tabSubmit="false">
</SubmitRule>
<Params>
<Param>
<Name>mouseEvent</Name>
<Value>
</Value>
<Desc> <![CDATA[nc.uap.lfw.core.event.MouseEvent]]>
</Desc>
</Param>
</Params>
<Action>
</Action>
</Event>
</Events>
</ButtonComp>
<ComBoBoxComp i18nName="" langDir="" allowExtendValue="false" editorType="ComboBox" enabled="true" focus="false" id="check_it_two" refComboData="combo_leaveapply_approve_state" selectOnly="true" text="" textAlign="left" visible="true">
344 </ComBoBoxComp>
345 <ButtonComp i18nName="" langDir="" enabled="true" id="select_confirm_two" text="查询" visible="true">
346 <Events>
347 <Event async="true" jsEventClaszz="nc.uap.lfw.core.event.conf.MouseListener" methodName="onselect2" name="onclick" onserver="true">
348 <SubmitRule cardSubmit="false" panelSubmit="false" tabSubmit="false">
349 </SubmitRule>
350 <Params>
351 <Param>
352 <Name>mouseEvent</Name>
353 <Value>
354 </Value>
355 <Desc> <![CDATA[nc.uap.lfw.core.event.MouseEvent]]>
356 </Desc>
357 </Param>
358 </Params>
359 <Action>
360 </Action>
361 </Event>
362 </Events>
363 </ButtonComp>
364 <TextComp editorType="DateText" enabled="true" focus="false" i18nName="" id="check_it_three" langDir="" text="" textAlign="left" visible="true">
365 </TextComp>
366 <ButtonComp i18nName="" langDir="" enabled="true" id="select_confirm_three" text="查询" visible="true">
367 <Events>
368 <Event async="true" jsEventClaszz="nc.uap.lfw.core.event.conf.MouseListener" methodName="onselect3" name="onclick" onserver="true">
369 <SubmitRule cardSubmit="false" panelSubmit="false" tabSubmit="false">
370 </SubmitRule>
371 <Params>
372 <Param>
373 <Name>mouseEvent</Name>
374 <Value>
375 </Value>
376 <Desc> <![CDATA[nc.uap.lfw.core.event.MouseEvent]]>
377 </Desc>
378 </Param>
379 </Params>
380 <Action>
381 </Action>
382 </Event>
383 </Events>
384 </ButtonComp>
385 <LabelComp i18nName="" langDir="" enabled="true" id="lable" text="麻烦输入编码查询" visible="true" >
386 </LabelComp>
387 <LabelComp i18nName="" langDir="" enabled="true" id="lable1" text="输入审批状态查询" visible="true">
388 </LabelComp>
389 <LabelComp i18nName="" langDir="" enabled="true" id="lable2" text="按照申请日期查询" visible="true">
390 </LabelComp>

</Components>
<Menus>
<MenuBarComp id="menu_list">
<MenuItem id="list_add" modifiers="2" showModel="1" stateManager="nc.uap.lfw.core.bm.dft.Init_Ss_Ms_StateManager" text="新增">
<Events>
<Event async="true" methodName="onAdd" name="onclick" onserver="true">
<Action>
</Action>
</Event>
</Events>
</MenuItem>
<!--<MenuItem id="edit" modifiers="2" showModel="1" stateManager="nc.bs.hrss.hi.leave.LeaveStateManager" text="修改">
<Events>
<Event async="true" methodName="onEdit" name="onclick" onserver="true">
<Action>
</Action>
</Event>
</Events>
</MenuItem>-->
<MenuItem id="list_delete" modifiers="2" showModel="1" stateManager="nc.bs.hrss.hi.leave.LeaveStateManager" text="删除">
<Events>
<Event async="true" methodName="onDelete" name="onclick" onserver="true">
<SubmitRule>
<Widget id="main">
</Widget>
</SubmitRule>
<Action>
</Action>
</Event>
</Events>
</MenuItem>
<MenuItem id="sep1" modifiers="2" sep="true" showModel="1">
</MenuItem>
<MenuItem id="list_submit" modifiers="2" showModel="1" stateManager="nc.bs.hrss.hi.leave.LeaveStateManager" text="提交">
<Events>
<Event async="true" methodName="onSubmit" name="onclick" onserver="true">
<Action>
</Action>
</Event>
</Events>
</MenuItem>
<MenuItem id="list_callback" modifiers="2" showModel="1" stateManager="nc.bs.hrss.hi.leave.LeaveStateManager" text="收回">
<Events>
<Event async="true" methodName="onBack" name="onclick" onserver="true">
<Action>
</Action>
</Event>
</Events>
</MenuItem>
<MenuItem id="list_apporvestate" modifiers="2" showModel="1" stateManager="nc.uap.lfw.core.bm.dft.Ss_StateManager" text="查看流程">
<Events>
<Event async="true" methodName="onFlow" name="onclick" onserver="true">
<Action>
</Action>
</Event>
</Events>
</MenuItem>
<MenuItem id="sep2" modifiers="2" sep="true" showModel="1">
</MenuItem>
<MenuItem id="attachfile" modifiers="2" showModel="1" stateManager="nc.uap.lfw.core.bm.dft.Ss_StateManager" text="附件管理">
<Events>
<Event async="true" methodName="onAttchFile" name="onclick" onserver="true">
<Action>
</Action>
</Event>
</Events>
</MenuItem> <!-- shaochj begin -->
<MenuItem id="m_" modifiers="3" sep="true" text="m_">
</MenuItem>
<MenuItem id="copysend" i18nName="" langDir="" modifiers="2" stateManager="" text="设置抄送人">
<Events>
<Event async="true" jsEventClaszz="nc.uap.lfw.core.event.conf.MouseListener" methodName="setCopySend" name="onclick"
onserver="true">
<SubmitRule cardSubmit="false" panelSubmit="false" tabSubmit="false">
</SubmitRule>
<Params>
<Param>
<Name>mouseEvent</Name>
<Value>
</Value>
<Desc> <![CDATA[nc.uap.lfw.core.event.MouseEvent]]> </Desc>
</Param>
</Params>
<Action>
</Action>
</Event>
</Events>
</MenuItem>
<!-- shaochj end -->
<MenuItem id="m_" modifiers="3" sep="true" text="m_">
</MenuItem>
<MenuItem i18nName="" langDir="node_ta-res" id="onCopysend" modifiers="2" text="抄送" visible="true" enabled="false">
<Events>
<Event async="true" jsEventClaszz="nc.uap.lfw.core.event.conf.MouseListener" methodName="selectCopysend" name="onclick" onserver="true">
<SubmitRule cardSubmit="false" panelSubmit="false" tabSubmit="false">
<Dataset id="hi_stapply">
</Dataset>
</SubmitRule>
<Params>
<Param>
<Name>mouseEvent</Name>
<Value>
</Value>
<Desc> <![CDATA[]]>
</Desc>
</Param>
</Params>
<Action>
</Action>
</Event>
</Events>
</MenuItem>
<MenuItem i18nName="" langDir="" id="tableAttach" modifiers="2" text="操作指引/表格模板" visible="true" enabled="true">
<Events>
<Event async="true" jsEventClaszz="nc.uap.lfw.core.event.conf.MouseListener" methodName="addTableAttachment" name="onclick" onserver="true">
<SubmitRule cardSubmit="false" panelSubmit="false" tabSubmit="false">
<Dataset id="hi_stapply">
</Dataset>
</SubmitRule>
<Params>
<Param>
<Name>mouseEvent</Name>
<Value>
</Value>
<Desc> <![CDATA[]]>
</Desc>
</Param>
</Params>
<Action>
</Action>
</Event>
</Events>
</MenuItem> <MenuItem id="m_" modifiers="3" sep="true" text="m_">
</MenuItem>
<MenuItem id="export" modifiers="2" stateManager="nc.bs.hrss.ta.common.dft.Init_StateManager" text="导出pdf文档">
<Events>
<Event async="true" methodName="exportPDF" name="onclick" onserver="true">
<SubmitRule cardSubmit="false" panelSubmit="false" tabSubmit="false">
<Dataset id="entryapply">
</Dataset>
</SubmitRule>
<Params>
<Param>
<Name>mouseEvent</Name>
<Value>
</Value>
<Desc> <![CDATA[nc.uap.lfw.core.event.MouseEvent]]>
</Desc>
</Param>
</Params>
<Action>
</Action>
</Event>
</Events>
</MenuItem>
<!-- shaochj end -->
</MenuBarComp>
</Menus>
</Widget>
 package nc.bs.hrss.hi.leave;

 import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Map; import nc.bs.framework.common.NCLocator;
import nc.bs.hrss.hi.setcopysend.QueryCopySendVOUtil;
import nc.bs.hrss.pub.HrssConsts;
import nc.bs.hrss.pub.action.HrssPrintAction;
import nc.bs.hrss.pub.action.HrssPrintMDDataSource;
import nc.bs.hrss.pub.cmd.PFApproveInfoCmd;
import nc.bs.hrss.pub.cmd.PFCommitCmd;
import nc.bs.hrss.pub.cmd.PFDeleteCmd;
import nc.bs.hrss.pub.cmd.PFReCallCmd;
import nc.bs.hrss.pub.tool.CommonUtil;
import nc.bs.hrss.pub.tool.DatasetUtil;
import nc.bs.hrss.pub.tool.SessionUtil;
import nc.bs.hrss.pub.tool.ViewUtil;
import nc.bs.hrss.trn.PrintCodeForPortal;
import nc.bs.hrss.trn.TrnUtil;
import nc.bs.hrss.trn.pub.CirculateConsts;
import nc.bs.logging.Logger;
import nc.hr.frame.persistence.SimpleDocServiceTemplate;
import nc.itf.hrss.hi.leave.ILeaveApplyManagerService;
import nc.itf.hrss.hi.leave.ILeaveApplyQueryMaintain;
import nc.itf.uap.pf.IPFConfig;
import nc.uap.lfw.core.AppInteractionUtil;
import nc.uap.lfw.core.AppSession;
import nc.uap.lfw.core.LfwRuntimeEnvironment;
import nc.uap.lfw.core.cmd.CmdInvoker;
import nc.uap.lfw.core.cmd.UifDatasetAfterSelectCmd;
import nc.uap.lfw.core.comp.MenuItem;
import nc.uap.lfw.core.comp.MenubarComp;
import nc.uap.lfw.core.comp.WebElement;
import nc.uap.lfw.core.comp.text.ComboBoxComp;
import nc.uap.lfw.core.comp.text.TextComp;
import nc.uap.lfw.core.constants.AppConsts;
import nc.uap.lfw.core.ctx.AppLifeCycleContext;
import nc.uap.lfw.core.ctx.ApplicationContext;
import nc.uap.lfw.core.ctx.OpenProperties;
import nc.uap.lfw.core.ctx.WindowContext;
import nc.uap.lfw.core.data.Dataset;
import nc.uap.lfw.core.data.Row;
import nc.uap.lfw.core.event.DataLoadEvent;
import nc.uap.lfw.core.event.DatasetEvent;
import nc.uap.lfw.core.event.DialogEvent;
import nc.uap.lfw.core.event.MouseEvent;
import nc.uap.lfw.core.event.ScriptEvent;
import nc.uap.lfw.core.exception.LfwRuntimeException;
import nc.uap.lfw.core.model.plug.TranslatedRow;
import nc.uap.lfw.core.page.LfwView;
import nc.uap.lfw.core.serializer.impl.Dataset2SuperVOSerializer;
import nc.uap.lfw.core.serializer.impl.SuperVO2DatasetSerializer;
import nc.uap.wfm.constant.WfmConstants;
import nc.vo.hrss.hi.leave.AggLeaveApplyVO;
import nc.vo.hrss.hi.leave.LeaveApplyVO;
import nc.vo.hrss.hi.leave.LeaveEnum;
import nc.vo.ml.NCLangRes4VoTransl;
import nc.vo.pub.AggregatedValueObject;
import nc.vo.pub.BusinessException;
import nc.vo.pub.SuperVO;
import nc.vo.pub.pf.IPfRetCheckInfo; import org.apache.commons.lang.StringUtils; import uap.lfw.core.itf.ctrl.AbstractMasterSlaveViewController;
import uap.web.bd.pub.AppUtil; /**
* 信息列表默认逻辑
*
*/
public class LeaveApplyListWinMainViewCtrl<T extends WebElement> extends
AbstractMasterSlaveViewController { private static final String OPEN_WIDTH = "1100";
private static final String OPEN_Height = "800";
private static final String MAIN_VIEW_ID = "main";
private static final String CARD_WIN_ID = "LeaveApplyCard";
private static final String CARD_WIN_TITLE = "休假申请"; private static ILeaveApplyManagerService iLeaveApplyManagerService = NCLocator
.getInstance().lookup(ILeaveApplyManagerService.class);
private static ILeaveApplyQueryMaintain iLeaveApplyQueryMaintain = NCLocator
.getInstance().lookup(ILeaveApplyQueryMaintain.class);
/**
* onselect1点击按照“申请单编码查询”
*/ public void onselect1(MouseEvent<MenuItem> mouseEvent){
//获取相应的TextComp的值的方法
TextComp checkComp = (TextComp) ViewUtil.getCurrentView().getViewComponents().getComponent("check_it_now");
//对获取到的checkComp获取对象的value
//String checkname=checkComp.getValue();
String checkname = checkComp.getValue()==null?"":checkComp.getValue();
//调用queryVOs2包中的方法查询到相应的数据
SuperVO[] vos = queryVOs2(checkname);
//获取页面元素的util类
LfwView viewMain = ViewUtil.getCurrentView();
//获取对应的VO。这个应该是实体表的表名“leaveapply”,在配置文件中可以找到,要一一对应哦!
Dataset ds = viewMain.getViewModels().getDataset("leaveapply");
if (ds == null) {
return;
}
//序列化
new SuperVO2DatasetSerializer().serialize(vos, ds, Row.STATE_NORMAL);
}
/**
111 *
112 * @param 点击按照审批状态查询
113 */
114 public void onselect2(MouseEvent<MenuItem> mouseEvent)
{
ComboBoxComp billtypenameComp = (ComboBoxComp) ViewUtil.getCurrentView().getViewComponents().getComponent("check_it_two");
String checkname = billtypenameComp.getValue()==null?"":billtypenameComp.getValue();
//String checkname=billtypenameComp.getValue();
System.out.println("___61252"+checkname); //调用queryVOs2包中的方法查询到相应的数据
SuperVO[] vos = queryVOs3(checkname);
//获取页面元素的util类
LfwView viewMain = ViewUtil.getCurrentView();
//获取对应的VO。这个应该是实体表的表名“leaveapply”,在配置文件中可以找到,要一一对应哦!
Dataset ds = viewMain.getViewModels().getDataset("leaveapply");
if (ds == null) {
return;
}
//序列化
new SuperVO2DatasetSerializer().serialize(vos, ds, Row.STATE_NORMAL);
}
/**
134 *
135 * @param 按照提交日期查询
136 */
137 public void onselect3(MouseEvent<MenuItem> mouseEvent){
//获取相应的TextComp的值的方法
TextComp checkComp = (TextComp) ViewUtil.getCurrentView().getViewComponents().getComponent("check_it_three");
//对获取到的checkComp获取对象的value
String checkname=checkComp.getValue()==null?"":checkComp.getValue();
//日期类型转化--获取到的String先转化为long,转化为long之后再转化为Date,转化为Date之后再转化为String
long l = Long.parseLong(checkname);
Date date = new Date(l);
SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
String checkname1=sdf.format(date)==null?"":sdf.format(date);
//调用queryVOs2包中的方法查询到相应的数据
SuperVO[] vos = queryVOs4(checkname1);
//获取页面元素的util类
LfwView viewMain = ViewUtil.getCurrentView();
//获取对应的VO。这个应该是实体表的表名“leaveapply”,在配置文件中可以找到,要一一对应哦!
Dataset ds = viewMain.getViewModels().getDataset("leaveapply");
if (ds == null) {
return;
}
//序列化
new SuperVO2DatasetSerializer().serialize(vos, ds, Row.STATE_NORMAL); } /**
* 重新刷新数据
*
* @param mouseEvent
*/
public void reloadData(ScriptEvent mouseEvent) {
LfwView view = ViewUtil.getCurrentView();
Dataset ds = ViewUtil.getDataset(view, getMasterDsId());
new SuperVO2DatasetSerializer().serialize(queryVOs(), ds, Row.STATE_NORMAL);
}
/**
* 页面显示事件
*
* @param dialogEvent
*/
public void onBeforeShow(DialogEvent dialogEvent) {
initData();
LfwView viewMain = AppLifeCycleContext.current().getViewContext().getView();
// add by shaochj@邵传军 Dec 12, 2014 begin
//根据用户pk查询角色pk,判断是否隐藏按钮
String pk_user = LfwRuntimeEnvironment.getLfwSessionBean().getPk_user();
QueryCopySendVOUtil.setVisisble(viewMain, pk_user);
// add by shaochj@邵传军 Dec 12, 2014 end } /**
* 主数据加载逻辑
*
* @param dataLoadEvent
*/
public void onDataLoad(DataLoadEvent dataLoadEvent) {
initData();
} /**
* 主数据选中逻辑
*
* @param datasetEvent
*/
public void onAfterRowSelect(DatasetEvent datasetEvent) {
Dataset ds = datasetEvent.getSource();
CmdInvoker.invoke(new UifDatasetAfterSelectCmd(ds.getId()));
Row row = ds.getSelectedRow();
if(row!=null){
Integer approve_state = (Integer) row.getValue(ds.nameToIndex("approve_state"));
MenubarComp comp = (MenubarComp) ViewUtil.getCurrentView().getViewMenus().getMenuBar("menu_list");
if(comp!=null){
MenuItem item = comp.getElementById("onCopysend");
if(item!=null){
if(approve_state==-1){
item.setEnabled(false);
}else{
item.setEnabled(true);
}
}
}
}
} /**
*
* @author zhangxl@张晓亮 【碧桂园项目】
* @date Nov 28, 2014
* 方法功能描述:新增
* @param mouseEvent
*/
public void onAdd(MouseEvent<?> mouseEvent) {
OpenProperties props = new OpenProperties(CARD_WIN_ID, CARD_WIN_TITLE);
props.setButtonZone(false); Map<String, String> paramMap = new HashMap<String, String>(2);
paramMap.put(AppConsts.OPE_SIGN, AppConsts.OPE_ADD);
props.setParamMap(paramMap);
props.setWidth(OPEN_WIDTH);
props.setHeight(OPEN_Height);
this.getCurrentAppCtx().navgateTo(props);
} /**
*
* @author zhangxl@张晓亮 【碧桂园项目】
* @date Nov 28, 2014
* 方法功能描述:编辑
* @param mouseEvent
*/
public void onEdit(MouseEvent<?> mouseEvent) {
Dataset ds = this.getMasterDs();
if (ds.getSelectedIndex() < 0) {
throw new LfwRuntimeException("请选中待编辑数据");
}
Row row = ds.getSelectedRow();
String pkValue = (String) row.getValue(ds.nameToIndex(ds
.getPrimaryKeyField()));
OpenProperties props = new OpenProperties(CARD_WIN_ID, CARD_WIN_TITLE);
props.setButtonZone(false);
Map<String, String> paramMap = new HashMap<String, String>(2);
paramMap.put(AppConsts.OPE_SIGN, AppConsts.OPE_EDIT);
paramMap.put(AppConsts.OPEN_BILL_ID, pkValue);
paramMap.put(WfmConstants.WfmUrlConst_billID, pkValue);
props.setParamMap(paramMap);
props.setWidth(OPEN_WIDTH);
props.setHeight(OPEN_Height);
this.getCurrentAppCtx().navgateTo(props);
} /**
*
* @author zhangxl@张晓亮 【碧桂园项目】
* @date Nov 28, 2014
* 方法功能描述:查看
// * @param scriptEvent
*/
public void showDetail(ScriptEvent scriptEvent) {
String pkValue = AppLifeCycleContext.current().getParameter("dsMain_primaryKey");
String approve_state = AppLifeCycleContext.current().getParameter("approve_state");
OpenProperties props = new OpenProperties(CARD_WIN_ID, CARD_WIN_TITLE);
props.setButtonZone(false);
Map<String, String> paramMap = new HashMap<String, String>(2);
if ("-1".equals(approve_state)) {
paramMap.put(AppConsts.OPE_SIGN, AppConsts.OPE_EDIT);
}else{
paramMap.put(AppConsts.OPE_SIGN, LeaveConst.OPE_VIEW);
}
paramMap.put(AppConsts.OPEN_BILL_ID, pkValue);
paramMap.put(WfmConstants.WfmUrlConst_billID, pkValue);
props.setParamMap(paramMap);
props.setWidth(OPEN_WIDTH);
props.setHeight(OPEN_Height);
AppLifeCycleContext.current().getViewContext().navgateTo(props); // CommonUtil.showWindowDialog(CARD_WIN_ID, CARD_WIN_TITLE, OPEN_WIDTH, OPEN_Height, paramMap, ApplicationContext.TYPE_DIALOG, false, false); } /**
*
* @author zhangxl@张晓亮 【碧桂园项目】
* @date Nov 28, 2014
* 方法功能描述:删除
* @param mouseEvent
*/
public void onDelete(MouseEvent<?> mouseEvent) {
Dataset ds = this.getMasterDs();
if (ds.getSelectedIndex() < 0) {
throw new LfwRuntimeException("请选中待删除数据");
}
Row row = ds.getSelectedRow();
Boolean resultBoolean = AppInteractionUtil.showConfirmDialog("删除","是否确定删除"); // 弹出确认提示
if(resultBoolean == Boolean.FALSE) return ;
String pk_form = (String) row.getValue(ds.nameToIndex(ds
.getPrimaryKeyField()));
Integer approve_state = (Integer) row.getValue(ds.nameToIndex(LeaveApplyVO.APPROVE_STATE));
if (-1 != approve_state) {
throw new LfwRuntimeException("流程已启动,无法删除单据");
}
CmdInvoker.invoke(new PFDeleteCmd(getMasterDsId(),AggLeaveApplyVO.class));
} /**
*
* @author zhangxl@张晓亮 【碧桂园项目】
* @date Nov 28, 2014
* 方法功能描述:提交
* @param mouseEvent
*/
public void onSubmit(MouseEvent<MenuItem> mouseEvent) {
LfwView view = ViewUtil.getCurrentView();
Dataset ds = ViewUtil.getDataset(view, getMasterDsId());
Row selRow = ds.getSelectedRow();
if (selRow == null) {
CommonUtil.showErrorDialog(
nc.vo.ml.NCLangRes4VoTransl.getNCLangRes().getStrByID(
"c_hi-res", "0c_hi-res0017")/*
* @ res "提示信息"
*/,
nc.vo.ml.NCLangRes4VoTransl.getNCLangRes().getStrByID(
"c_pub-res", "0c_pub-res0186")/*
* @ res "请选择待提交的记录!"
*/);
}
/*String primaryField = DatasetUtil.getPrimaryField(ds).getId();
String primarykey = selRow.getString(ds.nameToIndex(primaryField));
if(StringUtils.isEmpty(primarykey)){
return;
}
IFileSystemService service = NCLocator.getInstance().lookup(IFileSystemService.class);
try {
NCFileNode node=service.queryNCFileNodeTree(primarykey);
if (node == null) {
CommonUtil.showErrorDialog("请维护附件");
return;
}
} catch (BusinessException e) {
throw new LfwRuntimeException(e.getMessage());
}*/ CmdInvoker.invoke(new PFCommitCmd(getMasterDsId(), null,
AggLeaveApplyVO.class));
} /**
*
* @author zhangxl@张晓亮 【碧桂园项目】
* @date Nov 28, 2014
* 方法功能描述:收回
* @param mouseEvent
*/
public void onBack(MouseEvent<MenuItem> mouseEvent) {
PFReCallCmd reCallCmd = new PFReCallCmd(getMasterDsId(), null,
AggLeaveApplyVO.class);
CmdInvoker.invoke(reCallCmd);
} /**
*
* @author zhangxl@张晓亮 【碧桂园项目】
* @date Nov 28, 2014
* 方法功能描述:查看审批流
* @param mouseEvent
*/
public void onFlow(MouseEvent<MenuItem> mouseEvent) {
PFApproveInfoCmd approveInfoCmd = new PFApproveInfoCmd(getMasterDsId(),
AggLeaveApplyVO.class);
CmdInvoker.invoke(approveInfoCmd);
} /**
*
* @author zhangxl@张晓亮 【碧桂园项目】
* @date Nov 28, 2014
* 方法功能描述:附件管理
* @param mouseEvent
*/
public void onAttchFile(MouseEvent<MenuItem> mouseEvent) {
LfwView view =ViewUtil.getCurrentView();
Dataset ds = ViewUtil.getDataset(view, getMasterDsId());
Row row = ds.getSelectedRow();
if (row == null) {
CommonUtil.showErrorDialog(
nc.vo.ml.NCLangRes4VoTransl.getNCLangRes().getStrByID(
"c_hi-res", "0c_hi-res0017")/*
* @ res "提示信息"
*/,
nc.vo.ml.NCLangRes4VoTransl.getNCLangRes().getStrByID(
"c_hi-res", "0c_trn-res0040")/*
* @ res
*/);
}
int approve_state = row.getInt(ds.nameToIndex(LeaveConst.APPROVE_STATE));
boolean isPower = false;
if (approve_state == IPfRetCheckInfo.NOSTATE)
isPower = true;
CommonUtil.Attachment(ds, isPower);
} @Override
protected String getMasterDsId() {
return "leaveapply";
} /**
*
* @author zhangxl@张晓亮 【碧桂园项目】
* @date Nov 28, 2014
* 方法功能描述:分类切换事件
* @param keys
*/
public void plugininParam(Map<String, Object> keys) {
if (keys == null || keys.size() == 0) {
return;
}
TranslatedRow row = (TranslatedRow) keys.get("appid");
if (row == null) {
return;
}
String pk_node = (String) row.getValue("pk_node");
if (StringUtils.isEmpty(pk_node)) {
return;
}
ApplicationContext appCtx = AppLifeCycleContext.current()
.getApplicationContext();
String nodecode = TrnUtil.getNodecodeByApp(pk_node);
String url = LfwRuntimeEnvironment.getRootPath() + "/app/" + pk_node
+ "?nodecode=" + nodecode;
appCtx.sendRedirect(url, nodecode);
} /**
*
* @author zhangxl@张晓亮 【碧桂园项目】
* @date Nov 28, 2014
* 方法功能描述:关闭弹出页面后的再查询操作
* @param keys
*/
public void pluginReSearch(Map<String, Object> keys) {
LfwView view = ViewUtil.getCurrentView();
Dataset ds = ViewUtil.getDataset(view, getMasterDsId());
new SuperVO2DatasetSerializer().serialize(queryVOs(), ds, Row.STATE_NORMAL);
} /**
*
* @author zhangxl@张晓亮 【碧桂园项目】
* @date Dec 2, 2014
* 方法功能描述:页面初始化
*/
public void initData(){
LfwView view = ViewUtil.getCurrentView();
if (view == null) {
return;
}
Dataset ds = ViewUtil.getDataset(view, getMasterDsId());
if (ds == null) {
return;
}
DatasetUtil.clearData(ds);
SuperVO[] vos = queryVOs();
new SuperVO2DatasetSerializer().serialize(vos, ds, Row.STATE_NORMAL);
}
/**
483 * 按照编码查询by曾志伟
484 *
485 * */
486 protected SuperVO[] queryVOs2(String checkname){
//StringBuffer拼接数据库语句
StringBuffer whereSQL=new StringBuffer();
//拼接你传进来值
if(checkname=="")
{
String billmaker = LfwRuntimeEnvironment.getLfwSessionBean().getPk_user();
whereSQL.append(" billmaker = '" + billmaker + "'");
String pageId = getPageId();
if (LeaveConst.LEAVEAPPLY.equals(pageId)) {
whereSQL.append(" and nodetype = "+LeaveEnum.TYPE_STAFF );
}else if(LeaveConst.SPECIALLEAVEAPPLY.equals(pageId)){
whereSQL.append(" and nodetype = "+LeaveEnum.TYPE_SPECIAL );
}
whereSQL.append(" order by creationtime desc"); }
else{ whereSQL.append("bill_code='"+checkname+"'");
String id=SessionUtil.getPk_psndoc();
whereSQL.append("and pk_psndoc='"+id+"'");
} //实体对应的VO。我的理解相当于javabean
LeaveApplyVO[] hvos=null;
try{
//调用接口相应的查询方法---超哥跟我说过/要写接口,同时也要写实现类,接口是写在public中,
//实现类是写在private中,最后在/NC_HR_WEB6.3_150915/mw/META-INF中创建**.upm文件配置
hvos = iLeaveApplyQueryMaintain.queryLeaveApplyVOByCondition(whereSQL.toString()); }catch(BusinessException e){
Logger.error(e.getMessage(),e);
} return hvos;
}
/**
526 * 按照状态by曾志伟
527 *
528 * */
529 protected SuperVO[] queryVOs3(String checkname){
//StringBuffer拼接数据库语句
StringBuffer whereSQL=new StringBuffer(); if(checkname=="")
{
String billmaker = LfwRuntimeEnvironment.getLfwSessionBean().getPk_user();
whereSQL.append(" billmaker = '" + billmaker + "'");
String pageId = getPageId();
if (LeaveConst.LEAVEAPPLY.equals(pageId)) {
whereSQL.append(" and nodetype = "+LeaveEnum.TYPE_STAFF );
}else if(LeaveConst.SPECIALLEAVEAPPLY.equals(pageId)){
whereSQL.append(" and nodetype = "+LeaveEnum.TYPE_SPECIAL );
}
whereSQL.append(" order by creationtime desc"); }
else{
//拼接你传进来值
whereSQL.append("approve_state='"+checkname+"'");
//拼接唯一标识
String id=SessionUtil.getPk_psndoc();
whereSQL.append("and pk_psndoc='"+id+"'"); } //实体对应的VO。我的理解相当于javabean
LeaveApplyVO[] hvos=null;
try{
//调用接口相应的查询方法---超哥跟我说过/要写接口,同时也要写实现类,接口是写在public中,
//实现类是写在private中,最后在/NC_HR_WEB6.3_150915/mw/META-INF中创建**.upm文件配置
hvos = iLeaveApplyQueryMaintain.queryLeaveApplyVOByCondition(whereSQL.toString()); }catch(BusinessException e){
Logger.error(e.getMessage(),e);
} return hvos;
}
/**
571 * 按照日期by曾志伟
572 *
573 * */
574 protected SuperVO[] queryVOs4(String checkname1){
//StringBuffer拼接数据库语句
StringBuffer whereSQL=new StringBuffer();
//拼接你传进来值
whereSQL.append("apply_date='"+checkname1+"'");
//实体对应的VO。我的理解相当于javabean
LeaveApplyVO[] hvos=null;
try{
//调用接口相应的查询方法---超哥跟我说过/要写接口,同时也要写实现类,接口是写在public中,
//实现类是写在private中,最后在/NC_HR_WEB6.3_150915/mw/META-INF中创建**.upm文件配置
hvos = iLeaveApplyQueryMaintain.queryLeaveApplyVOByCondition(whereSQL.toString()); }catch(BusinessException e){
Logger.error(e.getMessage(),e);
} return hvos;
}
/**
*
* @author zhangxl@张晓亮 【碧桂园项目】
* @date Dec 2, 2014
* 方法功能描述:查询
* @return
*/
protected SuperVO[] queryVOs(){
String billmaker = LfwRuntimeEnvironment.getLfwSessionBean().getPk_user();
StringBuffer whereSQL = new StringBuffer();
whereSQL.append(" billmaker = '" + billmaker + "'");
String pageId = getPageId();
if (LeaveConst.LEAVEAPPLY.equals(pageId)) {
whereSQL.append(" and nodetype = "+LeaveEnum.TYPE_STAFF );
}else if(LeaveConst.SPECIALLEAVEAPPLY.equals(pageId)){
whereSQL.append(" and nodetype = "+LeaveEnum.TYPE_SPECIAL );
}
whereSQL.append(" order by creationtime desc");
LeaveApplyVO[] hvos = null ;
try {
hvos = iLeaveApplyQueryMaintain.queryLeaveApplyVOByCondition(whereSQL.toString());
} catch (BusinessException e) {
Logger.error(e.getMessage(), e);
}
return hvos;
} /**
*
* @author zhangxl@张晓亮 【碧桂园项目】
* @date Nov 30, 2014
* 方法功能描述:
* @return
*/
public String getPageId(){
AppSession session = SessionUtil.getAppSession();
return session.getPageId();
} /**
* @author shaochj@邵传军 【碧桂园项目】
* @date Dec 10, 2014
* 方法功能描述:设置抄送人按钮事件
*
* @param mouseEvent
*/
public void setCopySend( MouseEvent<MenuItem> mouseEvent){
WindowContext wc = AppLifeCycleContext.current().getWindowContext();
// add by wangchao@王超 Mar 19, 2015 【碧桂园项目】 begin
String pageId = getPageId();
if (LeaveConst.LEAVEAPPLY.equals(pageId)) {
wc.addAppAttribute("billTypeCode","6139");
}else if(LeaveConst.SPECIALLEAVEAPPLY.equals(pageId)){
wc.addAppAttribute("billTypeCode","6140");
}
// add by wangchao@王超 Mar 19, 2015 end
OpenProperties arg = new OpenProperties();
arg.setOpenId("setcopysend");
arg.setType(ApplicationContext.TYPE_WINDOW);
arg.setHeight("800");
arg.setWidth("800");
arg.setTitle("设置抄送人");
wc.popView(arg);
}
public void selectCopysend(MouseEvent<MenuItem> mouseEvent){
Dataset ds = ViewUtil.getCurrentView().getViewModels().getDataset("leaveapply");
Row row = ds.getSelectedRow();
if(row==null){
return;
}
String billType = (String) row.getValue(ds.nameToIndex("pk_billtype"));
String billPk = (String) row.getValue(ds.nameToIndex("pk_leave"));
ApplicationContext appCtx = AppLifeCycleContext.current().getApplicationContext();
// String billType = (String) AppUtil.getAppAttr(HrssConsts.BILL_TYPE_CODE);
// String billPk = (String) AppUtil.getAppAttr(WfmConstants.WfmAppAttr_BillID);
AggregatedValueObject aggVO = getBillVOByPk(billType, billPk);
appCtx.addAppAttribute("aggVO", aggVO);
appCtx.addAppAttribute("title", CirculateConsts.COPYSEND_NAME);
appCtx.addAppAttribute("votype", CirculateConsts.LEAVE_VO);
appCtx.addAppAttribute("msgrescode", CirculateConsts.SLEAVE_CODE);
CommonUtil.showViewDialog(CirculateConsts.CIRCULATE_SELECT_ID, CirculateConsts.COPYSEND_NAME, 400, 200);
//CmdInvoker.invoke(new UifOpenViewCmd(EntryApplyConsts.CIRCULATE_SELECT_ID, "400", "200", "选择传阅人"));
} /**
* 根据主键,查询VO
*
* @param primaryKey
* @return
*/
protected AggregatedValueObject getBillVOByPk(String billType, String billPk) {
if (StringUtils.isEmpty(billPk)) {
return null;
}
IPFConfig bsConfig = (IPFConfig) NCLocator.getInstance().lookup(IPFConfig.class.getName());
// 查询单据VO
AggregatedValueObject billVO = null;
try {
billVO = bsConfig.queryBillDataVO(billType, billPk);
} catch (BusinessException ex) {
Logger.error(ex.getMessage(), ex);
throw new LfwRuntimeException(NCLangRes4VoTransl.getNCLangRes().getStrByID("imp",
"CpMockBillTemplateController-000000")/*
* 查询元数据 出错 ,
*/
+ ex.getMessage());
} return billVO;
} /**
* 常用表格管理操作
*
* @param mouseEvent
*/
public void addTableAttachment(MouseEvent<MenuItem> mouseEvent) {
// add Jul 24, 2015 begin
//附件根据单据类型分类,用单据类型模拟单据主键
String primarykey = AppLifeCycleContext.current().getWindowContext().getApplicationContext().getAppId();
// add Jul 24, 2015 end
AppUtil.addAppAttr(HrssConsts.HRWEB_PRIMARY_KEY, primarykey);
CommonUtil.showWindowDialog(
"HrssTableFileManager",
nc.vo.ml.NCLangRes4VoTransl.getNCLangRes().getStrByID(
"c_pe-res", "0c_pe-res0023")/*
* @ res "文档管理"
*/, "750", "450", null,
null);
} /**
* 导出pdf文档:临时新增
* @throws Exception
*/
@SuppressWarnings({ "unused", "rawtypes" })
public void exportPDF(MouseEvent mouseEvent) throws Exception {
HrssPrintMDDataSource hds = new HrssPrintMDDataSource();
hds.setSingleData(true);
// String dsid = (String) ViewUtil.getCurrentView().getExtendAttributeValue(BillTemplateConst.MASTER_DS);
Dataset ds = ViewUtil.getCurrentView().getViewModels().getDataset("leaveapply"); Row row = ds.getSelectedRow();
SuperVO[] aggVO = new Dataset2SuperVOSerializer().serialize(ds, ds.getSelectedRow());
AggLeaveApplyVO agg = new SimpleDocServiceTemplate("").queryByPk(AggLeaveApplyVO.class, aggVO[0].getPrimaryKey());
//查询打印的数据
// SuperVO[]aggVO = queryVOs();
String func_code = "";
String key = "";
String pageId = getPageId();
if (LeaveConst.LEAVEAPPLY.equals(pageId)) {
func_code = PrintCodeForPortal.leaveapply_funcode;
key = PrintCodeForPortal.leaveapply_nodekey;
}else if(LeaveConst.SPECIALLEAVEAPPLY.equals(pageId)){
func_code = PrintCodeForPortal.specialleaveapply_funcode;
key = PrintCodeForPortal.specialleaveapply_nodekey;
}
hds.setMDObjects(new AggLeaveApplyVO[]{agg});
SessionUtil.setAttribute(HrssPrintAction.DATA_SOURCE, hds);
SessionUtil.setAttribute(HrssPrintAction.FUNC_CODE, func_code);
// SessionUtil.setAttribute(HrssPrintAction.NODE_KEY, "6009dimi"); String Url=LfwRuntimeEnvironment.getRootPath() + "/pt/downloadPDF/downloadExportPdf?strNodeKey="+key;
AppLifeCycleContext.current().getApplicationContext().addExecScript("window.location='" + Url + "';");
}
// add renyuepeng Sep 12, 2015 end
}