| | |
| | | package com.gkhy.assess.system.service.impl; |
| | | |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.gkhy.assess.common.api.CommonPage; |
| | | import com.gkhy.assess.common.enums.DeleteFlagEnum; |
| | | import com.gkhy.assess.common.exception.ApiException; |
| | | import com.gkhy.assess.common.utils.PageUtil; |
| | | import com.gkhy.assess.system.domain.SysLaw; |
| | | import com.gkhy.assess.system.domain.SysNotice; |
| | | import com.gkhy.assess.system.domain.SysUser; |
| | | import com.gkhy.assess.system.mapper.SysNoticeMapper; |
| | | import com.gkhy.assess.system.service.SysNoticeService; |
| | | import com.gkhy.assess.system.utils.ShiroUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | |
| | | |
| | | @Override |
| | | public int deleteNoticeById(Long noticeId) { |
| | | boolean b=removeById(noticeId); |
| | | SysNotice sysNotice=new SysNotice().setId(noticeId) |
| | | .setDelFlag(DeleteFlagEnum.DELETED.getCode()); |
| | | sysNotice.setUpdateBy(ShiroUtils.getSysUser().getName()); |
| | | boolean b=updateById(sysNotice); |
| | | if(!b){ |
| | | throw new ApiException("删除通知失败"); |
| | | } |
| | |
| | | |
| | | @Override |
| | | public int changeNoticeStatus(SysNotice notice) { |
| | | return editNotice(notice); |
| | | checkNoticeDataScope(notice.getId()); |
| | | SysNotice nc=new SysNotice().setId(notice.getId()).setStatus(notice.getStatus()); |
| | | nc.setUpdateBy(ShiroUtils.getSysUser().getUsername()); |
| | | return baseMapper.updateById(nc); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public SysNotice checkNoticeDataScope(Long noticeId) { |
| | | if(noticeId==null){ |
| | | throw new ApiException("通知id为空!"); |
| | | } |
| | | SysNotice notice = baseMapper.getNoticeById(noticeId); |
| | | if (ObjectUtil.isNull(notice)) |
| | | { |
| | | throw new ApiException("通知数据不存在!"); |
| | | } |
| | | return notice; |
| | | } |
| | | } |