@Override public void doShare( Context context, HashMap<String, FetalMovement> params, ITaskCallback callBack) { FetalMovement fh = params.get(FetalMovement.class.getName()); String uid = fh.getMeasureUID(); FetalMovement tmp = getMeasureFetalMovement(uid); if (!NetUtil.isConnect(context)) { callBack.onComplete(LocalCode.CODE_18100, null); } else { if (tmp.getRecordID() == null) { callBack.onComplete(LocalCode.CODE_18101, null); mModule = CloudMeasureModuleCentreRoot.getInstance() .obtain(getAccountAttached(), MCloudDevice.FM); mModule.getCacheController().getNewItemsFromServer(null, null, new TaskHost() {}); accurateShare(context, tmp); } else { accurateShare(context, tmp); } } }
@Override public void doShareWithUrl(TaskHost taskHost) { String accessToken = AccountProxy.getInstance().getCurrentAccount().getAccessToken(); String type = MCloudDevice.OXY.getTag(); // XXX 临时方案,解决分享中出现41904错误,待缓存这块重构 String uid = mBloodOxygen.getMeasureUID(); BloodOxygenModule oxyModule = (BloodOxygenModule) CloudMeasureModuleCentreRoot.getInstance() .create( AccountProxy.getInstance().getCurrentAccount(), BloodOxygenModule.class.getCanonicalName(), true); BloodOxygen tmpOxygen = oxyModule.getCacheController().getMeasureBloodOxygen(uid); Integer recordID = tmpOxygen.getRecordID(); GroupHelper.doShareUrlRecordTask(context, accessToken, type, recordID, null, null, taskHost); }