|
@@ -8,6 +8,7 @@ import com.ktg.iscs.domain.dto.hardwareApi.*;
|
|
|
import com.ktg.iscs.domain.enums.KeyStatusEnum;
|
|
import com.ktg.iscs.domain.enums.KeyStatusEnum;
|
|
|
import com.ktg.iscs.domain.enums.LockStatusEnum;
|
|
import com.ktg.iscs.domain.enums.LockStatusEnum;
|
|
|
import com.ktg.iscs.domain.enums.LocksetStatusEnum;
|
|
import com.ktg.iscs.domain.enums.LocksetStatusEnum;
|
|
|
|
|
+import com.ktg.iscs.domain.enums.PointStatusEnum;
|
|
|
import com.ktg.iscs.domain.vo.hardwareApi.JobTicketKeyVO;
|
|
import com.ktg.iscs.domain.vo.hardwareApi.JobTicketKeyVO;
|
|
|
import com.ktg.iscs.domain.vo.hardwareApi.JobTicketLockVO;
|
|
import com.ktg.iscs.domain.vo.hardwareApi.JobTicketLockVO;
|
|
|
import com.ktg.iscs.domain.vo.hardwareApi.JobTicketLocksetVO;
|
|
import com.ktg.iscs.domain.vo.hardwareApi.JobTicketLocksetVO;
|
|
@@ -47,6 +48,8 @@ public class HardwareApiServiceImpl implements HardwareApiService {
|
|
|
private IIsJobTicketLocksetService iIsJobTicketLocksetService;
|
|
private IIsJobTicketLocksetService iIsJobTicketLocksetService;
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private IIsHardwareService isHardwareService;
|
|
private IIsHardwareService isHardwareService;
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private IIsJobTicketPointsService iIsJobTicketPointsService;
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -247,7 +250,7 @@ public class HardwareApiServiceImpl implements HardwareApiService {
|
|
|
public Boolean updateTicketLockPoint(LockPointDTO dto) {
|
|
public Boolean updateTicketLockPoint(LockPointDTO dto) {
|
|
|
Assert.notNull(dto.getTicketId(), "请告诉我关于哪个作业票!");
|
|
Assert.notNull(dto.getTicketId(), "请告诉我关于哪个作业票!");
|
|
|
Assert.notBlank(dto.getLockNfc(), "挂锁nfc缺失!");
|
|
Assert.notBlank(dto.getLockNfc(), "挂锁nfc缺失!");
|
|
|
- Assert.notNull(dto.getPointNfc(), "请告知隔离点信息!");
|
|
|
|
|
|
|
+ Assert.notBlank(dto.getPointNfc(), "请告知隔离点信息!");
|
|
|
// 1.通过nfc查询挂锁信息
|
|
// 1.通过nfc查询挂锁信息
|
|
|
IsLock lock = iIsLockService.getOne(Wrappers.<IsLock>lambdaQuery()
|
|
IsLock lock = iIsLockService.getOne(Wrappers.<IsLock>lambdaQuery()
|
|
|
.eq(IsLock::getLockNfc, dto.getLockNfc()));
|
|
.eq(IsLock::getLockNfc, dto.getLockNfc()));
|
|
@@ -261,7 +264,7 @@ public class HardwareApiServiceImpl implements HardwareApiService {
|
|
|
.eq(IsJobTicketLock::getTicketId, dto.getTicketId())
|
|
.eq(IsJobTicketLock::getTicketId, dto.getTicketId())
|
|
|
.eq(IsJobTicketLock::getLockId, lock.getLockId())
|
|
.eq(IsJobTicketLock::getLockId, lock.getLockId())
|
|
|
.set(IsJobTicketLock::getIsolationPointId, point.getPointId())
|
|
.set(IsJobTicketLock::getIsolationPointId, point.getPointId())
|
|
|
- .set(IsJobTicketLock::getLockStatus, LockStatusEnum.RETURN_LOCK.status));
|
|
|
|
|
|
|
+ .set(IsJobTicketLock::getLockStatus, LockStatusEnum.LOCKED.status));
|
|
|
return true;
|
|
return true;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -282,6 +285,63 @@ public class HardwareApiServiceImpl implements HardwareApiService {
|
|
|
return true;
|
|
return true;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public Boolean updateLockPointBatch(List<LockPointBatchDTO> list) {
|
|
|
|
|
+ Assert.isFalse(list.isEmpty(), "没有接收到数据啊!");
|
|
|
|
|
+ // 情况复杂,循环处理
|
|
|
|
|
+ for (LockPointBatchDTO dto : list) {
|
|
|
|
|
+ Assert.notNull(dto.getTicketId(), "请告诉我关于哪个作业票!");
|
|
|
|
|
+ Assert.notBlank(dto.getLockNfc(), "挂锁nfc缺失!");
|
|
|
|
|
+ Assert.notBlank(dto.getPointNfc(), "请告知隔离点信息!");
|
|
|
|
|
+ Assert.notNull(dto.getTarget(), "请告我是去挂锁还是解锁!");
|
|
|
|
|
+ Assert.notNull(dto.getStatus(), "请告我任务当前状态!");
|
|
|
|
|
+ Assert.notBlank(dto.getKeyNfc(), "钥匙信息不可为空!");
|
|
|
|
|
+ // 1.通过nfc查询挂锁信息
|
|
|
|
|
+ IsLock lock = iIsLockService.getOne(Wrappers.<IsLock>lambdaQuery()
|
|
|
|
|
+ .eq(IsLock::getLockNfc, dto.getLockNfc()));
|
|
|
|
|
+ Assert.notNull(lock, "该nfc无对应的挂锁信息");
|
|
|
|
|
+ // 1..通过nfc查询钥匙信息
|
|
|
|
|
+ IsKey key = isKeyService.getOne(Wrappers.<IsKey>lambdaQuery()
|
|
|
|
|
+ .eq(IsKey::getKeyNfc, dto.getKeyNfc()));
|
|
|
|
|
+ Assert.notNull(lock, "该nfc无对应的挂锁信息");
|
|
|
|
|
+ // 2.通过nfc查询隔离点信息
|
|
|
|
|
+ IsIsolationPoint point = iIsIsolationPointService.getOne(Wrappers.<IsIsolationPoint>lambdaQuery()
|
|
|
|
|
+ .eq(IsIsolationPoint::getPointNfc, dto.getPointNfc()));
|
|
|
|
|
+ Assert.notNull(point, "该nfc无对应的隔离点信息");
|
|
|
|
|
+ Date date = new Date();
|
|
|
|
|
+ if (dto.getTarget().equals(0)) {
|
|
|
|
|
+ // 2.1更新隔离点上锁信息
|
|
|
|
|
+ iIsJobTicketPointsService.update(Wrappers.<IsJobTicketPoints>lambdaUpdate()
|
|
|
|
|
+ .eq(IsJobTicketPoints::getTicketId, dto.getTicketId())
|
|
|
|
|
+ .eq(IsJobTicketPoints::getPointId, point.getPointId())
|
|
|
|
|
+ .set(IsJobTicketPoints::getLockId, lock.getLockId())
|
|
|
|
|
+ .set(IsJobTicketPoints::getLockedByKeyId, key.getKeyId())
|
|
|
|
|
+ .set(IsJobTicketPoints::getLockTime, date)
|
|
|
|
|
+ .set(IsJobTicketPoints::getPointStatus, PointStatusEnum.LOCKED.status));
|
|
|
|
|
+ // 3.开始更新上锁时挂锁信息
|
|
|
|
|
+ iIsJobTicketLockService.update(Wrappers.<IsJobTicketLock>lambdaUpdate()
|
|
|
|
|
+ .eq(IsJobTicketLock::getTicketId, dto.getTicketId())
|
|
|
|
|
+ .eq(IsJobTicketLock::getLockId, lock.getLockId())
|
|
|
|
|
+ .set(IsJobTicketLock::getIsolationPointId, point.getPointId())
|
|
|
|
|
+ .set(IsJobTicketLock::getLockStatus, LockStatusEnum.LOCKED.status));
|
|
|
|
|
+ } else {
|
|
|
|
|
+ // 2.1.1更新隔离点解锁信息
|
|
|
|
|
+ iIsJobTicketPointsService.update(Wrappers.<IsJobTicketPoints>lambdaUpdate()
|
|
|
|
|
+ .eq(IsJobTicketPoints::getTicketId, dto.getTicketId())
|
|
|
|
|
+ .eq(IsJobTicketPoints::getPointId, point.getPointId())
|
|
|
|
|
+ .set(IsJobTicketPoints::getUnlockedByKeyId, key.getKeyId())
|
|
|
|
|
+ .set(IsJobTicketPoints::getUnlockTime, date)
|
|
|
|
|
+ .set(IsJobTicketPoints::getPointStatus, PointStatusEnum.REMOVE_LOCK.status));
|
|
|
|
|
+ // 3.1开始更新解锁时挂锁信息
|
|
|
|
|
+ iIsJobTicketLockService.update(Wrappers.<IsJobTicketLock>lambdaUpdate()
|
|
|
|
|
+ .eq(IsJobTicketLock::getTicketId, dto.getTicketId())
|
|
|
|
|
+ .eq(IsJobTicketLock::getLockId, lock.getLockId())
|
|
|
|
|
+ .set(IsJobTicketLock::getLockStatus, LockStatusEnum.REMOVED_LOCK.status));
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ return true;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
public Boolean updateLocksetTake(List<TakeLocksetDTO> list) {
|
|
public Boolean updateLocksetTake(List<TakeLocksetDTO> list) {
|
|
|
Assert.isFalse(list.isEmpty(), "请取出至少一个辅件!");
|
|
Assert.isFalse(list.isEmpty(), "请取出至少一个辅件!");
|