diff --git a/uapbd/META-INF/msg.rest b/uapbd/META-INF/msg.rest new file mode 100644 index 0000000..bcf0629 --- /dev/null +++ b/uapbd/META-INF/msg.rest @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/uapbd/src/public/nccloud/api/uapbd/msg/MsgResource.java b/uapbd/src/public/nccloud/api/uapbd/msg/MsgResource.java index 45c780d..00539e1 100644 --- a/uapbd/src/public/nccloud/api/uapbd/msg/MsgResource.java +++ b/uapbd/src/public/nccloud/api/uapbd/msg/MsgResource.java @@ -3,15 +3,15 @@ package nccloud.api.uapbd.msg; import com.alibaba.fastjson.JSONObject; import nc.bs.dao.DAOException; import nc.bs.logging.Logger; -import nc.bs.pub.pf.PfMessageUtil; import nc.bs.trade.business.HYSuperDMO; import nc.vo.pub.BusinessException; import nc.vo.pub.lang.UFDateTime; import nc.vo.pub.msg.CommonMessageVO; import nc.vo.pub.msg.UserNameObject; +import nc.vo.pubapp.pattern.exception.ExceptionUtils; import nc.vo.sm.UserVO; import nccloud.api.rest.utils.ResultMessageUtil; -import nccloud.baseapp.core.log.NCCForUAPLogger; +import nccloud.bs.pub.pf.PfMessageUtil; import nccloud.commons.lang.StringUtils; import nccloud.ws.rest.resource.AbstractNCCRestResource; import org.json.JSONString; @@ -57,7 +57,7 @@ public class MsgResource extends AbstractNCCRestResource { String roleId = (String) jsonObject.get("roleId"); try { // 通知消息字段,最大为4000位。 - if (content.length() > 1500) { + if (content != null && content.length() > 1500) { content = content.substring(0, 1500); } @@ -111,17 +111,18 @@ public class MsgResource extends AbstractNCCRestResource { return null; } String strWhere = " dr = 0 AND cuserid in (" + - "select cuserid from sm_user_role where pk_role = [roleId] and (disabledate is null or disabledate >= [now]) " + + "select cuserid from sm_user_role where pk_role = '[roleId]' and (disabledate is null or disabledate >= '[now]') " + ")"; strWhere = strWhere.replace("[roleId]", roleId); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); String time = sdf.format(new Date()); strWhere = strWhere.replace("[now]", time); - NCCForUAPLogger.debug("time = " + time); + // NCCForUAPLogger.debug("time = " + time); try { vos = (UserVO[]) getSuperDMO().queryByWhereClause(UserVO.class, strWhere); } catch (DAOException e) { Logger.error("MsgResource-getUserByRole-exp:" + e.getMessage()); + ExceptionUtils.wrappBusinessException(e.getMessage()); } return vos;