feat: bug-635 CQM提交结案审核,出于审核中,以及审核同意的工单,不允许任何人更改解决方案;只有还未提交审核,或者审核不同意的,才允许CQM更改解决方案
This commit is contained in:
parent
bb415c9b70
commit
62111aefd4
|
|
@ -7,6 +7,7 @@ import com.nflg.mobilebroken.common.pojo.vo.SolutionReviewDepartmentVO;
|
||||||
import com.nflg.mobilebroken.repository.entity.Ticket;
|
import com.nflg.mobilebroken.repository.entity.Ticket;
|
||||||
import com.nflg.mobilebroken.repository.entity.TicketSolutionAudit;
|
import com.nflg.mobilebroken.repository.entity.TicketSolutionAudit;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -28,4 +29,6 @@ public interface ITicketSolutionAuditService extends IService<TicketSolutionAudi
|
||||||
boolean pass(Integer ticketId);
|
boolean pass(Integer ticketId);
|
||||||
|
|
||||||
TicketSolutionAudit getByTicketAndUser(Integer ticketId, Integer userId);
|
TicketSolutionAudit getByTicketAndUser(Integer ticketId, Integer userId);
|
||||||
|
|
||||||
|
boolean canUpdate(@NotNull Integer ticketId);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -201,4 +201,10 @@ public class TicketSolutionAuditServiceImpl extends ServiceImpl<TicketSolutionAu
|
||||||
.last("limit 1")
|
.last("limit 1")
|
||||||
.one();
|
.one();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canUpdate(Integer ticketId) {
|
||||||
|
List<TicketSolutionAudit> list = lambdaQuery().eq(TicketSolutionAudit::getTicketId, ticketId).list();
|
||||||
|
return CollectionUtil.isEmpty(list) || list.stream().anyMatch(it -> Objects.equals(0, it.getState()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -121,7 +121,10 @@ public class TicketSolutionServiceImpl extends ServiceImpl<TicketSolutionMapper,
|
||||||
VUtils.trueThrowBusinessError(!Objects.equals(ticket.getState(), TicketState.Processing.getState())
|
VUtils.trueThrowBusinessError(!Objects.equals(ticket.getState(), TicketState.Processing.getState())
|
||||||
&& !Objects.equals(ticket.getState(), TicketState.ProcessingCompleted.getState()))
|
&& !Objects.equals(ticket.getState(), TicketState.ProcessingCompleted.getState()))
|
||||||
.throwMessage("当前工单状态不允许修改解决方案");
|
.throwMessage("当前工单状态不允许修改解决方案");
|
||||||
Integer userId=AdminUserUtil.getUserId();
|
VUtils.trueThrowBusinessError(Objects.equals(ticket.getState(), TicketState.ProcessingCompleted.getState())
|
||||||
|
&& !ticketSolutionAuditService.canUpdate(request.getTicketId()))
|
||||||
|
.throwMessage("部门主管审核中,不允许修改解决方案");
|
||||||
|
Integer userId = AdminUserUtil.getUserId();
|
||||||
List<Integer> cqmIds=adminUserService.getCQMIds();
|
List<Integer> cqmIds=adminUserService.getCQMIds();
|
||||||
List<Integer> handleIds= StrUtil.split(ticket.getHandle(),",").stream().map(Integer::parseInt).collect(Collectors.toList());
|
List<Integer> handleIds= StrUtil.split(ticket.getHandle(),",").stream().map(Integer::parseInt).collect(Collectors.toList());
|
||||||
VUtils.trueThrowBusinessError(cqmIds.stream().noneMatch(uid -> Objects.equals(uid, userId))
|
VUtils.trueThrowBusinessError(cqmIds.stream().noneMatch(uid -> Objects.equals(uid, userId))
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue