|
|
|
@ -1,6 +1,7 @@
|
|
|
|
|
package com.glxp.api.req.dev;
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
|
|
import com.baomidou.mybatisplus.annotation.TableField;
|
|
|
|
|
import com.glxp.api.entity.auth.AuthAdmin;
|
|
|
|
|
import com.glxp.api.entity.dev.DeviceInfoEntity;
|
|
|
|
|
import com.glxp.api.entity.dev.DeviceRepairApplyDetailEntity;
|
|
|
|
@ -18,10 +19,7 @@ import javax.validation.Valid;
|
|
|
|
|
import javax.validation.constraints.NotBlank;
|
|
|
|
|
import javax.validation.constraints.NotEmpty;
|
|
|
|
|
import java.time.LocalDateTime;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
import java.util.Objects;
|
|
|
|
|
import java.util.Set;
|
|
|
|
|
import java.util.*;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
@Data
|
|
|
|
@ -54,6 +52,12 @@ public class DeviceRepairApplyAddParam {
|
|
|
|
|
@NotBlank(message = "问题描述不能为空")
|
|
|
|
|
String description;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 报修现场照片
|
|
|
|
|
*/
|
|
|
|
|
@TableField(value = "livePath")
|
|
|
|
|
private String livePath;
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public boolean equals(Object o) {
|
|
|
|
|
if (this == o) return true;
|
|
|
|
@ -90,7 +94,9 @@ public class DeviceRepairApplyAddParam {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public List<DeviceRepairApplyDetailEntity> getDetailEntityList(Long applyId, DeviceInfoService deviceInfoService, AuthAdmin user) {
|
|
|
|
|
List<DeviceInfoVo> list = deviceInfoService.listVoByCodes(details.stream().map(ApplyDetail::getDeviceCode).collect(Collectors.toList()), user.getLocDeptCode(), DeviceStatusEnum.NORMAL);
|
|
|
|
|
List<DeviceStatusEnum> enums = new ArrayList<>();
|
|
|
|
|
enums.add( DeviceStatusEnum.NORMAL);
|
|
|
|
|
List<DeviceInfoVo> list = deviceInfoService.listVoByCodes(details.stream().map(ApplyDetail::getDeviceCode).collect(Collectors.toList()), user.getLocDeptCode(), enums);
|
|
|
|
|
if (list.size() != details.size()) {
|
|
|
|
|
throw new JsonException("设备状态异常或信息不符,请确认");
|
|
|
|
|
}
|
|
|
|
@ -101,6 +107,7 @@ public class DeviceRepairApplyAddParam {
|
|
|
|
|
.applyId(applyId)
|
|
|
|
|
.description(d.getDescription())
|
|
|
|
|
.status(DeviceRepairApplyDetailStatusEnum.WAIT_DIAGNOSIS)
|
|
|
|
|
.livePath(d.getLivePath())
|
|
|
|
|
.build();
|
|
|
|
|
BeanUtil.copyProperties(info, build,"status");
|
|
|
|
|
return build;
|
|
|
|
|