93 lines
2.6 KiB
Java
93 lines
2.6 KiB
Java
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<String, Object> 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<String, Object> 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<Map<String, Object>> getPushMsgResult() {
|
|
List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
|
|
try {
|
|
BizObjectManager bom = JBOFactory
|
|
.getBizObjectManager("jbo.app.APP_PUSH_MESSAGE");
|
|
BizObjectQuery boq = bom.createQuery("1=1");
|
|
List<BizObject> 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<String, Object> 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;
|
|
}
|
|
}
|
|
}
|