Browse Source

Merge remote-tracking branch 'origin/master'

master
21819 2 years ago
parent
commit
ac6684da15
  1. 8
      mailbox-lan/src/main/java/com/biutag/lan/controller/MailController.java
  2. 23
      mailbox-lan/src/main/java/com/biutag/lan/service/MailService.java

8
mailbox-lan/src/main/java/com/biutag/lan/controller/MailController.java

@ -11,9 +11,11 @@ import com.biutag.lan.domain.bo.InvalidCompletion;
import com.biutag.lan.domain.bo.MailOuter;
import com.biutag.lan.domain.vo.MailFlowDetail;
import com.biutag.lan.service.MailService;
import com.biutag.lan.validate.commons.MailIdValidate;
import jakarta.validation.Valid;
import lombok.RequiredArgsConstructor;
import org.simpleframework.xml.core.Validate;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
@Validate
@ -42,6 +44,12 @@ public class MailController {
return AjaxResult.success(mailService.next(action));
}
@NotPower
@PostMapping("delete")
public AjaxResult<Boolean> delete(@RequestBody @Valid MailIdValidate id) {
return AjaxResult.success(mailService.delete(id));
}
/**
* 延期审批
* @param body

23
mailbox-lan/src/main/java/com/biutag/lan/service/MailService.java

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

Loading…
Cancel
Save