时间类型修改 #14
@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.Instant;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
@ -30,7 +31,7 @@ public class InspectionSampleDTO implements Serializable {
|
||||
private String batchNum;
|
||||
|
||||
@ApiModelProperty(value = "取样时间")
|
||||
private LocalDateTime sampleTime;
|
||||
private Instant sampleTime;
|
||||
|
||||
@ApiModelProperty(value = "样本号")
|
||||
private String sampleNumber;
|
||||
|
@ -238,7 +238,8 @@ public class InspectionSheetServiceImpl extends CrudServiceImpl<InspectionSheetM
|
||||
|
||||
InspectionSampleDTO sampleDTO = new InspectionSampleDTO();
|
||||
sampleDTO.setSampleNumber(sampleNumber);
|
||||
sampleDTO.setSampleTime(LocalDateTime.ofInstant(events.get(0).getTime(), ZoneId.systemDefault()));
|
||||
//sampleDTO.setSampleTime(LocalDateTime.ofInstant(events.get(0).getTime(), ZoneId.systemDefault()));
|
||||
sampleDTO.setSampleTime(events.get(0).getTime());
|
||||
sampleDTO.setBatchNum(dto.getBatchNumber());
|
||||
sampleDTO.setInspectionSheetId(events.get(0).getInspectionSheetId());
|
||||
|
||||
@ -264,8 +265,9 @@ public class InspectionSheetServiceImpl extends CrudServiceImpl<InspectionSheetM
|
||||
String sampleNumber = dto.getSampleNumber();
|
||||
String jsonData = dto.getJsonData();
|
||||
JSONObject json = JSON.parseObject(jsonData);
|
||||
LocalDateTime sampleTime = dto.getSampleTime();
|
||||
Instant eventTime = sampleTime.toInstant(ZoneOffset.UTC);
|
||||
// LocalDateTime sampleTime = dto.getSampleTime();
|
||||
// Instant eventTime = sampleTime.toInstant(ZoneOffset.UTC);
|
||||
Instant eventTime = dto.getSampleTime();
|
||||
List<Event> list = new ArrayList<>();
|
||||
for (Map.Entry entry : json.entrySet()) {
|
||||
String key = entry.getKey().toString();
|
||||
|
Ladataan…
Viittaa uudesa ongelmassa
Block a user