Browse Source

fix 添加发布审核

温红权 6 years ago
parent
commit
3c8e1b5270

+ 34 - 0
.classpath

@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" output="target/classes" path="src/main/java">
+		<attributes>
+			<attribute name="optional" value="true"/>
+			<attribute name="maven.pomderived" value="true"/>
+		</attributes>
+	</classpathentry>
+	<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
+		<attributes>
+			<attribute name="maven.pomderived" value="true"/>
+		</attributes>
+	</classpathentry>
+	<classpathentry kind="src" output="target/test-classes" path="src/test/java">
+		<attributes>
+			<attribute name="test" value="true"/>
+			<attribute name="optional" value="true"/>
+			<attribute name="maven.pomderived" value="true"/>
+		</attributes>
+	</classpathentry>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">
+		<attributes>
+			<attribute name="maven.pomderived" value="true"/>
+		</attributes>
+	</classpathentry>
+	<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
+		<attributes>
+			<attribute name="maven.pomderived" value="true"/>
+			<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
+		</attributes>
+	</classpathentry>
+	<classpathentry kind="con" path="org.eclipse.jst.server.core.container/org.eclipse.jst.server.tomcat.runtimeTarget/Apache Tomcat v8.0"/>
+	<classpathentry kind="output" path="target/classes"/>
+</classpath>

+ 1 - 0
.gitignore

@@ -0,0 +1 @@
+/target/

+ 37 - 0
.project

@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>ycjt-ggcx</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.wst.common.project.facet.core.builder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.wst.validation.validationbuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.m2e.core.maven2Builder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
+		<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+		<nature>org.eclipse.m2e.core.maven2Nature</nature>
+		<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
+		<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
+	</natures>
+</projectDescription>

+ 13 - 0
.settings/.jsdtscope

@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry excluding="**/bower_components/*|**/node_modules/*|**/*.min.js" kind="src" path="src/main/webapp"/>
+	<classpathentry kind="src" path="target/m2e-wtp/web-resources"/>
+	<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.JRE_CONTAINER"/>
+	<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.WebProject">
+		<attributes>
+			<attribute name="hide" value="true"/>
+		</attributes>
+	</classpathentry>
+	<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.baseBrowserLibrary"/>
+	<classpathentry kind="output" path=""/>
+</classpath>

+ 3 - 0
.settings/org.eclipse.core.resources.prefs

@@ -0,0 +1,3 @@
+eclipse.preferences.version=1
+encoding//src/main/java=UTF-8
+encoding//src/test/java=UTF-8

+ 9 - 0
.settings/org.eclipse.jdt.core.prefs

@@ -0,0 +1,9 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
+org.eclipse.jdt.core.compiler.compliance=1.7
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
+org.eclipse.jdt.core.compiler.release=disabled
+org.eclipse.jdt.core.compiler.source=1.7

+ 4 - 0
.settings/org.eclipse.m2e.core.prefs

@@ -0,0 +1,4 @@
+activeProfiles=
+eclipse.preferences.version=1
+resolveWorkspaceProjects=true
+version=1

+ 10 - 0
.settings/org.eclipse.wst.common.component

@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
+    <wb-module deploy-name="ycjt-ggcx-2.1-SNAPSHOT">
+        <wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
+        <wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
+        <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
+        <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
+        <property name="context-root" value="ycjt-ggcx"/>
+        <property name="java-output-path" value="/ycjt-ggcx/target/classes"/>
+    </wb-module>
+</project-modules>

+ 7 - 0
.settings/org.eclipse.wst.common.project.facet.core.prefs.xml

@@ -0,0 +1,7 @@
+<root>
+  <facet id="jst.jaxrs">
+    <node name="libprov">
+      <attribute name="provider-id" value="jaxrs-no-op-library-provider"/>
+    </node>
+  </facet>
+</root>

+ 8 - 0
.settings/org.eclipse.wst.common.project.facet.core.xml

@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<faceted-project>
+  <fixed facet="wst.jsdt.web"/>
+  <installed facet="java" version="1.7"/>
+  <installed facet="jst.web" version="3.0"/>
+  <installed facet="jst.jaxrs" version="1.1"/>
+  <installed facet="wst.jsdt.web" version="1.0"/>
+</faceted-project>

+ 1 - 0
.settings/org.eclipse.wst.jsdt.ui.superType.container

@@ -0,0 +1 @@
+org.eclipse.wst.jsdt.launching.baseBrowserLibrary

+ 1 - 0
.settings/org.eclipse.wst.jsdt.ui.superType.name

@@ -0,0 +1 @@
+Window

+ 2 - 0
.settings/org.eclipse.wst.validation.prefs

@@ -0,0 +1,2 @@
+disabled=06target
+eclipse.preferences.version=1

+ 2 - 0
src/main/java/cn/com/liandisys/ycjt/ggcx/admin/controller/cms/ArticleController.java

@@ -9,6 +9,7 @@ import java.util.List;
 import java.util.Map;
 import java.util.PropertyResourceBundle;
 
+import org.apache.shiro.SecurityUtils;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.domain.Page;
@@ -106,6 +107,7 @@ public class ArticleController {
         page.setList(jpaPage.getContent());
         model.addAttribute("page", page);
         model.addAttribute("message", message);
+        model.addAttribute("user",SecurityUtils.getSubject().getPrincipal());
         //System.out.println(masterKey);
         //System.out.println(appKey);
         return "admin/cms/articleList";

+ 4 - 2
src/main/java/cn/com/liandisys/ycjt/ggcx/admin/model/cms/Article.java

@@ -38,7 +38,7 @@ import cn.com.liandisys.ycjt.ggcx.admin.utils.CmsUtils;
 public class Article implements Serializable {
 
     public static final String DEFAULT_TEMPLATE = "frontViewArticle";
-    public static final String DEL_FLAG_NORMAL = "0";
+    public static final String DEL_FLAG_NORMAL = "1";
 	
 	private static final long serialVersionUID = 1L;
 	private String id;// 实体编号(唯一标识)
@@ -77,7 +77,9 @@ public class Article implements Serializable {
 	private String files; // 附件存储路径
 	private String publisheDate;
 	
-    
+
+
+
 	@Id
     @GeneratedValue(generator = "system-uuid")
     @GenericGenerator(name = "system-uuid", strategy = "uuid")

+ 10 - 6
src/main/resources/application.properties

@@ -1,6 +1,6 @@
 #***************************************  Oracle  ********************************************#
-jdbc.username		=	scott
-jdbc.password			=	123
+jdbc.username		=	ycjt
+jdbc.password			=	ycjtAdmin2016
 hibernate.dialect		=	org.hibernate.dialect.Oracle10gDialect
 
 dbcp.maxIdle=5
@@ -8,13 +8,17 @@ dbcp.maxActive=40
 
 #log4jdbc driver
 jdbc.driver=net.sf.log4jdbc.sql.jdbcapi.DriverSpy
-jdbc.url=jdbc:log4jdbc:oracle:thin:@172.16.52.105:1521:ycjtDB
+#jdbc.url=jdbc:log4jdbc:oracle:thin:@172.16.52.105:1521:ycjtDB
+jdbc.url=jdbc:log4jdbc:oracle:thin:@127.0.0.1:8400:ycjtDB
 
 #redis settings
 #redis-server redis.windows.conf
 redis.keyPrefix=shiro_session_
-redis.host=172.16.52.105
-redis.port=6379
+#redis.host=172.16.52.105
+#redis.port=6379
+redis.host = 127.0.0.1
+redis.port = 8408
+
 
 #============================#
 #===== System settings ======#
@@ -23,7 +27,7 @@ productName=\u8D44\u8BAF\u53D1\u5E03\u7BA1\u7406\u7CFB\u7EDF
 copyrightYear=2016
 version=V1.0
 siteUrl=http://localhost:8080/ycjt-ggcx
-support=http://www.liandisys.com.cn
+#support=http://www.liandisys.com.cn
 
 #CMS config
 adminPath=/admin

+ 1 - 1
src/main/resources/log4j.properties

@@ -4,7 +4,7 @@
 #log4j.appender.stdout.layout.ConversionPattern=%-5p %d{HH:mm:ss} %c - %m%n
 
 
-log4j.rootLogger=ERROR
+log4j.rootLogger=INFO
 
 #DEBUG log
 log4j.appender.DEBUG=org.apache.log4j.ConsoleAppender

+ 8 - 2
src/main/webapp/WEB-INF/views/admin/cms/articleList.jsp

@@ -41,7 +41,7 @@
 	</form:form>
 	<sys:message content="${message}"/>
 	<table id="contentTable" class="table table-striped table-bordered table-condensed">
-		<thead><tr><th>栏目</th><th>标题</th><th>点击数</th><th>发布者</th><th>更新时间</th><th>手动修改发布时间</th><th>操作</th></tr></thead>
+		<thead><tr><th>栏目</th><th>标题</th><th>点击数</th><th>发布者</th><th>更新时间</th><th>手动修改发布时间</th><th>是否发布</th><th>操作</th></tr></thead>
 		<tbody>
 		<c:forEach items="${page.list}" var="article">
 			<tr>
@@ -56,11 +56,17 @@
 				</c:if>
 				<td><fmt:formatDate value="${article.updateDate}" type="both"/></td>
 				<td>${article.publisheDate}</td>
+				<td>${article.delFlag eq 1?"否":"是"}</td>
 				<td>
 				     <%-- <a href="${pageContext.request.contextPath}/front/view-${article.category.id}-${article.id}${fns:getUrlSuffix()}" target="_blank">访问</a>  --%>
 					<a href="${pageContext.request.contextPath}/main?sign=${pageContext.request.contextPath}/front/view-${article.category.id}-${article.id}${fns:getUrlSuffix()}" target="_blank">访问</a>
     				<a href="${ctx}/cms/article/form?id=${article.id}&TempcategoryId=${categoryId}">修改</a>
-					<a href="${ctx}/cms/article/delete?id=${article.id}${article.delFlag ne 0?'&isRe=true':''}&categoryId=${article.category.id}" onclick="return confirmx('确认要${article.delFlag ne 0?'发布':'删除'}该文章吗?', this.href)" >${article.delFlag ne 0?'发布':'删除'}</a>
+					<a href="${ctx}/cms/article/delete?id=${article.id}&categoryId=${article.category.id}" onclick="return confirmx('确认要删除该文章吗?', this.href)" >删除</a>
+					<c:if test="${article.delFlag eq 1 && user.loginName!='ycjtj'}">
+					
+				<a href="${ctx}/cms/article/delete?id=${article.id}&isRe=true&categoryId=${article.category.id}" onclick="return confirmx('确认要发布该文章吗?', this.href)" >发布</a>
+				</c:if>
+					
 				</td>
 			</tr>
 		</c:forEach>