1.天下事的type的保存
This commit is contained in:
parent
856f874aed
commit
d24d4fa725
|
|
@ -71,8 +71,8 @@ public interface NewsMapper {
|
|||
"values (#{title}, #{summary}, #{picture}, #{type}, #{content}, now(), now())")
|
||||
void saveDraft(NewsDraft newsDraft);
|
||||
|
||||
@Insert("insert into news(draft_id, title, summary, picture, type, content, create_time, update_time, status)" +
|
||||
"values (#{draftId}, #{title}, #{summary}, #{picture}, #{type}, #{content}, now(), now(), #{status})")
|
||||
@Insert("insert into news(draft_id, title, summary, picture, type, content, create_time, update_time, status, publish_time)" +
|
||||
"values (#{draftId}, #{title}, #{summary}, #{picture}, #{type}, #{content}, now(), now(), #{status}, #{publishTime})")
|
||||
void saveNews(News news);
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ public class SaveDraftColumn {
|
|||
private SaveDraftColumnItem earlyKnow;
|
||||
|
||||
private Boolean showEverything;
|
||||
private SaveDraftColumnItem everything;
|
||||
|
||||
public SaveDraftColumn() {}
|
||||
|
||||
|
|
@ -46,4 +47,12 @@ public class SaveDraftColumn {
|
|||
public void setShowEverything(Boolean showEverything) {
|
||||
this.showEverything = showEverything;
|
||||
}
|
||||
|
||||
public SaveDraftColumnItem getEverything() {
|
||||
return everything;
|
||||
}
|
||||
|
||||
public void setEverything(SaveDraftColumnItem everything) {
|
||||
this.everything = everything;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -80,6 +80,7 @@ public class News {
|
|||
this.type = 1;
|
||||
this.status = saveNewsDTO.getStatus();
|
||||
this.content = saveNewsDTO.getContent();
|
||||
this.publishTime = saveNewsDTO.getPublishTime();
|
||||
// this.status = 0;
|
||||
this.createTime = new Date();
|
||||
this.updateTime = new Date();
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ public class NewsDetailColumn {
|
|||
private SaveDraftColumnItem earlyKnow;
|
||||
|
||||
private boolean showEverything = false;
|
||||
private SaveDraftColumnItem everything;
|
||||
|
||||
public NewsDetailColumnVip getVip() {
|
||||
return vip;
|
||||
|
|
@ -42,4 +43,12 @@ public class NewsDetailColumn {
|
|||
public void setShowEverything(Boolean showEverything) {
|
||||
this.showEverything = showEverything;
|
||||
}
|
||||
|
||||
public SaveDraftColumnItem getEverything() {
|
||||
return everything;
|
||||
}
|
||||
|
||||
public void setEverything(SaveDraftColumnItem everything) {
|
||||
this.everything = everything;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -123,6 +123,11 @@ public class NewsService {
|
|||
item.setType(type);
|
||||
} else if (columnId == 14) {
|
||||
newsDetailColumn.setShowEverything(true);
|
||||
//zzp
|
||||
SaveDraftColumnItem item = new SaveDraftColumnItem();
|
||||
newsDetailColumn.setEverything(item);
|
||||
item.setShow(true);
|
||||
item.setType(type);
|
||||
} else {
|
||||
NewsDetailColumnVip vip = new NewsDetailColumnVip();
|
||||
vip.setId(columnId);
|
||||
|
|
@ -210,6 +215,13 @@ public class NewsService {
|
|||
item.setType(type);
|
||||
} else if (columnId == 14) {
|
||||
newsDetailColumn.setShowEverything(true);
|
||||
//zzp
|
||||
SaveDraftColumnItem item = new SaveDraftColumnItem();
|
||||
newsDetailColumn.setEarlyKnow(item);
|
||||
item.setShow(true);
|
||||
item.setType(type);
|
||||
|
||||
newsDetailColumn.setEverything(item);
|
||||
} else {
|
||||
NewsDetailColumnVip vip = new NewsDetailColumnVip();
|
||||
vip.setId(columnId);
|
||||
|
|
@ -334,11 +346,13 @@ public class NewsService {
|
|||
}
|
||||
}
|
||||
Boolean showEverything = column.getShowEverything();
|
||||
Integer type = null;
|
||||
if (earlyKnow != null) {
|
||||
type = earlyKnow.getType();//时间紧,暂时把早知道的type挪过来
|
||||
}
|
||||
// Integer type = null;
|
||||
// if (earlyKnow != null) {
|
||||
// type = earlyKnow.getType();//时间紧,暂时把早知道的type挪过来
|
||||
// }
|
||||
SaveDraftColumnItem everything = column.getEverything();
|
||||
if (showEverything != null && showEverything) {
|
||||
Integer type = everything.getType();
|
||||
columnMapper.saveNewsColumnRel(newIdRl, 14L, type);
|
||||
}
|
||||
}
|
||||
|
|
@ -521,6 +535,7 @@ public class NewsService {
|
|||
}
|
||||
}
|
||||
SaveDraftColumnItem earlyKnow = column.getEarlyKnow();
|
||||
SaveDraftColumnItem everything = column.getEverything();
|
||||
if (earlyKnow != null) {
|
||||
Boolean show = earlyKnow.getShow();
|
||||
if (show != null && show) {
|
||||
|
|
@ -530,7 +545,9 @@ public class NewsService {
|
|||
}
|
||||
Boolean showEverything = column.getShowEverything();
|
||||
if (showEverything != null && showEverything) {
|
||||
columnMapper.saveDraftColumnRel(draftId, 14L, null);
|
||||
//zzp
|
||||
Integer type = everything.getType();
|
||||
columnMapper.saveDraftColumnRel(draftId, 14L, type);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
|
|
@ -544,7 +561,8 @@ public class NewsService {
|
|||
Integer last, Integer current, String orderBy, String direction) {
|
||||
int offset = 0;
|
||||
if (current != null) {
|
||||
offset = (Math.max(0, page - current)) * size;
|
||||
// offset = (Math.max(0, page - current)) * size;
|
||||
offset = (Math.max(0, current-1)) * size;
|
||||
}
|
||||
|
||||
if (StringUtils.hasText(columnParam)) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue