刘力
3 years ago
8 changed files with 178 additions and 7 deletions
-
8archives/src/main/java/com/storeroom/modules/archives/repository/ArchivesCaseRepository.java
-
22storeroom/src/main/java/com/storeroom/modules/device/controller/DeviceController.java
-
65storeroom/src/main/java/com/storeroom/modules/device/domain/ArchivesCases.java
-
17storeroom/src/main/java/com/storeroom/modules/device/repository/ArchivesCasesRepository.java
-
15storeroom/src/main/java/com/storeroom/modules/device/service/ArchivesCasesService.java
-
15storeroom/src/main/java/com/storeroom/modules/device/service/DeviceService.java
-
25storeroom/src/main/java/com/storeroom/modules/device/service/impl/ArchivesCasesServiceImpl.java
-
18storeroom/src/main/java/com/storeroom/modules/device/service/impl/DeviceImpl.java
@ -0,0 +1,65 @@ |
|||
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.Column; |
|||
import javax.persistence.Entity; |
|||
import javax.persistence.Id; |
|||
import javax.persistence.Table; |
|||
import java.io.Serializable; |
|||
import java.sql.Timestamp; |
|||
|
|||
@Entity |
|||
@Getter |
|||
@Setter |
|||
@Table(name = "archives_case") |
|||
public class ArchivesCases extends BaseEntity implements Serializable { |
|||
|
|||
@Id |
|||
@Column(name = "id") |
|||
private String id; |
|||
|
|||
@Column(name = "case_name") |
|||
@ApiModelProperty(value = "盒名称") |
|||
private String caseName; |
|||
|
|||
@Column(name = "case_type") |
|||
@ApiModelProperty(value = "盒类别 0.未定义 1.文件 2.案卷") |
|||
private Integer caseType; |
|||
|
|||
@Column(name = "tid") |
|||
@ApiModelProperty(value = "盒标签") |
|||
private String tid; |
|||
|
|||
@Column(name = "barcode") |
|||
@ApiModelProperty(value = "条形码") |
|||
private String barcode; |
|||
|
|||
@Column(name = "shelf_id") |
|||
@ApiModelProperty(value = "层架位id") |
|||
private String shelfId; |
|||
|
|||
@Column(name = "folder_location") |
|||
@ApiModelProperty(value = "存放位置") |
|||
private String folderLocation; |
|||
|
|||
@Column(name = "folder_location_details") |
|||
@ApiModelProperty(value = "存放具体位置") |
|||
private String folderLocationDetails; |
|||
|
|||
@Column(name = "deposit_num") |
|||
@ApiModelProperty(value = "存放数量") |
|||
private Integer depositNum; |
|||
|
|||
@Column(name = "storage_type") |
|||
@ApiModelProperty(value = "入库状态 0.未入 1.待入 2.已入 3.待出") |
|||
private Integer storageType; |
|||
|
|||
@Column(name = "storage_time") |
|||
@ApiModelProperty(value = "入库时间") |
|||
private Timestamp storageTime; |
|||
|
|||
} |
@ -0,0 +1,17 @@ |
|||
package com.storeroom.modules.device.repository; |
|||
|
|||
|
|||
import com.storeroom.modules.device.domain.ArchivesCases; |
|||
import org.springframework.data.jpa.repository.JpaRepository; |
|||
import org.springframework.data.jpa.repository.Query; |
|||
|
|||
import java.util.List; |
|||
import java.util.Set; |
|||
|
|||
public interface ArchivesCasesRepository extends JpaRepository<ArchivesCases, String>{ |
|||
|
|||
@Query(nativeQuery = true, |
|||
value = "select count(1) from archives_case ace where ace.shelf_id in " + |
|||
"(select id from device_archives_tag dat where dat.device_info_id in (?1)) ") |
|||
Integer isHaveArchives(Set<String> deviceId); |
|||
} |
@ -0,0 +1,15 @@ |
|||
package com.storeroom.modules.device.service; |
|||
|
|||
|
|||
|
|||
import java.util.List; |
|||
import java.util.Set; |
|||
|
|||
public interface ArchivesCasesService { |
|||
|
|||
|
|||
//设备删除 设备内是否有档案 |
|||
Boolean isHaveArchives(Set<String> deviceId); |
|||
|
|||
|
|||
} |
@ -0,0 +1,25 @@ |
|||
package com.storeroom.modules.device.service.impl; |
|||
|
|||
|
|||
|
|||
import com.storeroom.modules.device.repository.ArchivesCasesRepository; |
|||
import com.storeroom.modules.device.service.ArchivesCasesService; |
|||
import lombok.RequiredArgsConstructor; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
|
|||
import java.util.Set; |
|||
|
|||
|
|||
@Service |
|||
@RequiredArgsConstructor |
|||
public class ArchivesCasesServiceImpl implements ArchivesCasesService { |
|||
|
|||
private final ArchivesCasesRepository archivesCaseRepository; |
|||
|
|||
@Override |
|||
public Boolean isHaveArchives(Set<String> deviceId) { |
|||
Integer count = archivesCaseRepository.isHaveArchives(deviceId); |
|||
return count <= 0; |
|||
} |
|||
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue