9 changed files with 239 additions and 63 deletions
-
39storeroom/src/main/java/com/storeroom/modules/device/controller/DeseCabinetController.java
-
20storeroom/src/main/java/com/storeroom/modules/device/domain/DeseCabinet.java
-
6storeroom/src/main/java/com/storeroom/modules/device/domain/DeviceArchivesTag.java
-
63storeroom/src/main/java/com/storeroom/modules/device/domain/OperatingState.java
-
8storeroom/src/main/java/com/storeroom/modules/device/repository/OperatingStateRepository.java
-
5storeroom/src/main/java/com/storeroom/modules/device/service/DeseCabinetService.java
-
13storeroom/src/main/java/com/storeroom/modules/device/service/dto/DeseCabinetDto.java
-
40storeroom/src/main/java/com/storeroom/modules/device/service/dto/OperatingStateDto.java
-
106storeroom/src/main/java/com/storeroom/modules/device/service/impl/DenseCabinetImpl.java
@ -0,0 +1,63 @@ |
|||||
|
package com.storeroom.modules.device.domain; |
||||
|
|
||||
|
|
||||
|
import com.storeroom.base.BaseEntity; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Getter; |
||||
|
import lombok.Setter; |
||||
|
|
||||
|
import javax.persistence.*; |
||||
|
import javax.validation.constraints.NotNull; |
||||
|
import java.io.Serializable; |
||||
|
import java.util.Objects; |
||||
|
|
||||
|
@Entity |
||||
|
@Getter |
||||
|
@Setter |
||||
|
public class OperatingState implements Serializable { |
||||
|
|
||||
|
|
||||
|
@Id |
||||
|
@Column(name = "id") |
||||
|
@NotNull(groups = BaseEntity.Update.class) |
||||
|
@ApiModelProperty(value = "ID", hidden = true) |
||||
|
private String id; |
||||
|
|
||||
|
@ManyToOne(targetEntity = DeseCabinet.class) |
||||
|
@JoinColumn(name = "device_id",referencedColumnName = "id") |
||||
|
@ApiModelProperty(value = "密集架或回转柜id") |
||||
|
private DeseCabinet deviceId; |
||||
|
|
||||
|
@Column(name = "state_type") |
||||
|
@ApiModelProperty(value = "操作状态 1.联动操作 2.回调操作") |
||||
|
private Integer stateType; |
||||
|
|
||||
|
@Column(name = "lend") |
||||
|
@ApiModelProperty(value = "借出") |
||||
|
private Boolean lend; |
||||
|
|
||||
|
@Column(name = "borrow") |
||||
|
@ApiModelProperty(value = "归还") |
||||
|
private Boolean borrow; |
||||
|
|
||||
|
@Column(name = "inbound") |
||||
|
@ApiModelProperty(value = "入库") |
||||
|
private Boolean inBound; |
||||
|
|
||||
|
@Column(name = "outbound") |
||||
|
@ApiModelProperty(value = "出库") |
||||
|
private Boolean outBound; |
||||
|
|
||||
|
@Override |
||||
|
public boolean equals(Object o) { |
||||
|
if (this == o) return true; |
||||
|
if (o == null || getClass() != o.getClass()) return false; |
||||
|
OperatingState that = (OperatingState) o; |
||||
|
return Objects.equals(id, that.id) && Objects.equals(deviceId, that.deviceId) && Objects.equals(lend, that.lend) && Objects.equals(borrow, that.borrow) && Objects.equals(inBound, that.inBound) && Objects.equals(outBound, that.outBound); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public int hashCode() { |
||||
|
return Objects.hash(id, deviceId, lend, borrow, inBound, outBound); |
||||
|
} |
||||
|
} |
@ -0,0 +1,8 @@ |
|||||
|
package com.storeroom.modules.device.repository; |
||||
|
|
||||
|
import com.storeroom.modules.device.domain.OperatingState; |
||||
|
import org.springframework.data.jpa.repository.JpaRepository; |
||||
|
import org.springframework.data.jpa.repository.JpaSpecificationExecutor; |
||||
|
|
||||
|
public interface OperatingStateRepository extends JpaRepository<OperatingState,String>, JpaSpecificationExecutor<OperatingState> { |
||||
|
} |
@ -0,0 +1,40 @@ |
|||||
|
package com.storeroom.modules.device.service.dto; |
||||
|
|
||||
|
|
||||
|
import com.storeroom.modules.device.domain.DeseCabinet; |
||||
|
import lombok.Getter; |
||||
|
import lombok.Setter; |
||||
|
|
||||
|
import java.util.Objects; |
||||
|
|
||||
|
@Setter |
||||
|
@Getter |
||||
|
public class OperatingStateDto { |
||||
|
|
||||
|
private String id; |
||||
|
|
||||
|
private DeseCabinet deviceId; |
||||
|
|
||||
|
private Integer stateType; |
||||
|
|
||||
|
private Boolean lend; |
||||
|
|
||||
|
private Boolean borrow; |
||||
|
|
||||
|
private Boolean inBound; |
||||
|
|
||||
|
private Boolean outBound; |
||||
|
|
||||
|
@Override |
||||
|
public boolean equals(Object o) { |
||||
|
if (this == o) return true; |
||||
|
if (o == null || getClass() != o.getClass()) return false; |
||||
|
OperatingStateDto that = (OperatingStateDto) o; |
||||
|
return Objects.equals(id, that.id) && Objects.equals(deviceId, that.deviceId) && Objects.equals(stateType, that.stateType) && Objects.equals(lend, that.lend) && Objects.equals(borrow, that.borrow) && Objects.equals(inBound, that.inBound) && Objects.equals(outBound, that.outBound); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public int hashCode() { |
||||
|
return Objects.hash(id, deviceId, stateType, lend, borrow, inBound, outBound); |
||||
|
} |
||||
|
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue