Tube 전압, 전류 offset 추가
This commit is contained in:
parent
8f906b5fb4
commit
1fbc721599
|
@ -5,29 +5,35 @@ package inc.sdt.controlcentermanagement.domain;
|
||||||
*/
|
*/
|
||||||
public class Tube {
|
public class Tube {
|
||||||
private String code;
|
private String code;
|
||||||
private String offset;
|
private Float voltageOffset;
|
||||||
|
private Float ampereOffset;
|
||||||
protected Tube() {
|
protected Tube() {
|
||||||
}
|
}
|
||||||
|
|
||||||
public Tube(String code, String offset) {
|
public Tube(String code, Float voltageOffset, Float ampereOffset) {
|
||||||
this.code = code;
|
this.code = code;
|
||||||
this.offset = offset;
|
this.voltageOffset = voltageOffset;
|
||||||
|
this.ampereOffset = ampereOffset;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getCode() {
|
public String getCode() {
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getOffset() {
|
public Float getVoltageOffset() {
|
||||||
return offset;
|
return voltageOffset;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Float getAmpereOffset() {
|
||||||
|
return ampereOffset;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "Tube{" +
|
return "Tube{" +
|
||||||
"number='" + code + '\'' +
|
"code='" + code + '\'' +
|
||||||
", offset=" + offset +
|
", voltageOffset=" + voltageOffset +
|
||||||
|
", ampereOffset=" + ampereOffset +
|
||||||
'}';
|
'}';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,7 +40,7 @@ public class SlotNoSQLRepository implements SlotRepositoryDelegate {
|
||||||
.chamberNumber(slotDocument.getChamberNumber())
|
.chamberNumber(slotDocument.getChamberNumber())
|
||||||
.tube(slotDocument.getTube()
|
.tube(slotDocument.getTube()
|
||||||
.stream()
|
.stream()
|
||||||
.map(tubeDocument -> new Tube(tubeDocument.getCode(), tubeDocument.getOffset()))
|
.map(tubeDocument -> new Tube(tubeDocument.getCode(), tubeDocument.getVoltageOffset(), tubeDocument.getAmpereOffset()))
|
||||||
.toList())
|
.toList())
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,26 +5,33 @@ package inc.sdt.controlcentermanagement.infrastructure.nosql;
|
||||||
*/
|
*/
|
||||||
public class TubeDocument {
|
public class TubeDocument {
|
||||||
private String code;
|
private String code;
|
||||||
private String offset;
|
private Float voltageOffset;
|
||||||
|
private Float ampereOffset;
|
||||||
|
|
||||||
public TubeDocument(String code, String offset) {
|
public TubeDocument(String code, Float voltageOffset, Float ampereOffset) {
|
||||||
this.code = code;
|
this.code = code;
|
||||||
this.offset = offset;
|
this.voltageOffset = voltageOffset;
|
||||||
|
this.ampereOffset = ampereOffset;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getCode() {
|
public String getCode() {
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getOffset() {
|
public Float getVoltageOffset() {
|
||||||
return offset;
|
return voltageOffset;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Float getAmpereOffset() {
|
||||||
|
return ampereOffset;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "TubeDocument{" +
|
return "TubeDocument{" +
|
||||||
"id='" + code + '\'' +
|
"code='" + code + '\'' +
|
||||||
", offset=" + offset +
|
", voltageOffset=" + voltageOffset +
|
||||||
|
", ampereOffset=" + ampereOffset +
|
||||||
'}';
|
'}';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,7 +29,7 @@ class SlotNoSQLRepositoryTest {
|
||||||
|
|
||||||
private Slot to(SlotDocument slotDocument) {
|
private Slot to(SlotDocument slotDocument) {
|
||||||
List<Tube> tube = slotDocument.getTube().stream()
|
List<Tube> tube = slotDocument.getTube().stream()
|
||||||
.map(tubeDocument -> new Tube(tubeDocument.getCode(), tubeDocument.getOffset())).toList();
|
.map(tubeDocument -> new Tube(tubeDocument.getCode(), tubeDocument.getVoltageOffset(), tubeDocument.getAmpereOffset())).toList();
|
||||||
return Slot.builder()
|
return Slot.builder()
|
||||||
.id(slotDocument.getId())
|
.id(slotDocument.getId())
|
||||||
.slotNumber(slotDocument.getSlotNumber())
|
.slotNumber(slotDocument.getSlotNumber())
|
||||||
|
|
Loading…
Reference in New Issue