提交 2fdb95d8 authored 作者: 133's avatar 133

[丢失] bug修改

上级 22d2b653
......@@ -134,6 +134,12 @@ public interface DeviceLibraryService {
*/
void isInStockOrWaitRetired(List<Integer> ids);
/**
* 判断装备状态是否丢失
* @param ids
*/
void isNotLoss(List<Integer> ids);
/**
* 判断装备状态是否在库或维修中
*/
......
......@@ -444,6 +444,16 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
});
}
@Override
public void isNotLoss(List<Integer> ids) {
ids.forEach(integer -> {
DeviceLibrary deviceLibrary = getOne(integer);
if (deviceLibrary.getLifeStatus()!=11){
throw new ApiException(ResponseEntity.status(303).body("序列号"+deviceLibrary.getSeqNumber()+"的装备已被其他专管员操作"));
}
});
}
@Override
public List<DeviceLibrary> getAllList(DeviceLibrarySelectVo deviceLibrarySelectVo) {
return deviceLibraryDao.findAll(getSelectSpecification4(deviceLibrarySelectVo));
......
......@@ -109,7 +109,7 @@ public class LossBillServiceImpl implements LossBillService {
@Override
public void initiateRetrieve(DeviceLoss deviceLoss,SecurityUser securityUser) {
deviceLibraryService.isInStockOrWaitRetired(deviceLoss.getDevIdsList());
deviceLibraryService.isNotLoss(deviceLoss.getDevIdsList());
deviceLoss.setDevIds(StringUtils.ListToString(deviceLoss.getDevIdsList()));
deviceLoss.setLossFile(FilesUtil.stringFileToList(deviceLoss.getFileRetList()));
DeviceLoss deviceLossThis= deviceLossService.save(deviceLoss);
......@@ -142,7 +142,7 @@ public class LossBillServiceImpl implements LossBillService {
taskService.moveToEnd(taskBto);
if (retrieveAuditvo.getType()==1){
deviceLoss.setBackStatus(2);
deviceLibraryDao.upDateLeftStatus(DeviceLifeStatus.IN_LIBRARY.id,deviceLoss.getDevIdsList());
deviceLibraryDao.upDateLeftStatus(DeviceLifeStatus.IN_LIBRARY.id,StringUtils.stringToList(deviceLoss.getDevIds()));
}else {
deviceLoss.setBackStatus(3);
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论