Merge pull request '时间类型修改' (#14) from yanyang into master

Reviewed-on: #14
This commit is contained in:
闫阳 2022-12-09 17:01:11 +08:00
當前提交 1173d670e4
共有 2 個檔案被更改,包括 7 行新增4 行删除

查看文件

@ -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();