Przeglądaj źródła

信息中心的文章广告(PC)增加排序功能

JiangChongBo 2 lat temu
rodzic
commit
d0f7010950

+ 11 - 1
src/main/java/com/caimei/modules/info/entity/InfoAd.java

@@ -20,7 +20,17 @@ public class InfoAd extends DataEntity<InfoAd> {
 	private String guidanceImage;		// 引导图
 	private Long clickRate;		// 点击量
 	private String enabledStatus;		// 启用/禁用状态
-//	private String soft;      //排序值
+	private Integer soft;//排序值
+
+	public Integer getSoft() {
+		return soft;
+	}
+
+	public void setSoft(Integer soft) {
+		this.soft = soft;
+	}
+
+	//	private String soft;      //排序值
 //	public void setSoft(String soft) {
 //		this.soft = soft;
 //	}

+ 8 - 4
src/main/resources/mappings/modules/info/InfoAdMapper.xml

@@ -16,7 +16,8 @@
 		a.createBy AS "createBy.id",
 		a.createDate AS "createDate",
 		a.updateBy AS "updateBy.id",
-		a.updateDate AS "updateDate"
+		a.updateDate AS "updateDate",
+		a.soft as "soft"
 	</sql>
 	
 	<sql id="infoAdJoins">
@@ -94,7 +95,8 @@
 			createBy,
 			createDate,
 			updateBy,
-			updateDate
+			updateDate,
+			soft
 		) VALUES (
 			#{serviceObject},
 			#{link},
@@ -107,7 +109,8 @@
 			#{createBy.id},
 			#{createDate},
 			#{updateBy.id},
-			#{updateDate}
+			#{updateDate},
+			#{soft}
 		)
 	</insert>
 	
@@ -122,7 +125,8 @@
 			clickRate = #{clickRate},
 			enabledStatus = #{enabledStatus},
 			updateBy = #{updateBy.id},
-			updateDate = #{updateDate}
+			updateDate = #{updateDate},
+			soft=#{soft}
 		WHERE id = #{id}
 	</update>
 	

+ 6 - 0
src/main/webapp/WEB-INF/views/modules/info/infoAdForm.jsp

@@ -97,6 +97,12 @@
 				</form:select>
 			</div>
 		</div>
+		<div class="control-group">
+			<label class="control-label"><span class="help-inline"><font color="red">*</font> </span>排序值:</label>
+			<div class="controls">
+				<form:input path="soft" htmlEscape="false" maxlength="11" class="input-xlarge required" type="number"/>
+			</div>
+		</div>
 		<div class="form-actions">
 			<shiro:hasPermission name="info:infoAd:edit"><input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>&nbsp;</shiro:hasPermission>
 			<input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>

+ 5 - 4
src/main/webapp/WEB-INF/views/modules/info/infoAdList.jsp

@@ -79,7 +79,7 @@
 				<th>广告位置</th>
 				<th>引导图</th>
 				<th>链接</th>
-<%--				<th>排序</th>--%>
+				<th>排序</th>
 				<th>点击量</th>
 				<th>添加时间</th>
 				<th>状态</th>
@@ -102,9 +102,10 @@
 				<td>
 					${infoAd.link}
 				</td>
-<%--				<td>--%>
-<%--						<input id="soft" value="${infoAd.soft}" onblur="savaSoftValue()">--%>
-<%--				</td>--%>
+				<td>
+<%--					<input id="soft" value="${infoAd.soft}" maxlength="11">--%>
+						${infoAd.soft}
+				</td>
 				<td>
 					${empty infoAd.clickRate?0:(infoAd.clickRate)}
 				</td>