Commit 55fb3e91 by zhiwei

修复部分代码问题

parent 3794f083
...@@ -9,11 +9,8 @@ import org.springframework.data.mongodb.core.query.Criteria; ...@@ -9,11 +9,8 @@ import org.springframework.data.mongodb.core.query.Criteria;
import org.springframework.data.mongodb.core.query.Query; import org.springframework.data.mongodb.core.query.Query;
import org.springframework.data.mongodb.core.query.Update; import org.springframework.data.mongodb.core.query.Update;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import com.mongodb.DBCollection;
import com.mongodb.WriteResult; import com.mongodb.WriteResult;
import com.zhiwei.manage.bean.FieldBean; import com.zhiwei.manage.bean.FieldBean;
import com.zhiwei.manage.handle.DbDepot;
@Component @Component
public class FieldBeanDaoImpl implements FieldBeanDao { public class FieldBeanDaoImpl implements FieldBeanDao {
......
...@@ -73,6 +73,7 @@ public class NewsDaoImpl implements NewsDao { ...@@ -73,6 +73,7 @@ public class NewsDaoImpl implements NewsDao {
"net_media_" + year + (month > 9 ? "" + month : "0" + month)); "net_media_" + year + (month > 9 ? "" + month : "0" + month));
} }
@SuppressWarnings("unchecked")
@Override @Override
public List<Object> findSource() { public List<Object> findSource() {
Calendar c = Calendar.getInstance(); Calendar c = Calendar.getInstance();
......
...@@ -115,7 +115,7 @@ public class ServerDaoImpl implements ServerDao { ...@@ -115,7 +115,7 @@ public class ServerDaoImpl implements ServerDao {
@Override @Override
public int findServerCount(String dbName) { public int findServerCount(String dbName) {
if (dbName.equals("") || dbName == null) { if (dbName == null || dbName.equals("")) {
System.out.println("this"); System.out.println("this");
return (int) mongo.count(null, ServerBean.class); return (int) mongo.count(null, ServerBean.class);
} else { } else {
...@@ -133,9 +133,11 @@ public class ServerDaoImpl implements ServerDao { ...@@ -133,9 +133,11 @@ public class ServerDaoImpl implements ServerDao {
return mongo.findAll(Channel.class); return mongo.findAll(Channel.class);
} }
@SuppressWarnings("unchecked")
@Override @Override
public List<String> findDisChan() { public List<String> findDisChan() {
return mongo.getCollection("Channel").distinct("pt"); List<String> result = mongo.getCollection("Channel").distinct("pt");
return result;
} }
@Override @Override
......
package com.zhiwei.manage.dao; package com.zhiwei.manage.dao;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map;
import javax.annotation.Resource; import javax.annotation.Resource;
import org.bson.types.ObjectId;
import org.elasticsearch.common.cache.Cache;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Sort;
import org.springframework.data.domain.Sort.Direction;
import org.springframework.data.domain.Sort.Order;
import org.springframework.data.mongodb.core.MongoTemplate; import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.data.mongodb.core.query.Criteria; import org.springframework.data.mongodb.core.query.Criteria;
import org.springframework.data.mongodb.core.query.CriteriaDefinition;
import org.springframework.data.mongodb.core.query.Query; import org.springframework.data.mongodb.core.query.Query;
import org.springframework.data.mongodb.core.query.Update; import org.springframework.data.mongodb.core.query.Update;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.mongodb.BasicDBObject;
import com.mongodb.DBCollection;
import com.mongodb.DBCursor;
import com.mongodb.DBObject;
import com.mongodb.WriteResult; import com.mongodb.WriteResult;
import com.zhiwei.manage.bean.Template; import com.zhiwei.manage.bean.Template;
import com.zhiwei.manage.handle.DbDepot;
import com.zhiwei.manage.util.Change;
@Service @Service
public class TemplateDaoImpl implements TemplateDao { public class TemplateDaoImpl implements TemplateDao {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment