提交 eca84b10 authored 作者: zhoushaopan's avatar zhoushaopan

feat(装备模块,3D模块): 修改库房缓存

修改库房缓存
上级 42776efc
package com.tykj.dev.device.library.service; package com.tykj.dev.device.library.controller;
import com.tykj.dev.config.swagger.AutoDocument; import com.tykj.dev.config.swagger.AutoDocument;
import com.tykj.dev.device.library.service.DeviceLibraryPositionService;
import com.tykj.dev.device.library.service.DeviceLibraryService;
import com.tykj.dev.device.library.subject.model.vo.ModifyWarehouseLocationsInBatchesVO; import com.tykj.dev.device.library.subject.model.vo.ModifyWarehouseLocationsInBatchesVO;
import com.tykj.dev.device.library.subject.vo.UpdateStorageLocationVo; import com.tykj.dev.device.library.subject.vo.UpdateStorageLocationVo;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
...@@ -39,7 +41,7 @@ public class PublicController { ...@@ -39,7 +41,7 @@ public class PublicController {
public ResponseEntity<String> fnModifyWarehouseLocationsInBatches(@RequestBody ModifyWarehouseLocationsInBatchesVO public ResponseEntity<String> fnModifyWarehouseLocationsInBatches(@RequestBody ModifyWarehouseLocationsInBatchesVO
modifyWarehouseLocationsInBatchesVO){ modifyWarehouseLocationsInBatchesVO){
deviceLibraryPositionService.batchUpdateStorageLocation(modifyWarehouseLocationsInBatchesVO.getStorageLocationId(), deviceLibraryPositionService.batchUpdateStorageLocation(modifyWarehouseLocationsInBatchesVO.getStorageLocationId(),
modifyWarehouseLocationsInBatchesVO.getStorageLocationName(), modifyWarehouseLocationsInBatchesVO.getDeviceIds()); modifyWarehouseLocationsInBatchesVO.getStorageLocation(), modifyWarehouseLocationsInBatchesVO.getDeviceIds());
UpdateStorageLocationVo updateStorageLocationVo = new UpdateStorageLocationVo(); UpdateStorageLocationVo updateStorageLocationVo = new UpdateStorageLocationVo();
BeanUtils.copyProperties(modifyWarehouseLocationsInBatchesVO,updateStorageLocationVo); BeanUtils.copyProperties(modifyWarehouseLocationsInBatchesVO,updateStorageLocationVo);
deviceLibraryService.updateStorageLocation(updateStorageLocationVo); deviceLibraryService.updateStorageLocation(updateStorageLocationVo);
......
...@@ -177,15 +177,15 @@ public class DeviceLibraryPositionServiceImpl implements DeviceLibraryPositionSe ...@@ -177,15 +177,15 @@ public class DeviceLibraryPositionServiceImpl implements DeviceLibraryPositionSe
} }
private PredicateBuilder<DeviceLibraryPosition> createBuilder(QueryTheWarehouseVo queryTheWarehouseVo){ // private PredicateBuilder<DeviceLibraryPosition> createBuilder(QueryTheWarehouseVo queryTheWarehouseVo){
PredicateBuilder<DeviceLibraryPosition> predicateBuilder = Specifications.and(); // PredicateBuilder<DeviceLibraryPosition> predicateBuilder = Specifications.and();
List<Integer> storageLocationIds = queryTheWarehouseVo.getStorageLocationIds(); // List<Integer> storageLocationIds = queryTheWarehouseVo.getStorageLocationIds();
predicateBuilder.eq(queryTheWarehouseVo.getModel()!=null,"model",queryTheWarehouseVo.getModel()); // predicateBuilder.eq(queryTheWarehouseVo.getModel()!=null,"model",queryTheWarehouseVo.getModel());
predicateBuilder.eq(queryTheWarehouseVo.getName()!=null,"name",queryTheWarehouseVo.getName()); // predicateBuilder.eq(queryTheWarehouseVo.getName()!=null,"name",queryTheWarehouseVo.getName());
predicateBuilder.like(queryTheWarehouseVo.getSeqNumber()!=null,"seqNumber", // predicateBuilder.like(queryTheWarehouseVo.getSeqNumber()!=null,"seqNumber",
"%"+queryTheWarehouseVo.getSeqNumber()+"%"); // "%"+queryTheWarehouseVo.getSeqNumber()+"%");
predicateBuilder.in(queryTheWarehouseVo.getStorageLocationIds()!=null && !storageLocationIds.isEmpty(), // predicateBuilder.in(queryTheWarehouseVo.getStorageLocationIds()!=null && !storageLocationIds.isEmpty(),
"storageLocationId",storageLocationIds.toArray(new Integer[]{})); // "storageLocationId",storageLocationIds.toArray(new Integer[]{}));
return predicateBuilder; // return predicateBuilder;
} // }
} }
...@@ -1454,9 +1454,12 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService { ...@@ -1454,9 +1454,12 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
//新增装备的形态 //新增装备的形态
predicateBuilder.eq(deviceLibrarySelectVo.getType() != null,"type",deviceLibrarySelectVo.getType()); predicateBuilder.eq(deviceLibrarySelectVo.getType() != null,"type",deviceLibrarySelectVo.getType());
//新增库房集合查询 //新增库房集合查询
predicateBuilder.in(deviceLibrarySelectVo.getStorageLocationIds() != null,"storageLocationId", if (deviceLibrarySelectVo.getStorageLocationIds() != null){
predicateBuilder.notIn("storageLocationId",
deviceLibrarySelectVo.getStorageLocationIds().toArray(new Integer[]{})); deviceLibrarySelectVo.getStorageLocationIds().toArray(new Integer[]{}));
} }
}
return predicateBuilder; return predicateBuilder;
} }
......
...@@ -238,7 +238,7 @@ public class DeviceLibrary implements Serializable { ...@@ -238,7 +238,7 @@ public class DeviceLibrary implements Serializable {
@ApiModelProperty(value = "对应申请任务id") @ApiModelProperty(value = "对应申请任务id")
private Integer applyTaskId; private Integer applyTaskId;
@ApiModelProperty(value = "装备存放位置",notes = "默认是库房") @ApiModelProperty(value = "装备存放位置",notes = "默认是库房,字段已经不用了,去库房表里面进行替换")
private String storageLocation; private String storageLocation;
@ApiModelProperty(value = "装备存放位置Id",notes = "默认是库房") @ApiModelProperty(value = "装备存放位置Id",notes = "默认是库房")
...@@ -326,7 +326,8 @@ public class DeviceLibrary implements Serializable { ...@@ -326,7 +326,8 @@ public class DeviceLibrary implements Serializable {
public DeviceLibrary setConfigName(){ public DeviceLibrary setConfigName(){
ConfigCache configCache = SpringUtils.getBean("initConfigCache"); ConfigCache configCache = SpringUtils.getBean("initConfigCache");
if (configCache != null) { StoreCache storeCache=SpringUtils.getBean("initStoreCache");
if (configCache != null && storeCache!=null) {
setSecretLevelName(configCache.getSecretLevelMap().get(this.secretLevel)==null?"-":configCache.getSecretLevelMap().get(this.secretLevel)); setSecretLevelName(configCache.getSecretLevelMap().get(this.secretLevel)==null?"-":configCache.getSecretLevelMap().get(this.secretLevel));
setLifeStatusName(configCache.getLifeStatusMap().get(this.lifeStatus)==null?"-":configCache.getLifeStatusMap().get(this.lifeStatus)); setLifeStatusName(configCache.getLifeStatusMap().get(this.lifeStatus)==null?"-":configCache.getLifeStatusMap().get(this.lifeStatus));
setMatchingRangeName(configCache.getMatchingRangeMap().get(this.matchingRange)==null?"-":configCache.getMatchingRangeMap().get(this.matchingRange)); setMatchingRangeName(configCache.getMatchingRangeMap().get(this.matchingRange)==null?"-":configCache.getMatchingRangeMap().get(this.matchingRange));
...@@ -335,7 +336,7 @@ public class DeviceLibrary implements Serializable { ...@@ -335,7 +336,7 @@ public class DeviceLibrary implements Serializable {
setStorageTypeName(configCache.getStorageTypeMap().get(this.storageType)==null?"-":configCache.getStorageTypeMap().get(this.storageType)); setStorageTypeName(configCache.getStorageTypeMap().get(this.storageType)==null?"-":configCache.getStorageTypeMap().get(this.storageType));
setAllotTypeName(configCache.getAllotTypeMap().get(this.allotType)==null?"-":configCache.getAllotTypeMap().get(this.allotType)); setAllotTypeName(configCache.getAllotTypeMap().get(this.allotType)==null?"-":configCache.getAllotTypeMap().get(this.allotType));
// childs.clear(); // childs.clear();
setStorageLocation(StoreCache.idToName(this.storageLocationId)); setStorageLocation(storeCache.idToName(this.storageLocationId));
} }
return this; return this;
} }
......
...@@ -21,6 +21,6 @@ public class ModifyWarehouseLocationsInBatchesVO { ...@@ -21,6 +21,6 @@ public class ModifyWarehouseLocationsInBatchesVO {
public Integer storageLocationId; public Integer storageLocationId;
@ApiModelProperty(value = "库房的名称") @ApiModelProperty(value = "库房的名称")
public String storageLocationName; public String storageLocation;
} }
...@@ -25,7 +25,7 @@ public class QueryTheWarehouseVo extends CustomPage { ...@@ -25,7 +25,7 @@ public class QueryTheWarehouseVo extends CustomPage {
@ApiModelProperty(value = "装备序列号", example = "123-1") @ApiModelProperty(value = "装备序列号", example = "123-1")
public String seqNumber; public String seqNumber;
@ApiModelProperty(value = "其他库房ids") @ApiModelProperty(value = "当前库房的id 我会取反操作")
private List<Integer> storageLocationIds; private List<Integer> storageLocationIds;
@ApiModelProperty(value = "所属单位") @ApiModelProperty(value = "所属单位")
......
...@@ -35,9 +35,9 @@ public class StoreCache { ...@@ -35,9 +35,9 @@ public class StoreCache {
return this; return this;
} }
public static String idToName(Integer id){ public String idToName(Integer id){
StoreCache storeCache= new StoreCache();
return storeCache.idMap.getOrDefault(id, ""); return idMap.getOrDefault(id, "");
} }
} }
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论