/** * @see com.pureinfo.importer.ref.IImportorRef#convert(com.pureinfo.dolphin.model.DolphinObject, * com.pureinfo.dolphin.model.DolphinObject, java.lang.String, java.lang.String, * com.pureinfo.dolphin.persister.ISession, com.pureinfo.dolphin.persister.ISession, * com.pureinfo.dolphin.mapping.EntityMetadata, java.lang.String, java.lang.String) */ public Object convert( DolphinObject _old, DolphinObject _new, String _sFromProperty, String _sToProperty, ISession _fromSession, ISession _toSession, EntityMetadata _metadata, String _sKey, String _sToTable) throws PureException { int objId = _new.getIntProperty("id", 0); IPatentMgr mgr = (IPatentMgr) ArkContentHelper.getContentMgrOf(SRMTypes.PATENT); Patent patent = (Patent) mgr.lookupById(objId); if (patent == null) { return null; } if (mgr.openIsAuth(patent.getPatentType())) { patent.setStatus(SRMConstants.PATENT_STATUS_HAS_RIGHT); patent.setWarrantDate(patent.getPublicDate()); patent.setProbWeight(WeightCalcHelper.getWeightCalculator(patent).calcProbWeight()); mgr.save(patent); } return null; }
/** * @param _nPatentId * @throws PureException */ private void updateOnePatent(int _nPatentId) throws PureException { IPatentMgr patentMgr = (IPatentMgr) ArkContentHelper.getContentMgrOf(Patent.class); Patent checkPatent = (Patent) patentMgr.lookupById(_nPatentId); if (request.getParameter("actionType").equals("cer")) { checkPatent.setIsCerSave(1); checkPatent.setCerDate(new Date()); } // else if(request.getParameter("actionType").equals("datum")){ // checkPatent.setIsDatumSave(1); // checkPatent.setDatumDate(new Date()); // } patentMgr.save(checkPatent); }