| | |
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import com.yeshi.fanli.entity.SystemEnum;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoService;
|
| | | import org.springframework.stereotype.Service;
|
| | |
|
| | | import com.yeshi.fanli.dao.mybatis.homemodule.HomeNavbarUserMapper;
|
| | |
| | | @Resource
|
| | | private UserInfoExtraService userInfoExtraService;
|
| | |
|
| | | @Resource
|
| | | private UserInfoService userInfoService;
|
| | |
|
| | |
|
| | | @Override
|
| | | public List<HomeNavbar> listEffectiveNavbar(Long uid, String device, Integer sex) {
|
| | | List<HomeNavbar> list = new ArrayList<HomeNavbar>();
|
| | |
|
| | | SystemEnum system = userInfoService.getUserSystem(uid);
|
| | |
|
| | | if (sex == null || sex == 0) {
|
| | | if (uid != null || !StringUtil.isNullOrEmpty(device)) {
|
| | |
| | |
|
| | | if (listUserNavbar != null && listUserNavbar.size() > 0) {
|
| | | // 固定导航
|
| | | List<HomeNavbar> listFixed = homeNavbarService.listQueryFixedNavbar();
|
| | | List<HomeNavbar> listFixed = homeNavbarService.listQueryFixedNavbar(system);
|
| | | if (listFixed != null && listFixed.size() > 0) {
|
| | | list.addAll(listFixed);
|
| | | }
|
| | |
| | | }
|
| | |
|
| | | if (list.size() == 0) {
|
| | | List<HomeNavbar> listDefault = homeNavbarService.listQueryDefaultNavbar(sex);
|
| | | List<HomeNavbar> listDefault = homeNavbarService.listQueryDefaultNavbar(sex, system);
|
| | | if (listDefault != null) {
|
| | | list.addAll(listDefault);
|
| | | }
|
| | | }
|
| | | } else {
|
| | | List<HomeNavbar> listDefault = homeNavbarService.listQueryDefaultNavbar(sex);
|
| | | List<HomeNavbar> listDefault = homeNavbarService.listQueryDefaultNavbar(sex, system);
|
| | | if (listDefault != null) {
|
| | | list.addAll(listDefault);
|
| | | }
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public List<HomeNavbar> restoreSystemDefault(Long uid, String device) throws HomeNavbarUserException {
|
| | | public List<HomeNavbar> restoreSystemDefault(Long uid, String device,SystemEnum system) throws HomeNavbarUserException {
|
| | | if (uid == null && StringUtil.isNullOrEmpty(device)) {
|
| | | throw new HomeNavbarUserException(1, "参数不正确");
|
| | | }
|
| | |
| | | homeNavbarUserMapper.deleteByDevice(device);
|
| | | }
|
| | | // 返回有效的
|
| | | return homeNavbarService.listQueryEffectiveNavbar();
|
| | | return homeNavbarService.listQueryEffectiveNavbar(system);
|
| | | }
|
| | |
|
| | | @Override
|