heheng
3 天以前 a8a6760635f0642a2cbf61854b5587d9d0944985
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
70
71
72
73
74
package com.gkhy.exam.system.service.impl;
 
import com.gkhy.exam.common.api.CommonPage;
import com.gkhy.exam.common.api.CommonResult;
import com.gkhy.exam.common.utils.PageUtils;
import com.gkhy.exam.common.utils.SecurityUtils;
import com.gkhy.exam.system.domain.Correction;
import com.gkhy.exam.system.domain.Inconsistent;
import com.gkhy.exam.system.mapper.CorrectionMapper;
import com.gkhy.exam.system.service.CorrectionService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
 
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;
 
/**
 * <p>
 * 整改管理 服务实现类
 * </p>
 *
 * @author hh
 * @since 2025-07-10 15:11:50
 */
@Service
public class CorrectionServiceImpl extends ServiceImpl<CorrectionMapper, Correction> implements CorrectionService {
 
    @Autowired
    private CorrectionMapper correctionMapper;
    @Override
    public CommonPage selectCorrectionList(Integer companyId) {
        PageUtils.startPage();
        List<Correction> corrections = correctionMapper.selectCorrectionList(companyId);
        return CommonPage.restPage(corrections);
    }
 
    @Override
    public CommonResult insertCorrection(Correction correction) {
        correction.setCreateBy(SecurityUtils.getUsername());
        correction.setCreateTime(LocalDateTime.now());
        int insert = correctionMapper.insert(correction);
        if (insert > 0){
            return CommonResult.success();
        }
        return CommonResult.failed();
    }
 
    @Override
    public CommonResult updateCorrection(Correction Correction) {
        Correction.setUpdateBy(SecurityUtils.getUsername());
        Correction.setUpdateTime(LocalDateTime.now());
        int insert = correctionMapper.updateById(Correction);
        if (insert > 0){
            return CommonResult.success();
        }
        return CommonResult.failed();
    }
 
    @Override
    public CommonResult deletedCorrection(Integer id) {
        Correction Correction = new Correction();
        Correction.setId(id.longValue());
        Correction.setDelFlag(1);
        Correction.setUpdateBy(SecurityUtils.getUsername());
        Correction.setUpdateTime(LocalDateTime.now());
        int insert = correctionMapper.updateById(Correction);
        if (insert > 0){
            return CommonResult.success();
        }
        return CommonResult.failed();
    }
}