| | |
| | | package com.ruoyi.system.service.impl.config; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.core.utils.bean.BeanUtils; |
| | | import com.ruoyi.system.api.domain.dto.MgtBaseGetDto; |
| | | import com.ruoyi.system.domain.dto.MgtQuickEntryEditDto; |
| | | import com.ruoyi.system.domain.pojo.config.QuickEntry; |
| | | import com.ruoyi.system.domain.vo.AppQuickEntryVo; |
| | | import com.ruoyi.system.domain.vo.MgtQuickEntryGetVo; |
| | | import com.ruoyi.system.domain.vo.MgtQuickEntryPageVo; |
| | | import com.ruoyi.system.mapper.config.QuickEntryMapper; |
| | | import com.ruoyi.system.service.config.QuickEntryService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | public List<AppQuickEntryVo> listQuickEntryVo(){ |
| | | return quickEntryMapper.listQuickEntryVo(); |
| | | } |
| | | |
| | | @Override |
| | | public List<MgtQuickEntryPageVo> pageMgtQuickEntry(Page page){ |
| | | return quickEntryMapper.pageMgtQuickEntry(page); |
| | | } |
| | | |
| | | /** |
| | | * @description 平台修改快速入口 |
| | | * @author jqs |
| | | * @date 2023/6/7 10:20 |
| | | * @param mgtQuickEntryEditDto |
| | | * @return void |
| | | */ |
| | | @Override |
| | | public void editMgtQuickEntry(MgtQuickEntryEditDto mgtQuickEntryEditDto){ |
| | | QuickEntry quickEntry; |
| | | // 如果管理快速入口ID不为空,则获取该管理快速入口 |
| | | if (mgtQuickEntryEditDto.getEntryId() != null) { |
| | | quickEntry = this.getById(mgtQuickEntryEditDto.getEntryId()); |
| | | } else { |
| | | // 否则,创建新的管理快速入口 |
| | | quickEntry = new QuickEntry(); |
| | | quickEntry.setDelFlag(0); |
| | | } |
| | | // 将管理快速入口编辑DTO的属性复制到管理快速入口中 |
| | | BeanUtils.copyProperties(mgtQuickEntryEditDto, quickEntry); |
| | | // 设置创建时间和创建者ID |
| | | quickEntry.setCreateTime(new Date()); |
| | | quickEntry.setCreateUserId(mgtQuickEntryEditDto.getEntryId()); |
| | | // 保存或更新管理快速入口 |
| | | this.saveOrUpdate(quickEntry); |
| | | } |
| | | |
| | | /** |
| | | * @description 平台获取快速入口编辑信息 |
| | | * @author jqs |
| | | * @date 2023/6/7 10:30 |
| | | * @param quickEntryId |
| | | * @return MgtQuickEntryGetVo |
| | | */ |
| | | @Override |
| | | public MgtQuickEntryGetVo getMgtQuickEntry(Long quickEntryId){ |
| | | QuickEntry quickEntry = this.getById(quickEntryId); |
| | | if(quickEntry.getTargetType()==1){ |
| | | quickEntry.setJumpType(null); |
| | | quickEntry.setJumpId(null); |
| | | quickEntry.setLinkType(null); |
| | | }else if(quickEntry.getTargetType()==2){ |
| | | if(quickEntry.getLinkType()==1){ |
| | | quickEntry.setJumpType(null); |
| | | quickEntry.setJumpId(null); |
| | | }else{ |
| | | quickEntry.setLinkUrl(null); |
| | | } |
| | | }else if(quickEntry.getTargetType()==3){ |
| | | quickEntry.setLinkUrl(null); |
| | | quickEntry.setLinkType(null); |
| | | quickEntry.setJumpType(null); |
| | | quickEntry.setJumpId(null); |
| | | } |
| | | MgtQuickEntryGetVo mgtQuickEntryGetVo = new MgtQuickEntryGetVo(); |
| | | BeanUtils.copyProperties(quickEntry, mgtQuickEntryGetVo); |
| | | return mgtQuickEntryGetVo; |
| | | } |
| | | |
| | | /** |
| | | * @description 平台删除快速入口 |
| | | * @author jqs |
| | | * @date 2023/6/7 10:35 |
| | | * @param mgtBaseGetDto |
| | | * @return void |
| | | */ |
| | | @Override |
| | | public void deleteMgtQuickEntry(MgtBaseGetDto mgtBaseGetDto){ |
| | | QuickEntry quickEntry = this.getById(Long.valueOf(mgtBaseGetDto.getId())); |
| | | quickEntry.setDelFlag(1); |
| | | this.saveOrUpdate(quickEntry); |
| | | } |
| | | } |