wlzboy
6 天以前 09e6dc3fb7266620fafb5e341808a8eb36e080a1
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
package com.ruoyi.system.task;
 
import com.ruoyi.system.domain.SysTaskAttachment;
import com.ruoyi.system.mapper.SysTaskAttachmentMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
 
@Service
public class TaskAttachmentServiceImpl implements ITaskAttachmentService{
 
    @Autowired
    private SysTaskAttachmentMapper taskAttachmentMapper;
 
    /**
     * 检查附件是否已同步
     */
    @Override
    public boolean isAttachmentSynced(Long attachmentId) {
        if (attachmentId == null) {
            return false;
        }
 
        SysTaskAttachment attachment = taskAttachmentMapper.selectSysTaskAttachmentByAttachmentId(attachmentId);
        if (attachment == null) {
            return false;
        }
 
        return attachment.getSyncedToImageData() != null && attachment.getSyncedToImageData() == 1;
    }
 
    @Override
    public boolean updateAttachment(SysTaskAttachment attachment) {
        return taskAttachmentMapper.updateSysTaskAttachment(attachment) > 0;
    }
}