|
|
|
|
@ -7,6 +7,9 @@ import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
import com.ruoyi.common.utils.StringUtils;
|
|
|
|
|
import com.ruoyi.portal.domain.HwProductInfoDetail;
|
|
|
|
|
import com.ruoyi.portal.service.IHwSearchRebuildService;
|
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
import com.ruoyi.portal.mapper.HwWebMenuMapper;
|
|
|
|
|
@ -22,9 +25,14 @@ import com.ruoyi.portal.service.IHwWebMenuService;
|
|
|
|
|
@Service
|
|
|
|
|
public class HwWebMenuServiceImpl implements IHwWebMenuService
|
|
|
|
|
{
|
|
|
|
|
private static final Logger log = LoggerFactory.getLogger(HwWebMenuServiceImpl.class);
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private HwWebMenuMapper hwWebMenuMapper;
|
|
|
|
|
|
|
|
|
|
@Autowired(required = false)
|
|
|
|
|
private IHwSearchRebuildService hwSearchRebuildService;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 查询haiwei官网菜单
|
|
|
|
|
*
|
|
|
|
|
@ -69,7 +77,12 @@ public class HwWebMenuServiceImpl implements IHwWebMenuService
|
|
|
|
|
@Override
|
|
|
|
|
public int insertHwWebMenu(HwWebMenu hwWebMenu)
|
|
|
|
|
{
|
|
|
|
|
return hwWebMenuMapper.insertHwWebMenu(hwWebMenu);
|
|
|
|
|
int rows = hwWebMenuMapper.insertHwWebMenu(hwWebMenu);
|
|
|
|
|
if (rows > 0)
|
|
|
|
|
{
|
|
|
|
|
rebuildSearchIndexQuietly();
|
|
|
|
|
}
|
|
|
|
|
return rows;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
@ -81,7 +94,12 @@ public class HwWebMenuServiceImpl implements IHwWebMenuService
|
|
|
|
|
@Override
|
|
|
|
|
public int updateHwWebMenu(HwWebMenu hwWebMenu)
|
|
|
|
|
{
|
|
|
|
|
return hwWebMenuMapper.updateHwWebMenu(hwWebMenu);
|
|
|
|
|
int rows = hwWebMenuMapper.updateHwWebMenu(hwWebMenu);
|
|
|
|
|
if (rows > 0)
|
|
|
|
|
{
|
|
|
|
|
rebuildSearchIndexQuietly();
|
|
|
|
|
}
|
|
|
|
|
return rows;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
@ -93,7 +111,12 @@ public class HwWebMenuServiceImpl implements IHwWebMenuService
|
|
|
|
|
@Override
|
|
|
|
|
public int deleteHwWebMenuByWebMenuIds(Long[] webMenuIds)
|
|
|
|
|
{
|
|
|
|
|
return hwWebMenuMapper.deleteHwWebMenuByWebMenuIds(webMenuIds);
|
|
|
|
|
int rows = hwWebMenuMapper.deleteHwWebMenuByWebMenuIds(webMenuIds);
|
|
|
|
|
if (rows > 0)
|
|
|
|
|
{
|
|
|
|
|
rebuildSearchIndexQuietly();
|
|
|
|
|
}
|
|
|
|
|
return rows;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
@ -105,7 +128,12 @@ public class HwWebMenuServiceImpl implements IHwWebMenuService
|
|
|
|
|
@Override
|
|
|
|
|
public int deleteHwWebMenuByWebMenuId(Long webMenuId)
|
|
|
|
|
{
|
|
|
|
|
return hwWebMenuMapper.deleteHwWebMenuByWebMenuId(webMenuId);
|
|
|
|
|
int rows = hwWebMenuMapper.deleteHwWebMenuByWebMenuId(webMenuId);
|
|
|
|
|
if (rows > 0)
|
|
|
|
|
{
|
|
|
|
|
rebuildSearchIndexQuietly();
|
|
|
|
|
}
|
|
|
|
|
return rows;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
@ -165,5 +193,21 @@ public class HwWebMenuServiceImpl implements IHwWebMenuService
|
|
|
|
|
private boolean hasChild(List<HwWebMenu> list, HwWebMenu t) {
|
|
|
|
|
return !getChildList(list, t).isEmpty();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void rebuildSearchIndexQuietly()
|
|
|
|
|
{
|
|
|
|
|
if (hwSearchRebuildService == null)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
hwSearchRebuildService.rebuildAll();
|
|
|
|
|
}
|
|
|
|
|
catch (Exception e)
|
|
|
|
|
{
|
|
|
|
|
log.error("rebuild portal search index failed after hw_web_menu changed", e);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|