|
|
|
@ -1,5 +1,6 @@ |
|
|
|
|
package digital.laboratory.platform.entrustment.service.impl; |
|
|
|
|
|
|
|
|
|
import cn.hutool.core.collection.CollUtil; |
|
|
|
|
import cn.hutool.core.util.StrUtil; |
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
|
@ -22,6 +23,7 @@ import org.springframework.stereotype.Service; |
|
|
|
|
import javax.annotation.Resource; |
|
|
|
|
import java.time.LocalDate; |
|
|
|
|
import java.util.List; |
|
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* @author ChenJiangBao |
|
|
|
@ -52,6 +54,15 @@ public class EntrustAlterApplyServiceImpl extends ServiceImpl<EntrustAlterApplyM |
|
|
|
|
*/ |
|
|
|
|
@Override |
|
|
|
|
public EntrustAlterApplyVO save(EntrustAlterApplyDTO dto) { |
|
|
|
|
// 对当前委托进行校验,如果有关联该委托的申请信息,判断状态如果不是已完成则提示先完成当前申请
|
|
|
|
|
List<EntrustAlterApply> preApplyInfo = super.list(Wrappers.<EntrustAlterApply>lambdaQuery().eq(EntrustAlterApply::getEntrustId, dto.getEntrustId())); |
|
|
|
|
if (CollUtil.isNotEmpty(preApplyInfo)) { |
|
|
|
|
List<EntrustAlterApply> unfinishedList = preApplyInfo.stream().filter(e -> !e.getStatus().equals(EntrustAlterApplyStatus.FINISHED.getStatus())).collect(Collectors.toList()); |
|
|
|
|
if (CollUtil.isNotEmpty(unfinishedList)) { |
|
|
|
|
throw new RuntimeException("该委托存在未完成的申请信息,请先完成其他申请后再进行申请修改!"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
EntrustAlterApply entrustAlterApply = new EntrustAlterApply(); |
|
|
|
|
if (StrUtil.isBlank(dto.getId())) { |
|
|
|
|
entrustAlterApply.setEntrustId(dto.getEntrustId()); |
|
|
|
|