kongzy
2024-01-29 983bdb5b89932b38d08a11ad1eed6ea89d1597e1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
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);
    }
}