package com.base.helper; import java.util.ArrayList; import java.util.List; import java.util.Map; import com.amarsoft.are.ARE; import com.amarsoft.are.jbo.BizObject; import com.amarsoft.are.jbo.BizObjectManager; import com.amarsoft.are.jbo.BizObjectQuery; import com.amarsoft.are.jbo.JBOException; import com.amarsoft.are.jbo.JBOFactory; import com.base.util.BizObjectUtil; public class AppHelper { public static Map getNewVersionByPhoneType(String sDevType) { try { BizObjectManager bom = JBOFactory .getBizObjectManager("jbo.app.APP_VERSION"); BizObjectQuery boq = bom .createQuery( "PHONE_TYPE=:PHONE_TYPE AND IS_NEW='Y' ORDER BY UP_DATE DESC") .setParameter("PHONE_TYPE", sDevType); BizObject bo = boq.getSingleResult(false); if (bo == null) return null; BizObjectUtil boUtil = new BizObjectUtil(); return boUtil.bizObject2MapValue(bo); } catch (JBOException e) { ARE.getLog().error(e); return null; } } public static Map getPushMsgConfig() { try { BizObjectManager bom = JBOFactory .getBizObjectManager("jbo.app.APP_PUSH_CONFIG"); BizObjectQuery boq = bom.createQuery("1=1"); BizObject bo = boq.getSingleResult(false); if (bo == null) return null; BizObjectUtil boUtil = new BizObjectUtil(); return boUtil.bizObject2MapValue(bo); } catch (JBOException e) { ARE.getLog().error(e); return null; } } public static List> getPushMsgResult() { List> list = new ArrayList>(); try { BizObjectManager bom = JBOFactory .getBizObjectManager("jbo.app.APP_PUSH_MESSAGE"); BizObjectQuery boq = bom.createQuery("1=1"); List bos = boq.getResultList(false); for (BizObject bo : bos) { if (bo == null) continue; BizObjectUtil boUtil = new BizObjectUtil(); list.add(boUtil.bizObject2MapValue(bo)); } } catch (JBOException e) { ARE.getLog().error(e); } return list; } public static Map getGroup(String sGroupCode) { try { BizObjectManager bom = JBOFactory .getBizObjectManager("jbo.app.APP_BUSINESS_GROUP"); BizObjectQuery boq = bom.createQuery("GROUP_CODE=:GROUP_CODE").setParameter("GROUP_CODE", sGroupCode); BizObject bo = boq.getSingleResult(false); if (bo == null) return null; BizObjectUtil boUtil = new BizObjectUtil(); return boUtil.bizObject2MapValue(bo); } catch (JBOException e) { ARE.getLog().error(e); return null; } } }