package com.gkhy.assess.system.service.impl;
|
|
import com.gkhy.assess.common.api.CommonPage;
|
import com.gkhy.assess.common.enums.DeleteFlagEnum;
|
import com.gkhy.assess.common.utils.PageUtil;
|
import com.gkhy.assess.system.domain.AssProcessAudit;
|
import com.gkhy.assess.system.domain.AssRecitification;
|
import com.gkhy.assess.system.mapper.AssRecitificationMapper;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.gkhy.assess.system.service.AssProjectService;
|
import com.gkhy.assess.system.service.AssRecitificationService;
|
import com.gkhy.assess.system.utils.ShiroUtils;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.stereotype.Service;
|
|
import java.util.List;
|
|
/**
|
* <p>
|
* 项目整改情况说明表 服务实现类
|
* </p>
|
*
|
* @author kzy
|
* @since 2023-12-12 10:46:54
|
*/
|
@Service
|
public class AssRecitificationServiceImpl extends ServiceImpl<AssRecitificationMapper, AssRecitification> implements AssRecitificationService {
|
@Autowired
|
private AssProjectService projectService;
|
@Override
|
public CommonPage recitificationList(Long projectId) {
|
projectService.checkUserAllowed(projectId);
|
PageUtil.startPage();
|
List<AssRecitification> recitifications=baseMapper.recitificationList(projectId);
|
return CommonPage.restPage(recitifications);
|
}
|
|
@Override
|
public int addRecitification(AssRecitification recitification) {
|
projectService.checkUserAllowed(recitification.getProjectId());
|
recitification.setCreateBy(ShiroUtils.getSysUser().getUsername());
|
int row=baseMapper.insert(recitification);
|
return row;
|
}
|
|
@Override
|
public int editRecitification(AssRecitification recitification) {
|
projectService.checkUserAllowed(recitification.getProjectId());
|
recitification.setUpdateBy(ShiroUtils.getSysUser().getUsername());
|
int row =baseMapper.updateById(recitification);
|
return row;
|
}
|
|
@Override
|
public int deleteById(Long recitificationId) {
|
AssRecitification recitification=getById(recitificationId);
|
projectService.checkUserAllowed(recitification.getProjectId());
|
recitification=new AssRecitification()
|
.setId(recitificationId)
|
.setDelFlag(DeleteFlagEnum.DELETED.getCode());
|
recitification.setUpdateBy(ShiroUtils.getSysUser().getUsername());
|
return baseMapper.updateById(recitification);
|
}
|
|
@Override
|
public AssRecitification getRecitificationById(Long recitificationId) {
|
return getById(recitificationId);
|
}
|
}
|