Selaa lähdekoodia

供应商文章

Aslee 3 vuotta sitten
vanhempi
commit
e27e51bafb

+ 4 - 1
src/main/java/com/caimei/modules/info/dao/InfoDao.java

@@ -1,10 +1,12 @@
 package com.caimei.modules.info.dao;
 
+import java.util.Date;
 import java.util.List;
 
 import com.caimei.modules.info.entity.Info;
 import com.thinkgem.jeesite.common.persistence.CrudDao;
 import com.thinkgem.jeesite.common.persistence.annotation.MyBatisDao;
+import org.apache.ibatis.annotations.Param;
 
 /**
  * 信息列表DAO接口
@@ -29,5 +31,6 @@ public interface InfoDao extends CrudDao<Info> {
 	List<Info> findByProjectId(String projectId);
 
 	int updateReplaceByLabel(String label, String reLabel);
-	
+
+	void auditInfo(@Param("id") String id, @Param("auditStatus") Integer auditStatus, @Param("failReason") String failReason, @Param("pubdate") Date pubdate);
 }

+ 45 - 0
src/main/java/com/caimei/modules/info/entity/Info.java

@@ -17,7 +17,9 @@ public class Info extends DataEntity<Info> {
 	private String title;		// 标题
 	private String label;		// 信息标签
 	private String publisher;		// 发布人
+	private Integer publishSource;		// 文章发布来源:1采美,2供应商
 	private String source;		// 发布人
+	private Integer shopId;		// 供应商id,publishSource为2时才有值
 	private String keyword;		// 关键词
 	private String recommendContent;		// 推荐语
 	private String infoContent;		// 信息内容
@@ -30,9 +32,13 @@ public class Info extends DataEntity<Info> {
 	private Long basePv;		// 基础阅读量
 	private Long pv;		// 阅读总量
 	private Long priorityIndex;//优先级
+	private Integer auditStatus;	//供应商文章审核状态:1待审核,2审核通过,3审核失败
+	private String failReason;	//审核失败理由
 	private String topPosition;	//置顶位
 	private String topFlag;	//虚拟字段,是否置顶标识:0否,1是
 
+	private String shopName;	// 供应商名称
+
 	public Info() {
 		super();
 	}
@@ -202,4 +208,43 @@ public class Info extends DataEntity<Info> {
 		this.topFlag = topFlag;
 	}
 
+	public Integer getPublishSource() {
+		return publishSource;
+	}
+
+	public void setPublishSource(Integer publishSource) {
+		this.publishSource = publishSource;
+	}
+
+	public Integer getShopId() {
+		return shopId;
+	}
+
+	public void setShopId(Integer shopId) {
+		this.shopId = shopId;
+	}
+
+	public String getShopName() {
+		return shopName;
+	}
+
+	public void setShopName(String shopName) {
+		this.shopName = shopName;
+	}
+
+    public Integer getAuditStatus() {
+        return auditStatus;
+    }
+
+    public void setAuditStatus(Integer auditStatus) {
+        this.auditStatus = auditStatus;
+    }
+
+	public String getFailReason() {
+		return failReason;
+	}
+
+	public void setFailReason(String failReason) {
+		this.failReason = failReason;
+	}
 }

+ 9 - 1
src/main/java/com/caimei/modules/info/service/InfoService.java

@@ -1,5 +1,6 @@
 package com.caimei.modules.info.service;
 
+import java.util.Date;
 import java.util.List;
 
 import javax.servlet.http.HttpServletRequest;
@@ -236,7 +237,14 @@ public class InfoService extends CrudService<InfoDao, Info> {
                 update(topInfo);
             }
         });
+    }
 
-
+	@Transactional(readOnly = false)
+	public void auditInfo(Info info) {
+		Date pubdate = null;
+		if (info.getAuditStatus() == 2) {
+			pubdate = new Date();
+		}
+		infoDao.auditInfo(info.getId(), info.getAuditStatus(), info.getFailReason(), pubdate);
     }
 }

+ 22 - 38
src/main/java/com/caimei/modules/info/web/InfoController.java

@@ -6,6 +6,7 @@ import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
+import com.caimei.modules.info.entity.CmInfoDocSyn;
 import com.caimei.modules.info.service.CmInfoDocSynService;
 import com.caimei.modules.opensearch.GenerateUtils;
 import com.caimei.modules.opensearch.CoreServiceUitls;
@@ -85,7 +86,11 @@ public class InfoController extends BaseController {
 		model.addAttribute("topLength", topList.size());
 		model.addAttribute("typeList", typeList);
 		model.addAttribute("page", page);
-		return "modules/info/infoList";
+		if (null != info.getPublishSource() && 2 == info.getPublishSource()) {
+			return "modules/info/shopInfoList";
+		} else {
+			return "modules/info/infoList";
+		}
 	}
 
 	@RequiresPermissions("info:info:view")
@@ -274,44 +279,23 @@ public class InfoController extends BaseController {
 		return "modules/info/infoList_multiselect";
 	}
 
-/*	@RequiresPermissions("info:info:edit")
-	@ResponseBody
-	@RequestMapping(value="updateIndex")
-	public Map<String, Object> updateIndex(String id, HttpServletRequest request, HttpServletResponse response){
-		Map<String, Object> map = Maps.newLinkedHashMap();
-		try {
-			CmInfoDocSyn cmInfoDocSyn = new CmInfoDocSyn();
-			cmInfoDocSyn.setInfoId(Integer.parseInt(id));
-			cmInfoDocSyn = cmInfoDocSynService.get(cmInfoDocSyn);
-			if (null!=cmInfoDocSyn){
-				cmInfoDocSyn.setSynFlag(0);
-				cmInfoDocSynService.updateIndex(cmInfoDocSyn);
-			}
-			map.put("success",true);
-			map.put("msg", "更新成功");
-		} catch (Exception e) {
-			logger.debug(e.toString(),e);
-			map.put("success",false);
-			map.put("msg", "更新失败");
-		}
-		return map;
-	}
+    @RequestMapping(value = "check")
+    public String checkInfo(Info info,Model model) {
+        model.addAttribute("info", info);
+        return "modules/info/checkInfoPage";
+    }
 
-	@RequiresPermissions("info:info:edit")
+    @RequestMapping(value = "toAuditPage")
+    public String toAuditPage(Info info,Model model) {
+        model.addAttribute("info", info);
+        return "modules/info/auditInfo";
+    }
+
+    @RequestMapping(value = "auditInfo")
 	@ResponseBody
-	@RequestMapping(value="updateAllIndex")
-	public Map<String, Object> updateAllIndex(HttpServletRequest request, HttpServletResponse response){
-		Map<String, Object> map = Maps.newLinkedHashMap();
-		try {
-			cmInfoDocSynService.updateAllIndex();
-			map.put("success",true);
-			map.put("msg", "更新成功");
-		} catch (Exception e) {
-			logger.debug(e.toString(),e);
-			map.put("success",false);
-			map.put("msg", "更新失败");
-		}
-		return map;
-	}*/
+    public Boolean auditInfo(Info info) {
+		infoService.auditInfo(info);
+        return true;
+    }
 
 }

+ 23 - 0
src/main/resources/mappings/modules/info/InfoMapper.xml

@@ -9,6 +9,8 @@
 		a.label AS "label",
 		a.publisher AS "publisher",
 		a.source AS "source",
+		a.publishSource,
+		s.name as "shopName",
 		a.recommendContent AS "recommendContent",
 		a.infoContent AS "infoContent",
 		a.guidanceImage AS "guidanceImage",
@@ -20,6 +22,8 @@
 		a.basePraise AS "basePraise",
 		a.basePv AS "basePv",
 		a.priorityIndex AS "priorityIndex",
+		a.auditStatus,
+		a.failReason,
 		c.num AS "realPraise",
 		c.pv AS "pv",
 		a.createBy AS "createBy.id",
@@ -33,6 +37,7 @@
 	<sql id="infoJoins">
 		LEFT JOIN info_type b ON a.typeId=b.id
 		LEFT JOIN info_praise c ON a.id=c.infoId
+		left join shop s on a.shopId = s.shopID
 	</sql>
 
 	<select id="get" resultType="Info">
@@ -95,6 +100,15 @@
 			</if>
 			<if test="topPosition != null and topPosition != ''">
 				and topPosition = #{topPosition}
+			</if>
+			<if test="publishSource != null">
+				and publishSource = #{publishSource}
+			</if>
+			<if test="auditStatus != null">
+				and auditStatus = #{auditStatus}
+			</if>
+			<if test="shopName != null and shopName != ''">
+				AND s.name LIKE concat('%,',#{shopName},',%')
 			</if>
 				<!--  AND b.enabledStatus='1' -->
 		</where>
@@ -245,5 +259,14 @@
 	<update id="updateReplaceByLabel">
 		UPDATE info a SET a.label=REPLACE(a.label,#{param1},#{param2}) WHERE CONCAT(',',a.label,',') LIKE CONCAT('%,',#{param1},',%')
 	</update>
+	<update id="auditInfo">
+		update info
+		set auditStatus = #{auditStatus},
+			failReason  = #{failReason}
+			<if test="pubdate != null">
+				,pubdate = #{pubdate}
+			</if>
+		where id = #{id}
+	</update>
 
 </mapper>

+ 0 - 1
src/main/webapp/WEB-INF/views/modules/archive/addVideoForm.jsp

@@ -224,7 +224,6 @@
 
         //点击上传按钮后上传文件
         $('#addSubmit').click(function () {
-            debugger
             var filesById = document.getElementById('archiveFile');
             var files = $('#archiveFile');
             var fileList = files.prop('files');

+ 192 - 0
src/main/webapp/WEB-INF/views/modules/info/auditInfo.jsp

@@ -0,0 +1,192 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
+<html>
+<head>
+    <title>添加视频资料</title>
+    <meta name="decorator" content="default"/>
+    <style>
+        .controls .new-tag {
+            display: inline-block;
+            width: 78px;
+            height: 30px;
+            border: 1px solid #e5e5e5;
+            border-radius: 5px;
+            margin: 7px;
+            text-align: center;
+            line-height: 30px;
+            font-size: 14px;
+            overflow: hidden;
+            text-overflow: ellipsis;
+            white-space: nowrap;
+            cursor: pointer;
+        }
+
+        .controls .new-tag.active {
+            border-color: #e15616;
+            color: #e15616;
+        }
+
+        #tagInput {
+            width: 263px;
+            margin: 7px;
+            display: inline-block;
+            height: 30px;
+        }
+
+        .controls .tags-operate .tag-add {
+            height: 40px;
+            line-height: 40px;
+            vertical-align: middle;
+        }
+
+        .upload {
+            position: relative;
+            display: inline-block;
+            background: #D0EEFF;
+            border: 1px solid #99D3F5;
+            border-radius: 4px;
+            padding: 4px 12px;
+            color: #1E88C7;
+            text-decoration: none;
+            text-indent: 0;
+            line-height: 20px;
+            margin-left: 20px;
+            cursor: pointer;
+            width: 52px;
+            height: 20px;
+        }
+
+        .upload input {
+            position: absolute;
+            width: 170px;
+            font-size: 20px;
+            right: 0;
+            top: 0;
+            opacity: 0;
+            cursor: pointer;
+        }
+
+        .upload:hover {
+            background: #AADFFD;
+            border-color: #78C3F3;
+            color: #004974;
+            text-decoration: none;
+        }
+
+        .add-submit {
+            position: relative;
+            display: inline;
+            background: #D0EEFF;
+            border: 1px solid #99D3F5;
+            border-radius: 4px;
+            padding: 4px 12px;
+            color: #1E88C7;
+            text-decoration: none;
+            text-indent: 0;
+            line-height: 20px;
+            margin-left: 20px;
+            cursor: pointer;
+            width: 52px;
+            height: 30px;
+        }
+
+        .add-submit input {
+            position: absolute;
+            width: 50px;
+            font-size: 20px;
+            right: 0;
+            top: 0;
+            opacity: 0;
+            cursor: pointer;
+        }
+
+        .add-submit:hover {
+            background: #AADFFD;
+            border-color: #78C3F3;
+            color: #004974;
+            text-decoration: none;
+        }
+
+        .upload-loading{
+            display: none;
+            width: 32px;
+            height: 32px;
+            margin-left: 10px;
+        }
+        .upload-loading img{
+            width: 16px;
+            height: 16px;
+            margin: 0 auto 0;
+        }
+
+        #file-list-display {
+            width: 600px;
+            height: auto;
+            float: left;
+            margin-left: 20px;
+        }
+
+        #file-list-display p {
+            line-height: 30px;
+            font-size: 14px;
+            color: #333333;
+            margin: 0;
+        }
+
+        #file-list-display p .del {
+            color: #2fa4e7;
+            font-size: 12px;
+            cursor: pointer;
+            margin-left: 20px;
+        }
+
+        .Main-content{
+            height: 100px;
+        }
+
+        .control-group{
+            margin-top: 40px;
+        }
+    </style>
+
+</head>
+<body>
+<form:form id="inputForm" modelAttribute="info" action="${ctx}/info/info/audit" method="post" class="form-horizontal">
+    <sys:message content="${message}"/>
+    <div class="control-group">
+        <label class="control-label">审核状态</label>
+        <div class="controls">
+            <input type="radio" name="auditStatus" value="2" onclick="updateAuditStatus(2)" ${empty info.auditStatus?'checked=checked':info.auditStatus eq 1?'checked=checked':''}> 审核通过
+            <input type="radio" name="auditStatus" value="3" onclick="updateAuditStatus(3)" ${info.auditStatus eq 3?'checked=checked':''}> 审核失败
+        </div>
+    </div>
+    <div class="control-group" id="failReasonDiv" style="${empty info.auditStatus or info.auditStatus eq 1?'display: none':''}">
+        <label class="control-label">失败原因</label>
+        <div class="controls">
+            <textarea style="width: 400px;height: 90px" id="failReason">${info.failReason}</textarea>
+        </div>
+    </div>
+</form:form>
+
+<script>
+    function getCheckedItems() {
+        var items = new Array();
+        items.push({
+            auditStatus: $("input[name='auditStatus']:checked").val(),
+            failReason: $("#failReason").val()
+        });
+        return items;
+    }
+
+    function updateAuditStatus(auditStatus) {
+        var elementById = document.getElementById("failReasonDiv");
+        if (auditStatus === 2) {
+            elementById.style.cssText = "display:none";
+        } else {
+            elementById.style.cssText = "";
+        }
+    }
+</script>
+</body>
+</html>
+

+ 227 - 0
src/main/webapp/WEB-INF/views/modules/info/checkInfoPage.jsp

@@ -0,0 +1,227 @@
+<%@ page import="com.thinkgem.jeesite.common.config.Global" %>
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
+<html>
+<head>
+	<title>文章列表管理</title>
+	<meta name="decorator" content="default"/>
+	<style type="text/css">
+	.init-label label{margin: 5px 10px;color: gray; }
+	.controls {margin-left: 50px}
+	</style>
+</head>
+<body>
+	<ul class="nav nav-tabs">
+		<li><a href="${ctx}/info/info/?publishSource=${info.publishSource}">文章列表</a></li>
+		<li class="active"><a href="${ctx}/info/info/check?id=${info.id}">文章查看</a></li>
+	</ul><br/>
+	<form:form id="inputForm" modelAttribute="info" action="${ctx}/info/info/save" method="post" class="form-horizontal">
+		<div class="control-group">
+			<label class="control-label"><span class="help-inline"></span>标题:</label>
+			<div class="controls">
+				${info.title}
+			</div>
+		</div>
+		<div class="control-group">
+			<label class="control-label"><span class="help-inline"></span>文章标签:</label>
+			<div class="controls">
+				${info.label}
+			</div>
+		</div>
+		<div class="control-group">
+			<label class="control-label"><span class="help-inline"></span>SEO关键词:</label>
+			<div class="controls">
+				${info.keyword}
+			</div>
+		</div>
+		<div class="control-group">
+			<label class="control-label"><span class="help-inline"></span>发布人:</label>
+			<div class="controls">
+				${info.publisher}
+			</div>
+		</div>
+		<div class="control-group">
+			<label class="control-label">来源:</label>
+			<div class="controls">
+				${info.source}
+			</div>
+		</div>
+		<div class="control-group">
+			<label class="control-label"><span class="help-inline"></span>推荐语(描述):</label>
+			<div class="controls">
+				${info.recommendContent}
+			</div>
+		</div>
+		<div class="control-group">
+			<label class="control-label"><span class="help-inline"></span>文章内容:</label>
+			<div class="controls" style="width:812px">
+				${info.infoContent}
+			</div>
+		</div>
+		<div class="control-group">
+			<label class="control-label"><span class="help-inline"></span>文章分类:</label>
+			<div class="controls">
+				${info.infoType.name}
+			</div>
+		</div>
+		<div class="control-group">
+			<label class="control-label"><span class="help-inline"></span>引导图:</label>
+			<div class="controls">
+				<img src="${info.guidanceImage}" style="width: 120px">
+				<%--<form:hidden id="nameImage" path="guidanceImage" htmlEscape="false" maxlength="255" class="input-xlarge required"/>
+				<sys:ckfinder input="nameImage" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>--%>
+			</div>
+		</div>
+		<div class="control-group">
+			<label class="control-label"><span class="help-inline"></span>发布时间:</label>
+			<div class="controls">
+				<fmt:formatDate value="${info.pubdate}" pattern="yyyy-MM-dd HH:mm"/>
+			</div>
+		</div>
+		<div class="control-group">
+			<label class="control-label"><span class="help-inline"></span>审核状态:</label>
+			<div class="controls">
+				${info.auditStatus eq 1?'待审核':info.auditStatus eq 2?'审核通过':'审核失败'}
+			</div>
+		</div>
+		<div class="control-group">
+			<label class="control-label"><span class="help-inline"></span>供应商:</label>
+			<div class="controls">
+				${info.shopName}
+			</div>
+		</div>
+		<div class="control-group">
+			<label class="control-label">实际点赞:</label>
+			<div class="controls">
+				${empty info.realPraise?0:(info.realPraise)}
+			</div>
+		</div>
+		<div class="control-group">
+			<label class="control-label">实际浏览量:</label>
+			<div class="controls">
+				${empty info.pv?0:(info.pv)}
+			</div>
+		</div>
+		<div class="form-actions">
+			<input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
+		</div>
+	</form:form>
+<!-- 富文本编辑器 -->
+
+<% request.setAttribute("caimeiCore", Global.getConfig("caimei.core"));%>
+<script type="text/javascript" src="${ctxStatic}/ckeditor5-new/ckeditor.js"></script>
+<script type="text/javascript">
+		$(document).ready(function() {
+			//富文本框
+			ClassicEditor.create(document.querySelector('#infoContentEditor'), {
+				ckfinder: {
+					uploadUrl: '${caimeiCore}/tools/image/upload/ckeditor'
+				}
+			}).then(function(editor) {
+				window.infoContentEditor = editor;
+			}).catch(function(error){
+				console.log(error);
+			});
+			//$("#name").focus();
+			$("#inputForm").validate({
+				ignore:"",
+				submitHandler: function(form){
+					loading('正在提交,请稍等...');
+					form.submit();
+				},
+				errorContainer: "#messageBox",
+				errorPlacement: function(error, element) {
+					$("#messageBox").text("输入有误,请先更正。");
+					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
+						error.appendTo(element.parent().parent());
+					} else {
+						error.insertAfter(element);
+					}
+				}
+			});
+
+			LabelInit();
+
+			$(".init-label label").bind("click",function(){
+				var label=$(this).text();
+				var label1=label+",";
+				var _label=$("#label").val()+",";
+				if(_label.indexOf(label1)>-1){
+					alert("文章标签中已包含该标签!!");
+				}else{
+				  setLabel(label);
+				}
+			});
+
+		});
+
+		//富文本框编辑
+		function checkInfo(){
+			var infoContent=infoContentEditor.getData();
+			$("#infoContent").val(infoContent);
+			console.log(infoContent);
+		}
+		function LabelInit(){
+			var items="${fns:getDictValue('label','sys_config','')}"+",";
+			/* var _labels="${info.label}";
+			var _label=_labels.split(",");
+			for (var i = 0; i < _label.length; i++) {
+				items=items.replace(_label[i]+",","");
+			} */
+			/* var items="美白,祛斑,祛痘,补水,瘦脸,去皱,缩毛孔,减肥瘦身,提拉紧致,嫩肤,去眼袋,去法令纹,脱毛,纹眉,去黑眼圈,美白嫩肤,面部提升,祛斑祛痣,除皱,去红血丝,祛疤,祛妊娠纹,纹身,纤体塑性,纹眉"; */
+			var info=items.split(",");
+			var html='';
+			for (var i = 0; i < info.length; i++) {
+				if(''!=info[i]){
+					html+="<label>"+info[i]+"</label>";
+					if((i+1)%9==0){
+						html+="<br>";
+					}
+				}
+			}
+			$(".init-label").append(html);
+
+
+			$("#labelName").typeahead({
+				property : 'name',
+				source:function(typeahead, query){
+					query = $.trim(query);
+					if(''==query){return;}
+					$.ajax({
+						type:"POST", dataType:"JSON", async:false,
+						url: "${ctx}/info/infoLabel/findByName",
+						data:{name: query},
+						success:function(data){
+							typeahead.process(data);
+						}
+					});
+				},
+				onselect : function(data) {
+					setLabel(data.name);
+					$("#labelName").focus(); //选择完后 回到当前输入框以便下一个动作的验证
+				}
+			});
+		}
+		function setLabel(name){
+			if(name!=''){
+				var label=$("#label").val();
+				if(label==''){
+					label=name;
+				}else{
+					label=label+","+name;
+				}
+				$("#label").val(label);
+				$("#labelName").val("");
+			}
+		}
+		function addLeable(){
+			var label=$("#labelName").val();
+			if(''==label){
+				$.jBox.tip('添加的标签不能为空!','error');
+			}else{
+				setLabel(label);
+			}
+		}
+</script>
+</body>
+</html>

+ 0 - 1
src/main/webapp/WEB-INF/views/modules/info/infoList.jsp

@@ -131,7 +131,6 @@
 
 		//更新置顶
 		function updateTopPosition(topPosition,id,type) {
-			debugger
 			var msg = '';
 			if ('setTopPosition' == type) {
 				msg = '确认置顶该文章吗?';

+ 232 - 0
src/main/webapp/WEB-INF/views/modules/info/shopInfoList.jsp

@@ -0,0 +1,232 @@
+<%@ page import="com.thinkgem.jeesite.common.config.Global" %>
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
+<html>
+<head>
+	<title>文章列表管理</title>
+	<meta name="decorator" content="default"/>
+	<style type="text/css">
+	.table th{text-align: center;}
+	.table td{text-align: center;}
+	.topSelect{
+		width: 80px;
+		position: absolute;
+		right: 50px;
+		background-color: white;
+	}
+	</style>
+
+<% request.setAttribute("caimeiCore", Global.getConfig("caimei.core"));%>
+	<script type="text/javascript">
+		$(document).ready(function() {
+			show_title(16);
+		});
+		function page(n,s){
+			$("#pageNo").val(n);
+			$("#pageSize").val(s);
+			$("#searchForm").submit();
+        	return false;
+        }
+		//状态修改
+		function updateStatus(status,ids,type,enabledStatus){
+			if('recommendStatus'==type){
+				if('0'==enabledStatus){
+					alert("请先把该文章改为启动状态!");
+				}else{
+					update(status,ids,type);
+				}
+			}else{
+					update(status,ids,type);
+			}
+		}
+		function update(status,ids,type){
+			var msg='确定启用?';
+			if('0'==status){
+				msg='确定停用?';
+			}
+			top.$.jBox.confirm(msg,'系统提示',function(v,h,f){
+				if(v=='ok'){
+					$.post("${ctx}/info/info/updateStatus",{'status':status,'ids':ids,'type':type}, function(data) {
+						if(true==data.success){
+							$.jBox.tip(data.msg, 'info');
+						} else {
+							$.jBox.tip(data.msg,'error');
+						}
+			 			$("#searchForm").submit();
+					},"JSON");//这里返回的类型有:json,html,xml,text
+				}
+				return;
+			},{buttonsFocus:1,persistent: true});
+		}
+		function updateType(){
+			var tabmode='${cookie.tabmode.value}';
+			if(tabmode=='1'){
+				addTabPage('修改分类项', '${ctx}/info/infoType');
+			}else{
+				location.href="${ctx}/info/infoType";
+			}
+		}
+
+		// 更新索引
+		function updateIndex(id) {
+			$.post("${caimeiCore}/commodity/search/index/update/article", {articleId: id}, function(res){
+				$.jBox.tip(res.msg, 'info');
+			});
+		}
+		function updateAllIndex(){
+			var submit = function (v, h, f) {
+				if (v == true){
+					$.post("${caimeiCore}/commodity/search/index/article/all", function(res){
+						$.jBox.tip(res.msg, 'info');
+					});
+				}
+				return true;// close
+			};
+			// 自定义按钮
+			$.jBox.confirm("该操作将更新所有商品索引,约耗时10分钟!!请谨慎操作", "更新索引", submit, { buttons: { '确定': true, '取消': false} });
+		}
+
+	</script>
+</head>
+<body>
+	<ul class="nav nav-tabs">
+		<li class="active"><a href="${ctx}/info/info/?publishSource=${info.publishSource}">文章列表</a></li>
+	</ul>
+	<input type="button" class="btn btn-primary" value="更新全部搜索索引" onclick="updateAllIndex()" />
+	<form:form id="searchForm" modelAttribute="info" action="${ctx}/info/info/" method="post" class="breadcrumb form-search">
+		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
+		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
+		<form:hidden path="label"/>
+		<form:hidden path="publishSource"/>
+		<div class="ul-form">
+			 <label>ID:</label>
+				<form:input path="id" htmlEscape="false" maxlength="11" class="input-mini"/>
+			 <label>标题:</label>
+				<form:input path="title" htmlEscape="false" maxlength="100" class="input-medium"/>
+			 <label>发布人:</label>
+				<form:input path="publisher" htmlEscape="false" maxlength="50" class="input-medium"/>
+			 <label>供应商:</label>
+				<form:input path="shopName" htmlEscape="false" maxlength="50" class="input-medium"/>
+				<br> <br>
+			  <label>文章分类:</label>
+				<form:select path="infoType.id" class="input-small">
+					<form:option value="" label=" "/>
+					<form:options items="${typeList}" itemLabel="name" itemValue="id" htmlEscape="false"/>
+				</form:select>
+			 <label>审核状态:</label>
+			 	<form:select path="auditStatus" class="input-mini">
+					<form:option value="" label="全部"/>
+					<form:option value="1" label="待审核"/>
+					<form:option value="2" label="审核通过"/>
+					<form:option value="3" label="审核失败"/>
+				</form:select>
+			&nbsp;&nbsp;<input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
+			<div class="clearfix"></div>
+		</div>
+	</form:form>
+	<sys:message content="${message}"/>
+	<table id="contentTable" class="table table-striped table-bordered table-condensed">
+		<thead>
+			<tr>
+				<th>ID</th>
+				<th>文章分类</th>
+				<th>引导图</th>
+				<th>文章标题</th>
+				<th>实际点赞</th>
+				<th>实际阅读量</th>
+				<th>审核状态</th>
+				<th>发布时间</th>
+				<th>发布人</th>
+				<th>供应商</th>
+				<th>添加时间</th>
+				<shiro:hasPermission name="info:info:edit"><th>操作</th></shiro:hasPermission>
+			</tr>
+		</thead>
+		<tbody>
+		<c:forEach items="${page.list}" var="info" varStatus="index">
+			<tr>
+				<td>${info.id}</td>
+				<td>
+					${info.infoType.name}
+				</td>
+				<td><img src="${info.guidanceImage}" width="100px;" height="100px;" style="width: 100px;height: 100px;"></td>
+				<td class="comitted">
+					${info.title}
+				</td>
+				<td>${empty info.realPraise?0:(info.realPraise)}</td>
+				<td>${empty info.pv?0:(info.pv)}</td>
+				<td><font color="${info.auditStatus eq 1?'black':info.auditStatus eq 2?'#2FA4E7':info.auditStatus eq 3?'red':'#2FA4E7'}"> ${info.auditStatus eq 1?'待审核':info.auditStatus eq 2?'审核通过':info.auditStatus eq 3?'审核失败':'审核通过'}</font></td>
+				<td>
+                    <c:if test="${info.auditStatus eq 2}">
+                        <fmt:formatDate value="${info.pubdate}" pattern="yyyy-MM-dd HH:mm"/>
+                    </c:if>
+                    <c:if test="${info.auditStatus ne 2}">
+                        --
+                    </c:if>
+                </td>
+                <td>
+                    ${info.publisher}
+                </td>
+                <td>
+                    ${info.shopName}
+                </td>
+				<td><fmt:formatDate value="${info.createDate}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
+                <td hidden>
+                    <label id="homePageImage${index.index}">${info.homePageImage}</label>
+                </td>
+				<shiro:hasPermission name="info:info:edit"><td style="width: 150px">
+                    <a href="javascript:;" style="display: ${info.auditStatus eq 1 or info.auditStatus eq 3?'':'none'}"
+					   onclick="auditInfo(${info.id})">审核</a>
+                    <a href="${ctx}/info/info/check?id=${info.id}&publishSource=2">查看</a>
+                    <a href="javascript:void(0);" onclick="updateIndex('${info.id}');">更新索引</a>
+				</td></shiro:hasPermission>
+            </tr>
+		</c:forEach>
+		</tbody>
+	</table>
+	<div class="pagination">${page}</div>
+<script>
+	function auditInfo(infoId) {
+		var url = "${ctx}/info/info/toAuditPage?id=" + infoId;
+		var title = "审核";
+		top.$.jBox("iframe:"+url, {
+			iframeScrolling: 'yes',
+			width: 800,
+			height: 350,
+			persistent: true,
+			title: title,
+			buttons: {"保存": '1', "关闭": '-1'},
+			submit: function (v, h, f) {
+				//确定
+				var $jboxFrame = top.$('#jbox-iframe');
+				var $mainFrame = top.$('#mainFrame');
+				if ('1' == v && 1 == $jboxFrame.size() && 1 == $mainFrame.size()) {
+					var items = $jboxFrame[0].contentWindow.getCheckedItems(0);
+					if (items.length > 0) {
+						var auditStatus = items[0].auditStatus;
+						var failReason = items[0].failReason.trim();
+						if (auditStatus === '2') {
+							failReason = '';
+						}
+						if (auditStatus === '3' && failReason === '') {
+							top.$.jBox.tip("请输入失败原因");
+							return false;
+						}
+						$.post("${ctx}/info/info/auditInfo?id="+infoId+"&auditStatus=" + auditStatus + "&failReason=" + failReason, function (data) {
+							top.$.jBox.tip("审核成功");
+							setTimeout(function () {
+								$("#searchForm").submit();
+							}, 200);
+						});
+					} else {
+						top.$.jBox.tip("请先勾选商品...");
+						return false;
+					}
+				}
+				return true;
+			}
+		});
+	}
+</script>
+</body>
+</html>