heheng
昨天 6faa8da685a95b1fce5f432f5bd41a870ccb5ade
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
package com.gkhy.exam.system.service.impl;
 
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.gkhy.exam.common.api.CommonPage;
import com.gkhy.exam.common.api.CommonResult;
import com.gkhy.exam.common.constant.UserConstant;
import com.gkhy.exam.common.utils.PageUtils;
import com.gkhy.exam.common.utils.SecurityUtils;
import com.gkhy.exam.system.domain.CalibrationMonitoringEquipment;
import com.gkhy.exam.system.domain.DocumentDestructionApply;
import com.gkhy.exam.system.mapper.DocumentDestructionApplyMapper;
import com.gkhy.exam.system.service.DocumentDestructionApplyService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
 
import java.time.LocalDateTime;
import java.util.List;
 
/**
 * <p>
 * 文件销毁申请主表     服务实现类
 * </p>
 *
 * @author hh
 * @since 2025-08-25 15:01:44
 */
@Service
public class DocumentDestructionApplyServiceImpl extends ServiceImpl<DocumentDestructionApplyMapper, DocumentDestructionApply> implements DocumentDestructionApplyService {
 
 
    @Autowired
    private DocumentDestructionApplyMapper destructionApplyMapper;
 
    @Override
    public CommonPage selectDocumentDestructionApplyList(DocumentDestructionApply documentDestructionApply) {
        PageUtils.startPage();
        List<DocumentDestructionApply> documentDestructionApply1 = destructionApplyMapper.getDocumentDestructionApply(documentDestructionApply);
        return CommonPage.restPage(documentDestructionApply1);
    }
 
    @Override
    public CommonResult saveDocumentDestructionApply(DocumentDestructionApply documentDestructionApply) {
        int i = 0;
        if (documentDestructionApply.getId() == null) {
            documentDestructionApply.setCreateBy(SecurityUtils.getUsername());
            documentDestructionApply.setCreateTime(LocalDateTime.now());
            i = destructionApplyMapper.insert(documentDestructionApply);
        } else {
            documentDestructionApply.setUpdateTime(LocalDateTime.now());
            documentDestructionApply.setUpdateBy(SecurityUtils.getUsername());
            i = destructionApplyMapper.updateById(documentDestructionApply);
        }
        return i > 0 ? CommonResult.success() : CommonResult.failed();
    }
 
    @Override
    public CommonResult deletedDocumentDestructionApply(Long id) {
        destructionApplyMapper.update(new DocumentDestructionApply(), new LambdaUpdateWrapper<DocumentDestructionApply>().eq(DocumentDestructionApply::getId, id)
                .set(DocumentDestructionApply::getDelFlag, UserConstant.DISENABLE).set(DocumentDestructionApply::getUpdateTime, LocalDateTime.now())
                .set(DocumentDestructionApply::getUpdateBy, SecurityUtils.getUsername()));
        return CommonResult.success();
    }
}