EAS界面数据关联

    xiaoxiao2025-11-16  3

    业务部门经常会提出这样的需求

    这种需求,需要扩展系统原有的编辑界面。

    相关代码如下:

    public class LCMConsumeBillEditUICTEx extends LCMConsumeBillEditUI { private static final Logger logger = CoreUIObject .getLogger(LCMConsumeBillEditUICTEx.class); /** */ private static final long serialVersionUID = 7518380057915589785L; /** * @throws Exception */ public LCMConsumeBillEditUICTEx() throws Exception { super(); } /** * @see com.kingdee.eas.fi.lcm.client.LCMConsumeBillEditUI#onLoad() */ @Override public void onLoad() throws Exception { super.onLoad(); prmtUsePerson.addDataChangeListener(new DataChangeListener() { public void dataChanged(DataChangeEvent e) { try { prmtUsePerson_dataChanged(e); } catch (Exception exc) { handUIException(exc); } } }); } public void prmtUsePerson_dataChanged(com.kingdee.bos.ctrl.swing.event.DataChangeEvent e) { PersonInfo personInfo = (PersonInfo) this.prmtUsePerson.getData(); if (null != personInfo) { AdminOrgUnitInfo useDepartment = getAdminOrgUnitInfoByPersonId(personInfo.getId() .toString()); if (useDepartment != null) this.prmtUseDepartment.setData(useDepartment); } } private AdminOrgUnitInfo getAdminOrgUnitInfoByPersonId(String personId) { if (null == personId) return null; PositionMemberInfo info = new PositionMemberInfo(); PositionInfo positionInfo = new PositionInfo(); AdminOrgUnitInfo adminOrgUnitInfo = null; try { PositionMemberCollection col = PositionMemberFactory.getRemoteInstance() .getPositionMemberCollection( "where isprimary=1 and person.state=0 and person.id='" + personId + "'"); if (col.size() > 0) { info = col.get(0); positionInfo = PositionFactory.getRemoteInstance().getPositionInfo( new ObjectUuidPK(info.getPosition().getId())); adminOrgUnitInfo = AdminOrgUnitFactory.getRemoteInstance().getAdminOrgUnitInfo( new ObjectUuidPK(positionInfo.getAdminOrgUnit().getId())); } } catch (EASBizException e) { logger.error("", e); } catch (BOSException e) { logger.error("", e); } return adminOrgUnitInfo; } }

    转载请注明原文地址: https://ju.6miu.com/read-1304241.html
    最新回复(0)