|
@@ -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) {
|