Package com.iqbon.jcms.domain

Examples of com.iqbon.jcms.domain.PushRecord


    if (user == null) {
      return errorMav;
    }
    int number = 0;
    for (String indexid : indexids) {
      PushRecord pushRecord = pushRecordService.getPushRecordById(indexid);
      if (pushRecord.getType() == PushRecord.PUSH_RECORD_TYPE.doc.ordinal()) {//普通文章的推送记录
        number = docService.deleteDoc(pushRecord.getDocid(), user.getUserName());
      } else if (pushRecord.getType() == PushRecord.PUSH_RECORD_TYPE.emptyDoc.ordinal()) {//空文章
        List<String> deleteIndexid = new ArrayList<String>();
        deleteIndexid.add(indexid);
        number = pushRecordService.deletePushRecords(deleteIndexid);
      } else if (pushRecord.getType() == PushRecord.PUSH_RECORD_TYPE.model.ordinal()) {//模板
        String modelName = pushRecord.getModelName();
        List<String> deleteIndexid = new ArrayList<String>();
        deleteIndexid.add(indexid);
        number = pushRecordService.deletePushRecords(deleteIndexid);
        modelService.deleteModel(modelName, user.getUserName());
      }
View Full Code Here


   * @param userName
   * @return
   */
  public int addBlankDoc(String title, String subTitle, String url, String topicid, int lspri,
      String userName, String img) {
    PushRecord pushRecord = new PushRecord();
    pushRecord.setIndexid(JCMSConstant.createPushRecordId());
    pushRecord.setTitle(title);
    pushRecord.setSubTitle(subTitle);
    pushRecord.setTopicid(topicid);
    pushRecord.setUrl(url);
    pushRecord.setImg(img);
    pushRecord.setLspri(lspri);
    pushRecord.setType(0);
    pushRecord.setModifyUser(userName);
    return addPushRecord(pushRecord);
  }
View Full Code Here

   * @param indexid
   * @param lspri
   * @return
   */
  public int updateLspri(String indexid, int lspri, String userName) {
    PushRecord pushRecord = pushRecordDAO.queryPushRecordById(indexid);
    pushRecord.setLspri(lspri);
    pushRecord.setModifyUser(userName);
    return this.updatePushRecord(pushRecord);
  }
View Full Code Here

   * 根据ID获取推送记录
   * @param indexid
   * @return
   */
  public PushRecord getPushRecordById(String indexid) {
    PushRecord pushRecord = pushRecordDAO.queryPushRecordById(indexid);
    return pushRecord;
  }
View Full Code Here

   * @param maxLspri 权重最大值0-100
   * @param isImg 是否图片,可以为null
   * @return
   */
  public PushRecord getNextPushRecord(String indexid, int minLspri, int maxLspri, Boolean isImg) {
    PushRecord pushRecord = pushRecordDAO.queryPushRecordById(indexid);
    if(pushRecord==null){
      return null;
    }else{
      String topicid  = pushRecord.getTopicid();
      List<PushRecord> list = getPushRecordByTopic(topicid, minLspri, maxLspri, isImg, null, null,
          Integer.MAX_VALUE);
      PushRecord lastOne = null;
      for (PushRecord one : list) {
        if (one.getIndexid().equals(indexid)) {
          break;
        }
        lastOne = one;
View Full Code Here

   * @param maxLspri 权重最大值0-100
   * @param isImg 是否图片,可以为null
   * @return
   */
  public PushRecord getLastPushRecord(String indexid, int minLspri, int maxLspri, Boolean isImg) {
    PushRecord pushRecord = pushRecordDAO.queryPushRecordById(indexid);
    if (pushRecord == null) {
      return null;
    } else {
      String topicid = pushRecord.getTopicid();
      List<PushRecord> list = getPushRecordByTopic(topicid, minLspri, maxLspri, isImg, null, null,
          Integer.MAX_VALUE);
      boolean found = false;
      for (PushRecord one : list) {
        if (found) {
View Full Code Here

    doc.setStatus(status);
    String url = JCMSConstant.createDocUrl(docid, Doc.docType.normal.ordinal());
    doc.setUrl(url);
    int number = docService.addDoc(doc);
    if (number > 0) {//增加推送记录
      PushRecord pushRecord = new PushRecord();
      pushRecord.setIndexid(JCMSConstant.createPushRecordId());
      pushRecord.setDocid(docid);
      pushRecord.setLspri(PushRecord.DEFAULT_LSPRI);
      pushRecord.setModifyUser(user.getUserName());
      pushRecord.setTitle(title);
      pushRecord.setTopicid(topicid);
      pushRecord.setType(PushRecord.PUSH_RECORD_TYPE.doc.ordinal());
      pushRecord.setUrl(url);
      number = pushRecordService.addPushRecord(pushRecord);
      if (number > 0) {
        if (status == Doc.docStatus.publish.ordinal()) {//发布文章
          try {
            docService.publishDoc(docid, null);
View Full Code Here

      result.put(APIConstant.K_MESSAGE, "添加文章失败");
      return result;
    }
    if (number > 0) {//增加推送记录

      PushRecord pushRecord = new PushRecord();
      pushRecord.setIndexid(JCMSConstant.createPushRecordId());
      pushRecord.setDocid(docid);
      pushRecord.setLspri(PushRecord.DEFAULT_LSPRI);
      pushRecord.setModifyUser(clientName);
      pushRecord.setTitle(title);
      pushRecord.setTopicid(topicid);
      pushRecord.setType(PushRecord.PUSH_RECORD_TYPE.doc.ordinal());
      pushRecord.setUrl(url);
      logger.info("增加文章成功,增加推送记录:" + ToStringBuilder.reflectionToString(pushRecord));
      try{
        number = pushRecordService.addPushRecord(pushRecord);
      }catch(Exception e){
        logger.error("添加推送记录失败", e);
View Full Code Here

public class PushRecordMapper implements RowMapper<PushRecord> {

  @Override
  public PushRecord mapRow(ResultSet rs, int rowNum) throws SQLException {
    PushRecord pushRecord = new PushRecord();
    pushRecord.setIndexid(rs.getString("indexid"));
    pushRecord.setDocid(rs.getString("docid"));
    pushRecord.setModelName(rs.getString("modelname"));
    pushRecord.setTitle(rs.getString("title"));
    pushRecord.setLspri(rs.getInt("lspri"));
    pushRecord.setUrl(rs.getString("url"));
    pushRecord.setSubTitle(rs.getString("sub_title"));
    pushRecord.setTopicid(rs.getString("topicid"));
    pushRecord.setLastModify(rs.getString("last_modify"));
    pushRecord.setAddDate(rs.getString("add_date"));
    pushRecord.setModifyUser(rs.getString("modify_user"));
    pushRecord.setType(rs.getInt("type"));
    pushRecord.setImg(rs.getString("img"));
    return pushRecord;
   
  }
View Full Code Here

TOP

Related Classes of com.iqbon.jcms.domain.PushRecord

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.