| | |
| | | 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> |
| | |
| | | @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; |
| | | } |
| | | } |