Skip to content

Commit

Permalink
优化及修复
Browse files Browse the repository at this point in the history
  • Loading branch information
think-gem committed Jun 3, 2013
1 parent c3cf6d6 commit 1ea10c6
Show file tree
Hide file tree
Showing 34 changed files with 392 additions and 427 deletions.
542 changes: 271 additions & 271 deletions bin/refresh-db/cms/jeesite.erm

Large diffs are not rendered by default.

Binary file modified bin/refresh-db/cms/jeesite_data.xls
Binary file not shown.
2 changes: 1 addition & 1 deletion bin/refresh-db/cms/jeesite_mssql.sql
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ CREATE TABLE cms_article
category_id bigint NOT NULL,
title varchar(255) NOT NULL,
color varchar(50),
thumb varchar(255),
image varchar(255),
keywords varchar(255),
description varchar(255),
weight int DEFAULT 0,
Expand Down
2 changes: 1 addition & 1 deletion bin/refresh-db/cms/jeesite_mysql.sql
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ CREATE TABLE cms_article
category_id bigint NOT NULL COMMENT '栏目编号',
title varchar(255) NOT NULL COMMENT '标题',
color varchar(50) COMMENT '标题颜色(red:红色;green:绿色;blue:蓝色;yellow:黄色;orange:橙色)',
thumb varchar(255) COMMENT '缩略图',
image varchar(255) COMMENT '文章图片',
keywords varchar(255) COMMENT '关键字',
description varchar(255) COMMENT '描述、摘要',
weight int DEFAULT 0 COMMENT '权重,越大越靠前',
Expand Down
4 changes: 2 additions & 2 deletions bin/refresh-db/cms/jeesite_oracle.sql
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ CREATE TABLE cms_article
category_id number(19,0) NOT NULL,
title varchar2(255) NOT NULL,
color varchar2(50),
thumb varchar2(255),
image varchar2(255),
keywords varchar2(255),
description varchar2(255),
weight number(10,0) DEFAULT 0,
Expand Down Expand Up @@ -245,7 +245,7 @@ COMMENT ON COLUMN cms_article.id IS '编号';
COMMENT ON COLUMN cms_article.category_id IS '栏目编号';
COMMENT ON COLUMN cms_article.title IS '标题';
COMMENT ON COLUMN cms_article.color IS '标题颜色(red:红色;green:绿色;blue:蓝色;yellow:黄色;orange:橙色)';
COMMENT ON COLUMN cms_article.thumb IS '缩略图';
COMMENT ON COLUMN cms_article.image IS '文章图片';
COMMENT ON COLUMN cms_article.keywords IS '关键字';
COMMENT ON COLUMN cms_article.description IS '描述、摘要';
COMMENT ON COLUMN cms_article.weight IS '权重,越大越靠前';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
import org.hibernate.criterion.Criterion;
import org.hibernate.criterion.Junction;
import org.hibernate.criterion.Restrictions;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.google.common.collect.Lists;
import com.thinkgem.jeesite.modules.sys.entity.Role;
Expand All @@ -23,6 +25,11 @@
* @version 2013-05-15
*/
public abstract class BaseService {

/**
* 日志对象
*/
protected Logger logger = LoggerFactory.getLogger(getClass());

/**
* 数据范围过滤
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
import javax.validation.Validator;

import org.apache.commons.lang3.StringEscapeUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ui.Model;
import org.springframework.web.bind.WebDataBinder;
Expand All @@ -29,6 +31,11 @@
*/
public abstract class BaseController {

/**
* 日志对象
*/
protected Logger logger = LoggerFactory.getLogger(getClass());

/**
* 验证Bean实例对象
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public class Article extends DataEntity {
private Category category;// 分类编号
private String title; // 标题
private String color; // 标题颜色(red:红色;green:绿色;blue:蓝色;yellow:黄色;orange:橙色)
private String thumb; // 缩略图
private String image; // 文章图片
private String keywords;// 关键字
private String description;// 描述、摘要
private Integer weight; // 权重,越大越靠前
Expand Down Expand Up @@ -127,12 +127,12 @@ public void setColor(String color) {
}

@Length(min=0, max=255)
public String getThumb() {
return thumb;
public String getImage() {
return image;
}

public void setThumb(String thumb) {
this.thumb = thumb;
public void setImage(String image) {
this.image = image;
}

@Length(min=0, max=255)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
import org.hibernate.criterion.DetachedCriteria;
import org.hibernate.criterion.Order;
import org.hibernate.criterion.Restrictions;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
Expand All @@ -45,9 +43,6 @@
@Service
@Transactional(readOnly = true)
public class ArticleService extends BaseService {

@SuppressWarnings("unused")
private static Logger logger = LoggerFactory.getLogger(ArticleService.class);

@Autowired
private ArticleDao articleDao;
Expand Down Expand Up @@ -82,8 +77,8 @@ public Page<Article> find(Page<Article> page, Article article, boolean isDataSco
if (StringUtils.isNotEmpty(article.getPosid())){
dc.add(Restrictions.like("posid", "%,"+article.getPosid()+",%"));
}
if (StringUtils.isNotEmpty(article.getThumb())&&"1".equals(article.getThumb())){
dc.add(Restrictions.and(Restrictions.isNotNull("thumb"),Restrictions.ne("thumb","")));
if (StringUtils.isNotEmpty(article.getImage())&&Article.YES.equals(article.getImage())){
dc.add(Restrictions.and(Restrictions.isNotNull("image"),Restrictions.ne("image","")));
}
if (article.getCreateBy()!=null && article.getCreateBy().getId()>0){
dc.add(Restrictions.eq("createBy.id", article.getCreateBy().getId()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
import org.hibernate.criterion.DetachedCriteria;
import org.hibernate.criterion.Order;
import org.hibernate.criterion.Restrictions;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
Expand All @@ -35,9 +33,6 @@
@Service
@Transactional(readOnly = true)
public class CategoryService extends BaseService {

@SuppressWarnings("unused")
private static Logger logger = LoggerFactory.getLogger(CategoryService.class);

public static final String CACHE_CATEGORY_LIST = "categoryList";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
import org.hibernate.criterion.DetachedCriteria;
import org.hibernate.criterion.Order;
import org.hibernate.criterion.Restrictions;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
Expand All @@ -28,9 +26,6 @@
@Service
@Transactional(readOnly = true)
public class CommentService extends BaseService {

@SuppressWarnings("unused")
private static Logger logger = LoggerFactory.getLogger(CommentService.class);

@Autowired
private CommentDao commentDao;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
import org.hibernate.criterion.DetachedCriteria;
import org.hibernate.criterion.Order;
import org.hibernate.criterion.Restrictions;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
Expand All @@ -28,9 +26,6 @@
@Service
@Transactional(readOnly = true)
public class GuestbookService extends BaseService {

@SuppressWarnings("unused")
private static Logger logger = LoggerFactory.getLogger(GuestbookService.class);

@Autowired
private GuestbookDao guestbookDao;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
import org.hibernate.criterion.DetachedCriteria;
import org.hibernate.criterion.Order;
import org.hibernate.criterion.Restrictions;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
Expand All @@ -39,9 +37,6 @@
@Transactional(readOnly = true)
public class LinkService extends BaseService {

@SuppressWarnings("unused")
private static Logger logger = LoggerFactory.getLogger(LinkService.class);

@Autowired
private LinkDao linkDao;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
import org.apache.commons.lang3.StringUtils;
import org.hibernate.criterion.DetachedCriteria;
import org.hibernate.criterion.Restrictions;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
Expand All @@ -29,9 +27,6 @@
@Service
@Transactional(readOnly = true)
public class SiteService extends BaseService {

@SuppressWarnings("unused")
private static Logger logger = LoggerFactory.getLogger(SiteService.class);

@Autowired
private SiteDao siteDao;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
import java.util.List;
import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
Expand All @@ -33,9 +31,6 @@
@Transactional(readOnly = true)
public class StatsService extends BaseService {

@SuppressWarnings("unused")
private static Logger logger = LoggerFactory.getLogger(StatsService.class);

@Autowired
private ArticleDao articleDao;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public static Article getArticle(long articleId){
* @param number 获取数目
* @param param 预留参数,例: key1:'value1', key2:'value2' ...
* posid 推荐位(1:首页焦点图;2:栏目页文章推荐;)
* thumb 缩略图(1:有缩略图的文章
* image 文章图片(1:有文章图片的文章
* @return
*/
public static List<Article> getArticleList(long siteId, long categoryId, int number, String param){
Expand All @@ -137,8 +137,8 @@ public static List<Article> getArticleList(long siteId, long categoryId, int num
if (new Integer(1).equals(map.get("posid")) || new Integer(2).equals(map.get("posid"))){
article.setPosid(String.valueOf(map.get("posid")));
}
if (new Integer(1).equals(map.get("thumb"))){
article.setThumb("1");
if (new Integer(1).equals(map.get("image"))){
article.setImage(Article.YES);
}
}
article.setDelFlag(Article.DEL_FLAG_NORMAL);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,26 @@
import org.activiti.engine.delegate.TaskListener;
import org.activiti.engine.runtime.ProcessInstance;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.thinkgem.jeesite.modules.oa.dao.LeaveDao;
import com.thinkgem.jeesite.modules.oa.entity.Leave;

/**
* 调整请假内容处理器
*
* @author liuj
*/
@Component
@Service
@Transactional
public class LeaveModifyProcessor implements TaskListener {

private static final long serialVersionUID = 1L;

@Autowired
LeaveDao leaveDao;

private LeaveDao leaveDao;
@Autowired
RuntimeService runtimeService;
private RuntimeService runtimeService;

public void notify(DelegateTask delegateTask) {
String processInstanceId = delegateTask.getProcessInstanceId();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import org.activiti.engine.delegate.TaskListener;
import org.activiti.engine.runtime.ProcessInstance;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.thinkgem.jeesite.modules.oa.dao.LeaveDao;
Expand All @@ -20,7 +20,7 @@
*
* @author liuj
*/
@Component
@Service
@Transactional
public class LeaveReportProcessor implements TaskListener {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,8 @@
import org.hibernate.criterion.DetachedCriteria;
import org.hibernate.criterion.Order;
import org.hibernate.criterion.Restrictions;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.google.common.collect.Lists;
Expand All @@ -40,12 +38,10 @@
* @author liuj
* @version 2013-04-05
*/
@Component
@Service
@Transactional(readOnly = true)
public class LeaveService extends BaseService {

private static Logger logger = LoggerFactory.getLogger(LeaveService.class);

@Autowired
private LeaveDao leaveDao;
@Autowired
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@

import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
Expand All @@ -27,9 +25,6 @@
@Transactional(readOnly = true)
public class AreaService extends BaseService {

@SuppressWarnings("unused")
private static Logger logger = LoggerFactory.getLogger(AreaService.class);

@Autowired
private AreaDao areaDao;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
import org.hibernate.criterion.DetachedCriteria;
import org.hibernate.criterion.Order;
import org.hibernate.criterion.Restrictions;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
Expand All @@ -33,9 +31,6 @@
@Transactional(readOnly = true)
public class DictService extends BaseService {

@SuppressWarnings("unused")
private static Logger logger = LoggerFactory.getLogger(DictService.class);

@Autowired
private DictDao dictDao;

Expand Down
Loading

0 comments on commit 1ea10c6

Please sign in to comment.