|
|
|
|
@ -29,7 +29,10 @@ import com.biutag.lan.enums.WorkType;
|
|
|
|
|
import com.biutag.lan.flow.*; |
|
|
|
|
import com.biutag.lan.flow.node.FirstSignFlow; |
|
|
|
|
import com.biutag.lan.mapper.MailMapper; |
|
|
|
|
import com.biutag.lan.mapper.MailSourceMapper; |
|
|
|
|
import com.biutag.lan.mapper.WorkMapper; |
|
|
|
|
import com.biutag.lan.validate.commons.MailIdValidate; |
|
|
|
|
import jakarta.annotation.Resource; |
|
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
|
import org.springframework.beans.BeanUtils; |
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
|
@ -75,6 +78,9 @@ public class MailService extends ServiceImpl<MailMapper, Mail> {
|
|
|
|
|
|
|
|
|
|
private final IHolidayService holidayService; |
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
private MailSourceMapper mailSourceMapper; |
|
|
|
|
|
|
|
|
|
@Lazy |
|
|
|
|
@Autowired |
|
|
|
|
private List<Flow> flowNodes; |
|
|
|
|
@ -438,4 +444,21 @@ public class MailService extends ServiceImpl<MailMapper, Mail> {
|
|
|
|
|
} |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public boolean delete(MailIdValidate mailId) { |
|
|
|
|
if (mailId.getId()==null||mailId.getId().equals("")){ |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
Mail mail = baseMapper.selectById(mailId.getId()); |
|
|
|
|
if (mailId.getId()!=null||!mailId.getId().equals("")){ |
|
|
|
|
if (mail.getFlowKey().equals(FlowNodeEnum.FIRST_SIGN.getKey())||mail.getFlowKey().equals(FlowNodeEnum.FIRST_DISTRIBUTE.getKey())){ |
|
|
|
|
baseMapper.deleteById(mailId.getId()); |
|
|
|
|
mailSourceMapper.deleteById(mailId.getId()); |
|
|
|
|
workMapper.delete(new LambdaQueryWrapper<Work>().eq(Work::getMailId, mailId.getId())); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|