fix:修复重复点位问题
This commit is contained in:
@@ -35,6 +35,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -197,9 +198,27 @@ public class FTGTask extends AbstractTask {
|
|||||||
SchBasePoint schBasePoint = pointService.selectByPointCode(point);
|
SchBasePoint schBasePoint = pointService.selectByPointCode(point);
|
||||||
if (ObjectUtil.isNotEmpty(schBasePoint)) {
|
if (ObjectUtil.isNotEmpty(schBasePoint)) {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
|
SchBaseTask one = taskService.getOne(
|
||||||
|
Wrappers.lambdaQuery(SchBaseTask.class)
|
||||||
|
.and(w -> w
|
||||||
|
.eq(SchBaseTask::getPoint_code1, point)
|
||||||
|
.or()
|
||||||
|
.eq(SchBaseTask::getPoint_code2, point)
|
||||||
|
)
|
||||||
|
.in(SchBaseTask::getTask_status,
|
||||||
|
TaskStatus.APPLY.getCode(),
|
||||||
|
TaskStatus.CREATED.getCode(),
|
||||||
|
TaskStatus.ISSUED.getCode(),
|
||||||
|
TaskStatus.EXECUTING.getCode())
|
||||||
|
.orderByDesc(SchBaseTask::getCreate_time)
|
||||||
|
.last("limit 1")
|
||||||
|
);
|
||||||
LambdaUpdateWrapper<SchBasePoint> updateWrapper = Wrappers.lambdaUpdate(SchBasePoint.class)
|
LambdaUpdateWrapper<SchBasePoint> updateWrapper = Wrappers.lambdaUpdate(SchBasePoint.class)
|
||||||
.eq(SchBasePoint::getPoint_code, point)
|
.eq(SchBasePoint::getPoint_code, point);
|
||||||
.set(SchBasePoint::getIs_lock, false);
|
if (Objects.equals(one.getTask_id(), taskObj.getTask_id())){
|
||||||
|
updateWrapper.set(SchBasePoint::getIs_lock, false);
|
||||||
|
}
|
||||||
if (StrUtil.isNotEmpty(pointStatus)) {
|
if (StrUtil.isNotEmpty(pointStatus)) {
|
||||||
if (status == 0) {
|
if (status == 0) {
|
||||||
updateWrapper.set(SchBasePoint::getPoint_status, pointStatus)
|
updateWrapper.set(SchBasePoint::getPoint_status, pointStatus)
|
||||||
|
|||||||
Reference in New Issue
Block a user