zss
2024-10-24 a00890e840b80a741f62eb6cb31b46f13be6202f
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
package com.yuanchu.mom.service.impl;
 
import com.yuanchu.mom.pojo.InsOrderFile;
import com.yuanchu.mom.mapper.InsOrderFileMapper;
import com.yuanchu.mom.service.InsOrderFileService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
 
import javax.annotation.Resource;
import java.io.File;
 
/**
 * <p>
 * 检验单下的附件列表 服务实现类
 * </p>
 *
 * @author 江苏鵷雏网络科技有限公司
 * @since 2024-06-06 10:08:21
 */
@Service
public class InsOrderFileServiceImpl extends ServiceImpl<InsOrderFileMapper, InsOrderFile> implements InsOrderFileService {
 
    @Resource
    private InsOrderFileMapper insOrderFileMapper;
 
    @Value("${wordUrl}")
    private String wordUrl;
 
    //删除附件
    @Override
    public int delfile(Integer id) {
        InsOrderFile insOrderFile = insOrderFileMapper.selectById(id);
        File file = new File(wordUrl + "/" + insOrderFile.getFileUrl());
        file.delete();
        insOrderFileMapper.deleteById(id);
        return 0;
    }
}