Aslee před 3 roky
rodič
revize
c3bdfb55df

+ 2 - 2
src/main/java/com/caimei/modules/baike/service/CmBaikeProductService.java

@@ -115,9 +115,9 @@ public class CmBaikeProductService extends CrudService<CmBaikeProductDao, CmBaik
 		List<CmBaikeProduct> topCmBaikeProductList = findTopList();
 		List<CmBaikeProduct> topCmBaikeProductList = findTopList();
 		topCmBaikeProductList.forEach(topCmBaikeProduct->{
 		topCmBaikeProductList.forEach(topCmBaikeProduct->{
 			Integer topPosition = topCmBaikeProduct.getTopPosition();
 			Integer topPosition = topCmBaikeProduct.getTopPosition();
-			if (topCmBaikeProduct.getTopPosition()>oldPosition) {
+			if (topPosition>oldPosition) {
 				topCmBaikeProduct.setTopPosition(--topPosition);
 				topCmBaikeProduct.setTopPosition(--topPosition);
-				updateTopPosition(cmBaikeProduct);
+				updateTopPosition(topCmBaikeProduct);
 			}
 			}
 		});
 		});
 	}
 	}

+ 3 - 0
src/main/java/com/caimei/modules/info/service/InfoService.java

@@ -61,6 +61,9 @@ public class InfoService extends CrudService<InfoDao, Info> {
 	}
 	}
 
 
 	public Page<Info> findPage(Page<Info> page, Info info) {
 	public Page<Info> findPage(Page<Info> page, Info info) {
+		if (null != info.getPublishSource() && 2 == info.getPublishSource()) {
+			page.setOrderBy("a.createDate desc");
+		}
 		Page<Info> infoPage = super.findPage(page, info);
 		Page<Info> infoPage = super.findPage(page, info);
 		List<Info> infoList = infoPage.getList();
 		List<Info> infoList = infoPage.getList();
 		infoList.forEach(infoItem -> {
 		infoList.forEach(infoItem -> {

+ 4 - 0
src/main/resources/mappings/modules/baike/CmBaikeProductMapper.xml

@@ -73,6 +73,9 @@
 					</when>
 					</when>
 				</choose>
 				</choose>
 			</if>
 			</if>
+			<if test="topPosition != null">
+				and topPosition = #{topPosition}
+			</if>
 			<if test="status != null">
 			<if test="status != null">
 				AND a.status = #{status}
 				AND a.status = #{status}
 			</if>
 			</if>
@@ -85,6 +88,7 @@
 				ORDER BY ${page.orderBy}
 				ORDER BY ${page.orderBy}
 			</when>
 			</when>
 			<otherwise>
 			<otherwise>
+				order by a.addTime desc
 			</otherwise>
 			</otherwise>
 		</choose>
 		</choose>
 	</select>
 	</select>

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

@@ -111,7 +111,7 @@
 				and a.auditStatus = #{auditStatus}
 				and a.auditStatus = #{auditStatus}
 			</if>
 			</if>
 			<if test="shopName != null and shopName != ''">
 			<if test="shopName != null and shopName != ''">
-				AND s.name LIKE concat('%,',#{shopName},',%')
+				AND s.name LIKE concat('%',#{shopName},'%')
 			</if>
 			</if>
 				<!--  AND b.enabledStatus='1' -->
 				<!--  AND b.enabledStatus='1' -->
 		</where>
 		</where>

+ 0 - 1
src/main/webapp/WEB-INF/views/modules/baike/cmBaikeBannerForm.jsp

@@ -233,7 +233,6 @@
 
 
 		<div class="form-actions">
 		<div class="form-actions">
 			<input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>&nbsp;
 			<input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>&nbsp;
-			<input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
 		</div>
 		</div>
 	</form:form>
 	</form:form>
 <script>
 <script>

+ 18 - 18
src/main/webapp/WEB-INF/views/modules/baike/cmBaikeHotSearchForm.jsp

@@ -51,7 +51,7 @@
 		<div class="control-group">
 		<div class="control-group">
 			<label class="control-label"><span class="help-inline"><font color="red">*</font> </span>跳转方式:</label>
 			<label class="control-label"><span class="help-inline"><font color="red">*</font> </span>跳转方式:</label>
 			<div class="controls">
 			<div class="controls">
-				<form:radiobutton path="jumpType"  name="jumpType" value="1" label="仅搜索" checked="true"/>
+				<form:radiobutton path="jumpType"  name="jumpType" value="1" label="仅搜索" checked="true" onclick="changeJumpType()"/>
 				<br> <br>
 				<br> <br>
 				<form:radiobutton path="jumpType" name="jumpType" value="2" label="产品" onclick="changeJumpType()"/>
 				<form:radiobutton path="jumpType" name="jumpType" value="2" label="产品" onclick="changeJumpType()"/>
 				<form:select path="productId" class="input-xlarge productList">
 				<form:select path="productId" class="input-xlarge productList">
@@ -69,15 +69,6 @@
 				<form:input path="jumpLink" htmlEscape="false" class="input-xlarge jumpType"/>
 				<form:input path="jumpLink" htmlEscape="false" class="input-xlarge jumpType"/>
 			</div>
 			</div>
 		</div>
 		</div>
-		<%--<div class="control-group">
-			<label class="control-label">产品/仪器id:</label>
-			<div class="controls">
-				<form:select path="productId" class="input-xlarge ">
-					<form:option value="" label=""/>
-					<form:options items="${fns:getDictList('')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
-				</form:select>
-			</div>
-		</div>--%>
 		<div class="control-group">
 		<div class="control-group">
 			<label class="control-label"><span class="help-inline"><font color="red">*</font> </span>排序:</label>
 			<label class="control-label"><span class="help-inline"><font color="red">*</font> </span>排序:</label>
 			<div class="controls">
 			<div class="controls">
@@ -104,18 +95,27 @@
 	});
 	});
 
 
 	function changeJumpType() {
 	function changeJumpType() {
+		debugger
 		var jumpType = $("input[name='jumpType']:checked").val();
 		var jumpType = $("input[name='jumpType']:checked").val();
-		var productList = $("#productId");
-		var instrumentList = $("#instrumentId");
+		var productId = $("#productId");
+		var instrumentId = $("#instrumentId");
+		var jumpLink = $("#jumpLink");
 		if (jumpType == 2) {
 		if (jumpType == 2) {
-			productList.addClass("required");
-			instrumentList.removeClass("required");
+			productId.addClass("required");
+			instrumentId.removeClass("required");
+			jumpLink.removeClass("required");
 		} else if (jumpType == 3) {
 		} else if (jumpType == 3) {
-			productList.removeClass("required");
-			instrumentList.addClass("required");
+			productId.removeClass("required");
+			instrumentId.addClass("required");
+			jumpLink.removeClass("required");
+		} else if (jumpType == 4){
+			productId.removeClass("required");
+			instrumentId.removeClass("required");
+			jumpLink.addClass("required");
 		} else {
 		} else {
-			productList.removeClass("required");
-			instrumentList.removeClass("required");
+			productId.removeClass("required");
+			instrumentId.removeClass("required");
+			jumpLink.removeClass("required");
 		}
 		}
 	}
 	}
 </script>
 </script>

+ 2 - 3
src/main/webapp/WEB-INF/views/modules/baike/cmBaikeProductList.jsp

@@ -120,7 +120,7 @@
 					</c:if>
 					</c:if>
 				</td>
 				</td>
 				<td>
 				<td>
-					<a href="javascript:;">查看</a>
+					<a href="${fns:getConfig('wwwServer')}encyclopedia/${cmBaikeProduct.commodityType eq 1?'product':'instrument'}-${cmBaikeProduct.id}.html">查看</a>
     				<a href="${ctx}/baike/cmBaikeProduct/form?id=${cmBaikeProduct.id}">编辑</a>
     				<a href="${ctx}/baike/cmBaikeProduct/form?id=${cmBaikeProduct.id}">编辑</a>
 					<a href="${ctx}/baike/cmBaikeProduct/delete?id=${cmBaikeProduct.id}" onclick="return confirmx('确认要删除该产品吗?', this.href)">删除</a>
 					<a href="${ctx}/baike/cmBaikeProduct/delete?id=${cmBaikeProduct.id}" onclick="return confirmx('确认要删除该产品吗?', this.href)">删除</a>
 					<a onclick="showTopSelect(${index.index},'open')" href="javascript:void(0)">首页置顶</a>
 					<a onclick="showTopSelect(${index.index},'open')" href="javascript:void(0)">首页置顶</a>
@@ -150,7 +150,7 @@
 	<div class="pagination">${page}</div>
 	<div class="pagination">${page}</div>
 <script type="text/javascript">
 <script type="text/javascript">
 	function updateStatus(status, productId) {
 	function updateStatus(status, productId) {
-		var commodityType = ${commodityType}
+		var commodityType = '${commodityType}'
 		var msg='确定启用该'+commodityType+'吗?';
 		var msg='确定启用该'+commodityType+'吗?';
 		if(0==status) {
 		if(0==status) {
 			msg = '确定停用该'+commodityType+'吗?';
 			msg = '确定停用该'+commodityType+'吗?';
@@ -174,7 +174,6 @@
 
 
 	//展示置顶选项
 	//展示置顶选项
 	function showTopSelect(index,status) {
 	function showTopSelect(index,status) {
-		debugger
 		if ('open' == status) {
 		if ('open' == status) {
 			document.getElementById("topSelect" + index).style.cssText = "display:block";
 			document.getElementById("topSelect" + index).style.cssText = "display:block";
 		}else if ('close' == status) {
 		}else if ('close' == status) {