// // Source code recreated from a .class file by IntelliJ IDEA // (powered by FernFlower decompiler) // package nc.bs.pu.m422x.query; import nc.bs.scmpub.util.SCMDataAccessUtils; import nc.impl.pubapp.pattern.data.vo.VOQuery; import nc.ui.querytemplate.querytree.IQueryScheme; import nc.vo.mmpac.pickm.entity.PickmHeadVO; import nc.vo.mmpac.pickm.entity.PickmItemVO; import nc.vo.pu.m422x.entity.PickmReqAppVO; import nc.vo.pubapp.pattern.model.tool.BillComposite; import nc.vo.pubapp.query2.sql.process.QuerySchemeProcessor; import java.util.HashSet; import java.util.Set; public abstract class Abstract422XRefQueryBP1 { protected String headtb; protected String itemtb; protected QuerySchemeProcessor psor; public Abstract422XRefQueryBP1(IQueryScheme queryScheme) { this.psor = new QuerySchemeProcessor(queryScheme); this.headtb = this.psor.getMainTableAlias(); // this.itemtb = this.psor.getTableAliasOfAttribute("pk_storereq_b.pk_storereq_b"); } public String getHeadtb() { return this.headtb; } public String getItemtb() { return this.itemtb; } public QuerySchemeProcessor getPsor() { return this.psor; } public abstract StringBuilder makeGetPKSql(); public PickmReqAppVO[] queryPickmReqVOs() { SCMDataAccessUtils utils = new SCMDataAccessUtils(10000); // this.psor.appendCurrentGroup(); StringBuilder sql = this.makeGetPKSql(); String[][] pks = utils.query(sql.toString()).toTwoDimensionStringArray(); if (null != pks && pks.length != 0) { Set headPks = new HashSet(); String[] itemPks = new String[pks.length]; for (int i = 0; i < pks.length; ++i) { headPks.add(pks[i][0]); itemPks[i] = pks[i][1]; } PickmHeadVO[] headers = (PickmHeadVO[]) (new VOQuery(PickmHeadVO.class)).query((String[]) headPks.toArray(new String[headPks.size()])); PickmItemVO[] items = (PickmItemVO[]) (new VOQuery(PickmItemVO.class)).query(itemPks); BillComposite bc = new BillComposite(PickmReqAppVO.class); PickmReqAppVO tempVO = new PickmReqAppVO(); bc.append(tempVO.getMetaData().getParent(), headers); bc.append(tempVO.getMetaData().getVOMeta(PickmItemVO.class), items); PickmReqAppVO[] queryResult = (PickmReqAppVO[]) bc.composite(); // return this.processQueryResult(queryResult); return queryResult; } else { return null; } } public void setHeadtb(String headtb) { this.headtb = headtb; } public void setItemtb(String itemtb) { this.itemtb = itemtb; } public void setPsor(QuerySchemeProcessor psor) { this.psor = psor; } protected PickmReqAppVO[] processQueryResult(PickmReqAppVO[] queryResult) { return queryResult; } }