提交 d0826a99 authored 作者: zjm's avatar zjm

fix(丢失找回): 添加了对同一件设备进行找回,发起多次任务,通过时提示是否需要终止任务,且添加了终止任务接口

添加了对同一件设备进行找回,发起多次任务,通过时提示是否需要终止任务,且添加了终止任务接口
上级 da3dbf68
......@@ -154,6 +154,12 @@ public interface DeviceLibraryService {
*/
void isNotLoss(List<Integer> ids);
/**
* 判断装备状态是否丢失(若不是抛出304异常)
* @param ids
*/
void isNotLoss304(List<Integer> ids);
/**
* 判断装备状态是否在库或维修中(若不是抛出303异常)
*/
......
......@@ -759,6 +759,16 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
});
}
@Override
public void isNotLoss304(List<Integer> ids) {
ids.forEach(integer -> {
DeviceLibrary deviceLibrary = getOne(integer);
if (deviceLibrary.getLifeStatus()!=11){
throw new ApiException(ResponseEntity.status(304).body("序列号"+deviceLibrary.getSeqNumber()+"的装备已被其他专管员操作"));
}
});
}
@Override
public List<DeviceLibrary> getAllList(DeviceLibrarySelectVo deviceLibrarySelectVo) {
// List<DeviceLibrary> allDeviceLibraryList = cacheLibraryService.getAllDeviceLibraryList();
......
......@@ -5,6 +5,7 @@ import com.tykj.dev.device.loss.entity.domain.DeviceLoss;
import com.tykj.dev.device.loss.entity.vo.LossAuditvo;
import com.tykj.dev.device.loss.entity.vo.RetrieveAuditvo;
import com.tykj.dev.device.loss.service.LossBillService;
import com.tykj.dev.device.task.subject.bto.TaskBto;
import com.tykj.dev.device.user.subject.entity.SecurityUser;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
......@@ -62,4 +63,10 @@ public class DeviceLossController {
public ResponseEntity repelFileMap( @PathVariable Integer taskId){
return ResponseEntity.ok(lossBillService.findTaskIdToFileMap(taskId));
}
@GetMapping(value ="/endRetrieve/{taskId}")
@ApiOperation(value = "终止找回任务", notes = "终止找回任务")
public ResponseEntity<TaskBto> endRetrieve(@PathVariable Integer taskId){
return ResponseEntity.ok(lossBillService.endRetrieve(taskId));
}
}
......@@ -4,6 +4,7 @@ import com.tykj.dev.device.file.entity.FileRet;
import com.tykj.dev.device.loss.entity.domain.DeviceLoss;
import com.tykj.dev.device.loss.entity.vo.LossAuditvo;
import com.tykj.dev.device.loss.entity.vo.RetrieveAuditvo;
import com.tykj.dev.device.task.subject.bto.TaskBto;
import com.tykj.dev.device.user.subject.entity.SecurityUser;
import java.util.List;
......@@ -27,7 +28,6 @@ public interface LossBillService {
*/
void superiorAuditLoss(LossAuditvo lossAuditvo);
/**
* 找回装备
*/
......@@ -38,5 +38,10 @@ public interface LossBillService {
*/
void superiorAuditRetrieve(RetrieveAuditvo retrieveAuditvo);
/**
* 终止找回任务
*/
TaskBto endRetrieve(Integer taskId);
Map<String, List<FileRet>> findTaskIdToFileMap(Integer taskId);
}
......@@ -180,6 +180,8 @@ public class LossBillServiceImpl implements LossBillService {
Area area=areaService.findByid(units.getAreaId());
TaskBto taskBto=taskService.get(retrieveAuditvo.getTaskId());
DeviceLoss deviceLoss=deviceLossService.findByDeviceLoss(taskBto.getBillId());
List<Integer> ids=StringUtils.stringToList(deviceLoss.getDevIds());
deviceLibraryService.isNotLoss304(ids);
if (units.getLevel()==1){
TaskDisposeUtil.isNotSubmit(taskBto.getBillStatus(),StatusEnum.RETRIEVE1401);
deviceLoss.setProvinceUnitName(units.getName());
......@@ -215,6 +217,13 @@ public class LossBillServiceImpl implements LossBillService {
deviceLossService.save(deviceLoss);
}
@Override
public TaskBto endRetrieve(Integer taskId) {
TaskBto taskBto = taskService.get(taskId);
taskBto = taskService.moveToArchive(taskBto);
return taskBto;
}
@Override
public Map<String,List<FileRet>> findTaskIdToFileMap(Integer taskId) {
Map<String,List<FileRet>> map=new HashMap<>();
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论