һ һ
1.1ڲ
1.1.1ϵͳ
ҪSQLʱͱϵͳIJ,:ա
ֻղƷӦĶࡱĴ༰ĴòΪգд
UIеsetDefaultDataӶԲմ,: // ղѯд
// ҪĵıĿ,˴ΪҪıͷIJƷ
UIRefPane pane = (UIRefPane) getBillCardPanel().getHeadItem(
HpCostcardVO.PK_INVMANDOC).getComponent();
// øòյĸ,ԱgetClassWherePart
AbstractRefGridTreeModel model = (AbstractRefGridTreeModel) pane.getRefModel();
// øĿPKֵ
if (SysInitBO_Client.getPkValue(this._getCorp().getPk_corp(), \) != null) {
// ͨ
PֵѯҪK
String sPkValue = SysInitBO_Client.getPkValue(this._getCorp().getPk_corp(), \); String sWhere = model.getClassWherePart(); if (!sPkValue.equals(\)) { // ѯı
SuperVO vo = HYPubBO_Client.queryByPrimaryKey(InvclVO.class,sPkValue);
}
}
sWhere = sWhere + \
+ vo.getAttributeValue(\).toString()+ \;
// µWHEREsetClassWherePart
model.setClassWherePart(sWhere);
1.1.2Զ
ϵͳṩIJղʱҪԶ. ԶһΪԶļ¡
2. ѯ
2.1 ѯģеԶ
ڲѯģһЩԶ,ǸõݵӱжûиӦֶʱ,ҪIJѯģIJѯ.
MyDelegator.javaqueryByCondition()漰Ҫ
drΪ+dr£
public SuperVO[] queryByCondition(Class voClass, String strWhere)
throws Exception {
strWhere = strWhere.replace(\, \); strWhere = strWhere + \ +ClientEnvironment.getInstance().getCorporation().getPk_corp()
+ \;SuperVO[] queryVos = nc.ui.hp.pub.ServiceFactory.getIHPPubService()
.queryCostgather(strWhere);
// return super.queryByCondition(voClass, strWhere);
return queryVos; }
Ҫ뱾˾ҪMyEventHandler.javaonBoQuery()
protected void onBoQuery() throws Exception { }
StringBuffer strWhere = new StringBuffer(); if (askForQueryCondition(strWhere) == false)
return;// û˲ѯ
// SuperVO[] queryVos = queryHeadVOs(strWhere.toString()); getBufferData().clear(); // ݵBuffer // addDataToBuffer(queryVos);
strWhere.append(\ + strWhere + \
+ getUI()._getCorp().getPk_corp() + \);
doBodyQuery(strWhere.toString()); updateBuffer();
getUI().getBillCardPanel().setEnabled(true);
ͬʱѯģеĿΪ+Ŀ 磺pk_costcardΪhp_costcard. pk_costcard
2.2 ˢԶ
ҳԶĿʱ浽ݿ⣬ôɺĬDzЩģҪؾͱAbstractMyDelegator()
/**
* ݲѯ(д) Ž
*/
public SuperVO[] queryHeadAllData(Class headClass, String strBillType,
String strWhere) throws Exception {
BilltypeVO billVo = PfUIDataCache.getBillType(strBillType); if (billVo.getWherestring() != null }
&& billVo.getWherestring().length() != 0) {
if (strWhere != null)
strWhere = strWhere + \ + billVo.getWherestring() + \;
else
strWhere = billVo.getWherestring();
SuperVO[] vo = HYPubBO_Client.queryByCondition(headClass, strWhere); // ˴voϵͳձѯvo, Ҫvoд // GetcostcardotherǴvoķ
vo = nc.ui.hp.pub.ServiceFactory.getIHPPubService()
.Getcostcardother(vo);
return vo; }
MyEventHandler.javaonBoSave()һ仰
super.onBoRefresh();
Getcostcardother(vo)οCostCardDAO.java
עUIвֱBSε࣬ҪӿڴӶá
3.
3.1 ʱʹ