Merge branch 'feature/bug-635' into test

This commit is contained in:
曹鹏飞 2025-08-28 15:28:05 +08:00
commit 4b60e9de10
3 changed files with 13 additions and 1 deletions

View File

@ -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.TicketSolutionAudit;
import javax.validation.constraints.NotNull;
import java.util.List;
/**
@ -28,4 +29,6 @@ public interface ITicketSolutionAuditService extends IService<TicketSolutionAudi
boolean pass(Integer ticketId);
TicketSolutionAudit getByTicketAndUser(Integer ticketId, Integer userId);
boolean canUpdate(@NotNull Integer ticketId);
}

View File

@ -207,4 +207,10 @@ public class TicketSolutionAuditServiceImpl extends ServiceImpl<TicketSolutionAu
.last("limit 1")
.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()));
}
}

View File

@ -121,6 +121,9 @@ public class TicketSolutionServiceImpl extends ServiceImpl<TicketSolutionMapper,
VUtils.trueThrowBusinessError(!Objects.equals(ticket.getState(), TicketState.Processing.getState())
&& !Objects.equals(ticket.getState(), TicketState.ProcessingCompleted.getState()))
.throwMessage("当前工单状态不允许修改解决方案");
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> handleIds= StrUtil.split(ticket.getHandle(),",").stream().map(Integer::parseInt).collect(Collectors.toList());