Browse Source

信息中心V1.3.9

kaick 1 year ago
parent
commit
1d3fc21772

+ 9 - 5
src/main/java/com/caimei/modules/info/service/InfoTypeService.java

@@ -1,5 +1,7 @@
 package com.caimei.modules.info.service;
 package com.caimei.modules.info.service;
 
 
+import java.util.Collection;
+import java.util.Collections;
 import java.util.Date;
 import java.util.Date;
 import java.util.List;
 import java.util.List;
 
 
@@ -42,7 +44,6 @@ public class InfoTypeService extends CrudService<InfoTypeDao, InfoType> {
 
 
 	@Transactional(readOnly = false)
 	@Transactional(readOnly = false)
 	public void save(InfoType infoType) {
 	public void save(InfoType infoType) {
-		infoType.setEnabledStatus("1");
 		if ("0".equals(infoType.getParentId())) {
 		if ("0".equals(infoType.getParentId())) {
 			infoType.setParentIds("0");
 			infoType.setParentIds("0");
 		} else {
 		} else {
@@ -70,10 +71,13 @@ public class InfoTypeService extends CrudService<InfoTypeDao, InfoType> {
 		InfoType infoType1 = new InfoType();
 		InfoType infoType1 = new InfoType();
 		infoType1.setParentIds(infoType.getId());
 		infoType1.setParentIds(infoType.getId());
 		List<InfoType> byInfoTypeIdList = getByInfoTypeList(infoType1);
 		List<InfoType> byInfoTypeIdList = getByInfoTypeList(infoType1);
-		byInfoTypeIdList.forEach(byInfoTypeId -> {
-			super.delete(byInfoTypeId);
-			cmBrandLandingMapper.delCmBrandLandingByAuthorId(byInfoTypeId.getId());
-		});
+		if(0<byInfoTypeIdList.size()){
+			byInfoTypeIdList.forEach(byInfoTypeId -> {
+				super.delete(byInfoTypeId);
+				cmBrandLandingMapper.delCmBrandLandingByAuthorId(byInfoTypeId.getId());
+			});
+		}
+
 	}
 	}
 
 
 	public List<InfoType> getByInfoTypeList(InfoType infoType) {
 	public List<InfoType> getByInfoTypeList(InfoType infoType) {

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

@@ -105,10 +105,11 @@
 			$("#typeListId option[value=" + $("#optionType option:selected").attr("parent") + "]").prop("selected", true);
 			$("#typeListId option[value=" + $("#optionType option:selected").attr("parent") + "]").prop("selected", true);
 			optionTypeParent()
 			optionTypeParent()
 			isoptionType()
 			isoptionType()
+			$("input[type='radio'][name='publishSource']").change(function (obj) {
+				$("#searchForm").submit();
+			})
 		})
 		})
-		$("input[name=publishSource]").change(function () {
-			$("#searchForm").submit();
-		})
+
 	</script>
 	</script>
 </head>
 </head>
 <body>
 <body>
@@ -148,7 +149,7 @@
 				</c:if>
 				</c:if>
 			</c:forEach>
 			</c:forEach>
 		</form:select>
 		</form:select>
-		<form:select id="optionType" path="" class="input-small" onchange="isoptionType()">
+		<form:select id="optionType" path="typeId" class="input-small" onchange="isoptionType()">
 			<form:option value="" label=" "/>
 			<form:option value="" label=" "/>
 			<c:forEach items="${typeList}" var="type" varStatus="index">
 			<c:forEach items="${typeList}" var="type" varStatus="index">
 				<c:if test="${type.parentId ne 0}">
 				<c:if test="${type.parentId ne 0}">

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

@@ -244,7 +244,7 @@
 				</c:if>
 				</c:if>
 			</c:forEach>
 			</c:forEach>
 		</form:select>
 		</form:select>
-		<form:select id="optionType" path="" class="input-small" onchange="isoptionType()">
+		<form:select id="optionType" path="typeId" class="input-small" onchange="isoptionType()">
 			<form:option value="" label=" "/>
 			<form:option value="" label=" "/>
 			<c:forEach items="${typeList}" var="type" varStatus="index">
 			<c:forEach items="${typeList}" var="type" varStatus="index">
 				<c:if test="${type.parentId ne 0}">
 				<c:if test="${type.parentId ne 0}">

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

@@ -148,7 +148,7 @@
 				</c:if>
 				</c:if>
 			</c:forEach>
 			</c:forEach>
 		</form:select>
 		</form:select>
-		<form:select id="optionType" path="" class="input-small" onchange="isoptionType()">
+		<form:select id="optionType" path="info.infoType.id" class="input-small" onchange="isoptionType()">
 			<form:option value="" label=" "/>
 			<form:option value="" label=" "/>
 			<c:forEach items="${typeList}" var="type" varStatus="index">
 			<c:forEach items="${typeList}" var="type" varStatus="index">
 				<c:if test="${type.parentId ne 0}">
 				<c:if test="${type.parentId ne 0}">

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

@@ -21,7 +21,6 @@
 				var str = $(this).val();
 				var str = $(this).val();
 				var index = $(this).attr("name").match(/\[(\S*)\]/)[1]
 				var index = $(this).attr("name").match(/\[(\S*)\]/)[1]
 				if (str == 0) {
 				if (str == 0) {
-					$("input[name='cmBrandLandingList["+index+"].jumpLink']").val("")
 					$("input[name='cmBrandLandingList["+index+"].jumpLink']").attr("disabled", true)
 					$("input[name='cmBrandLandingList["+index+"].jumpLink']").attr("disabled", true)
 					$("input[name='cmBrandLandingList["+index+"].jumpLink']").attr("class", "input-xlarge  ")
 					$("input[name='cmBrandLandingList["+index+"].jumpLink']").attr("class", "input-xlarge  ")
 				} else if (str == 2) {
 				} else if (str == 2) {
@@ -41,6 +40,7 @@
 							return false
 							return false
 						}
 						}
 					}
 					}
+					$("input[type='submit']").attr("disabled", true)
 					loading('正在提交,请稍等...');
 					loading('正在提交,请稍等...');
 					form.submit();
 					form.submit();
 				},
 				},

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

@@ -123,7 +123,7 @@
 					</c:if>
 					</c:if>
 					<a href="${ctx}/info/infoType/form?id=${infoType.id}">编辑</a>
 					<a href="${ctx}/info/infoType/form?id=${infoType.id}">编辑</a>
 				<shiro:hasPermission name="info:infoType:delete">
 				<shiro:hasPermission name="info:infoType:delete">
-					<a href="${ctx}/info/infoType/delete?id=${infoType.id}&type=1&parentId=${infoType.parentId}" onclick="return confirmx('确认要删除该文章分类吗?', this.href)">删除</a>
+					<a href="${ctx}/info/infoType/delete?id=${infoType.id}&type=1&parentId=${infoType.parentId}" onclick=" return confirmx('确认要删除该文章分类吗?', this.href);">删除</a>
 				</shiro:hasPermission>
 				</shiro:hasPermission>
 				</td></shiro:hasPermission>
 				</td></shiro:hasPermission>
 			</tr>
 			</tr>

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

@@ -151,7 +151,7 @@
 					</c:if>
 					</c:if>
 				</c:forEach>
 				</c:forEach>
 			</form:select>
 			</form:select>
-			<form:select id="optionType" path="" class="input-small" onchange="isoptionType()">
+			<form:select id="optionType" path="typeId" class="input-small" onchange="isoptionType()">
 				<form:option value="" label=" "/>
 				<form:option value="" label=" "/>
 				<c:forEach items="${typeList}" var="type" varStatus="index">
 				<c:forEach items="${typeList}" var="type" varStatus="index">
 					<c:if test="${type.parentId ne 0}">
 					<c:if test="${type.parentId ne 0}">