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

修改bug

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