| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.core.mp.base.BaseServiceImpl; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.sxkj.fw.device.dto.FwDeviceScrapDTO; |
| | |
| | | import org.sxkj.fw.device.service.IFwDeviceService; |
| | | import org.sxkj.fw.device.vo.FwDeviceScrapVO; |
| | | import org.sxkj.fw.device.wrapper.FwDeviceScrapWrapper; |
| | | import org.sxkj.system.cache.SysCache; |
| | | |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | private final IFwDeviceService fwDeviceService; |
| | | |
| | | @Override |
| | | public FwDeviceScrapVO getFwDeviceScrapById(Long id) { |
| | | return baseMapper.getFwDeviceScrapById(id); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional |
| | | public boolean saveFwDeviceScrap(FwDeviceScrapDTO dto) { |
| | | boolean isSuccess = super.save(FwDeviceScrapWrapper.build().entityDTO(dto)); |
| | |
| | | FwDeviceEntity fwDevice = new FwDeviceEntity(); |
| | | fwDevice.setId(dto.getDeviceId()); |
| | | fwDevice.setStatus(3); |
| | | isSuccess = fwDeviceService.updateById(fwDevice); |
| | | isSuccess = fwDeviceService.updateById(fwDevice) && fwDeviceService.deleteLogic(Collections.singletonList(fwDevice.getId())); |
| | | } |
| | | return isSuccess; |
| | | } |
| | | |
| | | @Override |
| | | public IPage<FwDeviceScrapVO> selectFwDeviceScrapPage(IPage<FwDeviceScrapVO> page, FwDeviceScrapDTO fwDeviceScrap) { |
| | | List<Long> deptList = SysCache.getDeptChildIds(Long.valueOf(AuthUtil.getDeptId())); |
| | | fwDeviceScrap.setDeptList(deptList); |
| | | return page.setRecords(baseMapper.selectFwDeviceScrapPage(page, fwDeviceScrap)); |
| | | } |
| | | |