示例#1
0
  /**
   * 修改排序号
   *
   * @param id
   * @param sort
   * @return
   */
  public Map<String, Object> modifySort(String id, String sort) {
    Connection conn = null;
    PreparedStatement ps = null;
    ResultSet rs = null;
    Map<String, Object> map = new HashMap<String, Object>();
    int num = 0;
    ChannelAsset oldcha = mediaService.getCHAInfoById(id);
    ChannelAsset newcha = new ChannelAsset();
    newcha.setCh(oldcha.getCh());
    newcha.setId(id);
    newcha.setSort(Integer.valueOf(sort));
    newcha.setPubTime(new Timestamp(System.currentTimeMillis()));

    String sql = "update wt_ChannelAsset set sort = ?,pubTime= ? where id = ?";
    try {
      conn = DataSource.getConnection();
      ps = conn.prepareStatement(sql);
      ps.setInt(1, Integer.valueOf(sort));
      Timestamp timestamp = new Timestamp(System.currentTimeMillis());
      ps.setTimestamp(2, timestamp);
      ps.setString(3, id);
      num = ps.executeUpdate();
    } catch (SQLException e) {
      e.printStackTrace();
    } finally {
      closeConnection(conn, ps, rs);
    }
    if (num == 1) {
      map.put("ReturnType", "1001");
    } else {
      map.put("ReturnType", "1011");
      map.put("Message", "修改失败");
    }
    return map;
  }
示例#2
0
 /**
  * 修改审核状态
  *
  * @param id 栏目发布表id
  * @param number
  * @return
  */
 public Map<String, Object> modifyStatus(String id, String number) {
   Map<String, Object> map = new HashMap<String, Object>();
   id = id.replaceAll("%2C", ",");
   id = id.substring(0, id.length() - 1);
   String[] ids = id.split(",");
   int num = 0;
   for (int i = 0; i < ids.length; i++) {
     ChannelAsset cha = new ChannelAsset();
     cha.setId(ids[i]);
     cha.setPubTime(new Timestamp(System.currentTimeMillis()));
     cha.setFlowFlag(Integer.valueOf(number));
     num = mediaService.updateCha(cha);
   }
   if (num == 1) {
     map.put("ReturnType", "1001");
   } else {
     map.put("ReturnType", "1011");
     map.put("Message", "修改失败");
   }
   return map;
 }