提交 fc1de5b9 authored 作者: 邓砥奕's avatar 邓砥奕

修改bug

上级 92dc38fa
......@@ -12,6 +12,7 @@ import lombok.Data;
import lombok.NoArgsConstructor;
import org.modelmapper.ModelMapper;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
......@@ -36,7 +37,7 @@ public class DeviceLogDto {
private String remark;
@ApiModelProperty(value = "附件信息")
private List<FileVo> fileVoList;
private List<FileVo> fileVoList = new ArrayList<>();
@ApiModelProperty(value = "操作人")
private Integer createUserId;
......@@ -90,7 +91,7 @@ public class DeviceLogDto {
ModelMapper modelMapper = BeanHelper.getUserMapper();
DeviceLogUserVo deviceLogUserVo = modelMapper.map(this, DeviceLogUserVo.class);
//set vo字段
if (userPublicService != null) {
if (userPublicService != null && this.createUserId != null) {
deviceLogUserVo.setUser(userPublicService.getOne(this.createUserId).getName());
deviceLogUserVo.setUnit(userPublicService.findUnitsNameByUserId(this.createUserId));
}
......
......@@ -99,31 +99,33 @@ public class DeviceLog {
//modelMap复制
ModelMapper mapper = BeanHelper.getUserMapper();
DeviceLogDto deviceLogDto = mapper.map(this, DeviceLogDto.class);
//解析组合字段并添加
String[] strings = this.fileDetail.split("Ǵ");
List<FileVo> fileVos = new ArrayList<>();
if (strings.length > 0) {
for (String s : strings) {
if (s.length() > 0) {
String[] strings1 = s.split("Ǒ");
if ("".equals(strings1[0]) && strings1.length == 4) {
FileVo fileVo = new FileVo();
fileVo.setFileName(strings1[1]);
fileVo.setFileUrl(strings1[2]);
fileVo.setTitle(strings1[3]);
fileVos.add(fileVo);
}
if (!"".equals(strings1[0]) && strings1.length == 3) {
FileVo fileVo = new FileVo();
fileVo.setFileName(strings1[0]);
fileVo.setFileUrl(strings1[1]);
fileVo.setTitle(strings1[2]);
fileVos.add(fileVo);
if (this.fileDetail!=null) {
//解析组合字段并添加
String[] strings = this.fileDetail.split("Ǵ");
List<FileVo> fileVos = new ArrayList<>();
if (strings.length > 0) {
for (String s : strings) {
if (s.length() > 0) {
String[] strings1 = s.split("Ǒ");
if ("".equals(strings1[0]) && strings1.length == 4) {
FileVo fileVo = new FileVo();
fileVo.setFileName(strings1[1]);
fileVo.setFileUrl(strings1[2]);
fileVo.setTitle(strings1[3]);
fileVos.add(fileVo);
}
if (!"".equals(strings1[0]) && strings1.length == 3) {
FileVo fileVo = new FileVo();
fileVo.setFileName(strings1[0]);
fileVo.setFileUrl(strings1[1]);
fileVo.setTitle(strings1[2]);
fileVos.add(fileVo);
}
}
}
}
deviceLogDto.setFileVoList(fileVos);
}
deviceLogDto.setFileVoList(fileVos);
return deviceLogDto;
}
......
......@@ -33,7 +33,7 @@ public class DeviceLibrarySaveVo {
@ApiModelProperty(value = "rfid表面号")
private String rfidSurfaceId;
@NotNull(message = "rfidCardId不能为空")
// @NotNull(message = "rfidCardId不能为空")
@ApiModelProperty(value = "rfid卡号")
private String rfidCardId;
......
......@@ -230,14 +230,17 @@ public class RfidServiceImpl implements RfidService {
} else {
stringBuffer.append(deviceNumber.substring(deviceNumber.length() - 4));
}
if (produceNumber.length() < 4) {
for (int i = 0; i < 4 - produceNumber.length(); i++) {
stringBuffer.append("0");
if (produceNumber==null){
stringBuffer.append("0000");
}else {
if (produceNumber.length() < 4) {
for (int i = 0; i < 4 - produceNumber.length(); i++) {
stringBuffer.append("0");
}
stringBuffer.append(produceNumber);
} else {
stringBuffer.append(produceNumber.substring(produceNumber.length() - 4));
}
stringBuffer.append(produceNumber);
} else {
stringBuffer.append(produceNumber.substring(produceNumber.length() - 4));
}
return stringBuffer.toString();
}
......
......@@ -141,7 +141,7 @@ public class BigScreenServiceImpl implements BigScreenService {
//本年度业务总数
centerNum.setBusinessCount((int) taskDao.findAll().stream().filter(task -> isPresentYear(task.getCreateTime())).count());
//新增设备数
centerNum.setDeviceAddCount((int) deviceLibraryDao.findAll().stream().filter(deviceLibrary -> isPresentYear(deviceLibrary.getCreateTime())).count());
centerNum.setDeviceAddCount((int) deviceLibraryDao.findAll().stream().filter(deviceLibrary -> deviceLibrary.getCreateTime()!=null&&isPresentYear(deviceLibrary.getCreateTime())).count());
//故障率
Set<Integer> repairDeviceIds = new HashSet<>();
double num = 0;
......
......@@ -39,10 +39,7 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
* @author dengdiyi
......@@ -187,6 +184,9 @@ public class StorageBillController {
deviceLibraryEntity.setLocationUnit(userUtils.getCurrentUserUnitName());
deviceLibraryEntity.setOwnUnit(userUtils.getCurrentUserUnitName());
deviceLibraryEntity.setPartParentId(null);
if (deviceLibraryEntity.getRfidCardId()==null||"".equals(deviceLibraryEntity.getRfidCardId())){
deviceLibraryEntity.setRfidCardId(UUID.randomUUID().toString());
}
//如果不是单独的配件,设置父装备id为上一个装备的id
if (d.getIsSinglePart() == 0) {
if (deviceLibraryEntity.getIsPart() == 0) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论