private void doCache(SuperVO vo, Dataset ds, Row row) { ViewContext widgetCtx = getLifeCycleContext().getViewContext(); // 此子表的dsId String dsId = getSlaveDataset(widgetCtx); DatasetRelation[] rels = widgetCtx.getView().getViewModels().getDsrelations().getDsRelations(); if (rels == null) return; String foreignKey = null; for (int i = 0; i < rels.length; i++) { DatasetRelation dsRel = rels[i]; if (dsRel.getDetailDataset().equals(dsId)) { foreignKey = dsRel.getDetailForeignKey(); break; } } if (foreignKey == null) return; String foreignValue = (String) vo.getAttributeValue(foreignKey); List<SuperVO> list = (List<SuperVO>) LfwCacheManager.getSessionCache().get(foreignValue); if (list == null) { list = new ArrayList<SuperVO>(); } list.add(vo); LfwCacheManager.getSessionCache().put(foreignValue, list); // 删除的子表的行信息 String delRowForeignKey = foreignValue + "_" + dsId; List<Row> listDelRow = (List<Row>) LfwCacheManager.getSessionCache().get(delRowForeignKey); if (listDelRow == null) { listDelRow = new ArrayList<Row>(); } listDelRow.add(row); LfwCacheManager.getSessionCache().put(delRowForeignKey, listDelRow); }
@Override public DapMsgVO getDapVO(AggregatedValueObject billVo, String opType) throws BusinessException { SuperVO superVO = (SuperVO) billVo.getParentVO(); DapMsgVO msgVo = new DapMsgVO(); msgVo.setBillCode((String) superVO.getAttributeValue(ReturnVO.VBILLNO)); msgVo.setChecker((String) superVO.getAttributeValue(ReturnVO.VAPPROVEID)); msgVo.setSys(FbmBusConstant.SYSCODE_FBM); msgVo.setDestSystem(IAccountPlat.DESTSYS_GL); msgVo.setCorp((String) superVO.getAttributeValue(ReturnVO.PK_CORP)); if (FbmBusConstant.OP_VOUCHER.equals(opType)) { msgVo.setComment( nc.vo.ml.NCLangRes4VoTransl.getNCLangRes() .getStrByID("3620add", "UPP3620ADD-000167") /*@res "票据退票制证"*/); msgVo.setMsgType(DapMsgVO.ADDMSG); // 设置为增加消息 } else { msgVo.setComment( nc.vo.ml.NCLangRes4VoTransl.getNCLangRes() .getStrByID("3620add", "UPP3620ADD-000168") /*@res "票据退票取消制证"*/); msgVo.setMsgType(DapMsgVO.DELMSG); // 设置为删除消息 } msgVo.setProc((String) superVO.getAttributeValue(ReturnVO.PK_BILLTYPECODE)); msgVo.setOperator((String) superVO.getAttributeValue(ReturnVO.VOPERATORID)); msgVo.setProcMsg(superVO.getPrimaryKey()); msgVo.setBusiDate((UFDate) superVO.getAttributeValue(ReturnVO.DAPPROVEDATE)); // 设置业务日期为审核日期 ReturnBillServiceImpl srv = new ReturnBillServiceImpl(); msgVo.setMoney(srv.sumMoneyy(billVo)); ReturnBVO[] bvos = (ReturnBVO[]) billVo.getChildrenVO(); msgVo.setCurrency(bvos[0].getPk_curr()); CurrencyPublicUtil currencyPublicUtil = new CurrencyPublicUtil((String) superVO.getAttributeValue(ReturnVO.PK_CORP)); currencyPublicUtil.setPk_currtype_y(bvos[0].getPk_curr()); UFDouble[] fbrate = currencyPublicUtil.getExchangeRate( String.valueOf(superVO.getAttributeValue(ReturnVO.DVOUCHERDATE))); for (int i = 0; i < bvos.length; i++) { UFDouble[] yfbmoney = currencyPublicUtil.getYfbMoney( bvos[i].getMoneyy(), String.valueOf(superVO.getAttributeValue(ReturnVO.DVOUCHERDATE))); bvos[i].setMoneyb(yfbmoney[2]); bvos[i].setBrate(fbrate[1]); } return msgVo; }