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

feat(装备模块,配套设备库模块):…

feat(装备模块,配套设备库模块): 入库新增存放位置的id,修改装备存放位置的id,根据装备的存放位置查询装备,入库配套设备新增存放位置的id,修改配套装备存放位置的id,根据配套装备的存放位置查询装备, 入库新增存放位置的id,修改装备存放位置的id,根据装备的存放位置查询装备,入库配套设备新增存放位置的id,修改配套装备存放位置的id,根据配套装备的存放位置查询装备,
上级 a52d1735
...@@ -782,6 +782,7 @@ public class DeviceLibraryController { ...@@ -782,6 +782,7 @@ public class DeviceLibraryController {
DeviceLogDto deviceLogDto = new DeviceLogDto(deviceEditVo.getDeviceId(), "将存放位置改为"+libraryUpdateVo.getStorageLocation(), null,null,null); DeviceLogDto deviceLogDto = new DeviceLogDto(deviceEditVo.getDeviceId(), "将存放位置改为"+libraryUpdateVo.getStorageLocation(), null,null,null);
deviceLogService.addLog(deviceLogDto); deviceLogService.addLog(deviceLogDto);
deviceLibraryEntity.setStorageLocation(libraryUpdateVo.getStorageLocation()); deviceLibraryEntity.setStorageLocation(libraryUpdateVo.getStorageLocation());
deviceLibraryEntity.setStorageLocationId(libraryUpdateVo.getStorageLocationId());
} }
//add 备注 //add 备注
if (libraryUpdateVo.getRecord()!=null && !libraryUpdateVo.getRecord().equals(deviceLibraryEntity.getRecord())){ if (libraryUpdateVo.getRecord()!=null && !libraryUpdateVo.getRecord().equals(deviceLibraryEntity.getRecord())){
...@@ -931,6 +932,7 @@ public class DeviceLibraryController { ...@@ -931,6 +932,7 @@ public class DeviceLibraryController {
DeviceLibrary deviceLibrary = deviceLibraryService.getOne(deviceStorageLocation.getDevId()); DeviceLibrary deviceLibrary = deviceLibraryService.getOne(deviceStorageLocation.getDevId());
//添加修改存放装备位置 //添加修改存放装备位置
deviceLibrary.setStorageLocation(deviceStorageLocation.getStorageLocation()); deviceLibrary.setStorageLocation(deviceStorageLocation.getStorageLocation());
deviceLibrary.setStorageLocationId(deviceStorageLocation.getStorageLocationId());
DeviceLogDto deviceLogDto = new DeviceLogDto(deviceStorageLocation.getDevId(), "将存放位置改为"+deviceStorageLocation.getStorageLocation(), null,null,null); DeviceLogDto deviceLogDto = new DeviceLogDto(deviceStorageLocation.getDevId(), "将存放位置改为"+deviceStorageLocation.getStorageLocation(), null,null,null);
deviceLogService.addLog(deviceLogDto); deviceLogService.addLog(deviceLogDto);
deviceLibraryService.update(deviceLibrary); deviceLibraryService.update(deviceLibrary);
...@@ -974,8 +976,15 @@ public class DeviceLibraryController { ...@@ -974,8 +976,15 @@ public class DeviceLibraryController {
@ApiOperation("入库修改试用装备的序列号") @ApiOperation("入库修改试用装备的序列号")
@PostMapping("updateSeq") @PostMapping("updateSeq")
@CacheEvict(value = "devicesLibraryList",key = "'device'",allEntries = true)
public ResponseEntity updateSeq(@RequestBody List<DeviceForApplyVo> deviceForApplyVos){ public ResponseEntity updateSeq(@RequestBody List<DeviceForApplyVo> deviceForApplyVos){
deviceLibraryService.updateSeqNumber(deviceForApplyVos); deviceLibraryService.updateSeqNumber(deviceForApplyVos);
//异步去查询数据库
executor.execute(
()->{
cacheLibraryService.getAllDeviceLibraryList();
}
);
return ResponseEntity.ok("更新成功"); return ResponseEntity.ok("更新成功");
} }
......
...@@ -225,8 +225,8 @@ public interface DeviceLibraryDao extends JpaRepository<DeviceLibrary, Integer>, ...@@ -225,8 +225,8 @@ public interface DeviceLibraryDao extends JpaRepository<DeviceLibrary, Integer>,
@Transactional @Transactional
@Modifying @Modifying
@Query("update DeviceLibrary o set o.storageLocation = :storageLocation where o.id in :deviceIds") @Query("update DeviceLibrary o set o.storageLocation = :storageLocation,o.storageLocationId = :storageLocationId where o.id in :deviceIds")
int updateStorageLocation( @Param("storageLocation") String storageLocation, int updateStorageLocation( @Param("storageLocation") String storageLocation,@Param("storageLocationId") Integer storageLocationId,
@Param("deviceIds") List<Integer> deviceIds); @Param("deviceIds") List<Integer> deviceIds);
......
...@@ -236,6 +236,7 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService { ...@@ -236,6 +236,7 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
d.setName(deviceLibrarySelectVo.getName()); d.setName(deviceLibrarySelectVo.getName());
d.setContent(deviceLibrarySelectVo.getContent()); d.setContent(deviceLibrarySelectVo.getContent());
d.setType(deviceLibrarySelectVo.getType()); d.setType(deviceLibrarySelectVo.getType());
d.setStorageLocationId(deviceLibrarySelectVo.getStorageLocationId());
//获取所有的核心装备 //获取所有的核心装备
List<DeviceLibrary> libraryEntities = getCoreDevicePage(d); List<DeviceLibrary> libraryEntities = getCoreDevicePage(d);
if (libraryEntities.size() > 0) { if (libraryEntities.size() > 0) {
...@@ -1156,7 +1157,8 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService { ...@@ -1156,7 +1157,8 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
updateStorageLocationVo.getStorageLocation(),null,userId); updateStorageLocationVo.getStorageLocation(),null,userId);
deviceLogDtos.add(deviceLogDto); deviceLogDtos.add(deviceLogDto);
}}); }});
deviceLibraryDao.updateStorageLocation(updateStorageLocationVo.getStorageLocation(),deviceIds); deviceLibraryDao.updateStorageLocation(updateStorageLocationVo.getStorageLocation(),
updateStorageLocationVo.getStorageLocationId(),deviceIds);
}else { }else {
throw new ApiException("请选择要修改的装备"); throw new ApiException("请选择要修改的装备");
} }
...@@ -1372,7 +1374,7 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService { ...@@ -1372,7 +1374,7 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
predicateBuilder.in("seqNumber", DeviceSeqUtil.selectDeviceSeqs(deviceLibrarySelectVo.getSeqInterval())); predicateBuilder.in("seqNumber", DeviceSeqUtil.selectDeviceSeqs(deviceLibrarySelectVo.getSeqInterval()));
} }
//新增库房位置 //新增库房位置
predicateBuilder.eq(deviceLibrarySelectVo.getStorageLocation() != null,"storageLocation",deviceLibrarySelectVo.getStorageLocation()); predicateBuilder.eq(deviceLibrarySelectVo.getStorageLocationId() != null,"storageLocationId",deviceLibrarySelectVo.getStorageLocationId());
//新增装备的形态 //新增装备的形态
predicateBuilder.eq(deviceLibrarySelectVo.getType() != null,"type",deviceLibrarySelectVo.getType()); predicateBuilder.eq(deviceLibrarySelectVo.getType() != null,"type",deviceLibrarySelectVo.getType());
} }
......
...@@ -239,6 +239,9 @@ public class DeviceLibrary implements Serializable { ...@@ -239,6 +239,9 @@ public class DeviceLibrary implements Serializable {
@ApiModelProperty(value = "装备存放位置",notes = "默认是库房") @ApiModelProperty(value = "装备存放位置",notes = "默认是库房")
private String storageLocation; private String storageLocation;
@ApiModelProperty(value = "装备存放位置Id",notes = "默认是库房")
private Integer storageLocationId;
@Transient @Transient
private List<DeviceLibrary> childs = new ArrayList<>(); private List<DeviceLibrary> childs = new ArrayList<>();
......
...@@ -60,6 +60,9 @@ public class DeviceLibrarySaveVo { ...@@ -60,6 +60,9 @@ public class DeviceLibrarySaveVo {
@ApiModelProperty(value = "装备存放位置",notes = "默认是库房") @ApiModelProperty(value = "装备存放位置",notes = "默认是库房")
private String storageLocation; private String storageLocation;
@ApiModelProperty(value = "装备存放位置的id",notes = "默认是库房id")
private Integer storageLocationId;
@ApiModelProperty(value = "是否是试用装备",notes = "0 是正式 1 是测试") @ApiModelProperty(value = "是否是试用装备",notes = "0 是正式 1 是测试")
private Integer tryOutDevice = 0; private Integer tryOutDevice = 0;
......
...@@ -123,6 +123,9 @@ public class DeviceLibrarySelectVo extends CustomPage { ...@@ -123,6 +123,9 @@ public class DeviceLibrarySelectVo extends CustomPage {
@ApiModelProperty(value = "存储位置") @ApiModelProperty(value = "存储位置")
private String storageLocation; private String storageLocation;
@ApiModelProperty(value = "存储位置")
private Integer storageLocationId;
@ApiModelProperty(value = "存储位置的模糊查询字段") @ApiModelProperty(value = "存储位置的模糊查询字段")
private String storageLocationDim; private String storageLocationDim;
......
...@@ -48,6 +48,9 @@ public class DeviceLibraryUpdateVo { ...@@ -48,6 +48,9 @@ public class DeviceLibraryUpdateVo {
@ApiModelProperty("库存位置") @ApiModelProperty("库存位置")
private String storageLocation; private String storageLocation;
@ApiModelProperty("库存位置id")
private Integer storageLocationId;
@ApiModelProperty("备注") @ApiModelProperty("备注")
private String record; private String record;
......
...@@ -22,4 +22,7 @@ public class DeviceStorageLocation { ...@@ -22,4 +22,7 @@ public class DeviceStorageLocation {
@ApiModelProperty(value = "库存位置") @ApiModelProperty(value = "库存位置")
private String storageLocation; private String storageLocation;
@ApiModelProperty(value = "库存位置id")
private Integer storageLocationId;
} }
...@@ -21,4 +21,7 @@ public class UpdateStorageLocationVo { ...@@ -21,4 +21,7 @@ public class UpdateStorageLocationVo {
@ApiModelProperty(value = "要修改的库房位置") @ApiModelProperty(value = "要修改的库房位置")
private String storageLocation; private String storageLocation;
@ApiModelProperty(value = "要修改的库房位置id")
private Integer storageLocationId;
} }
...@@ -529,6 +529,16 @@ public class MatchingDeviceController { ...@@ -529,6 +529,16 @@ public class MatchingDeviceController {
m.setDeviceId(0); m.setDeviceId(0);
} }
if (matchingDeviceEditVo.getMatchingDeviceStorageLocation() != null &&
!m.getMatchingDeviceStorageLocation().equals(matchingDeviceEditVo.getMatchingDeviceStorageLocation())) {
//添加设备日志 存放位置
String remark = "将设备的存放位置改为" + matchingDeviceEditVo.getMatchingDeviceStorageLocation();
DeviceLogDto deviceLogDto = new DeviceLogDto(1, matchingDeviceEditVo.getMatchingDeviceId(), remark, null,null);
deviceLogService.addLog(deviceLogDto);
m.setMatchingDeviceStorageLocation(m.getMatchingDeviceStorageLocation());
m.setMatchingDeviceStorageLocationId(m.getMatchingDeviceStorageLocationId());
}
matchingDeviceLibraryService.update(m); matchingDeviceLibraryService.update(m);
return ResponseEntity.ok("修改成功"); return ResponseEntity.ok("修改成功");
} }
......
...@@ -377,6 +377,8 @@ public class MatchingDeviceLibraryServiceImpl implements MatchingDeviceLibrarySe ...@@ -377,6 +377,8 @@ public class MatchingDeviceLibraryServiceImpl implements MatchingDeviceLibrarySe
predicateBuilder.in("rfidCardId", ""); predicateBuilder.in("rfidCardId", "");
} }
} }
predicateBuilder.eq(matchingDeviceSelectVo.getMatchingDeviceStorageLocationId() != null,
"matchingDeviceStorageLocationId",matchingDeviceSelectVo.getMatchingDeviceStorageLocationId());
return predicateBuilder; return predicateBuilder;
} }
} }
...@@ -136,6 +136,12 @@ public class MatchingDeviceLibrary { ...@@ -136,6 +136,12 @@ public class MatchingDeviceLibrary {
@Transient @Transient
private String deviceSeqNumber; private String deviceSeqNumber;
@ApiModelProperty(value = "存放位置")
private String matchingDeviceStorageLocation;
@ApiModelProperty(value = "存放位置id")
private Integer matchingDeviceStorageLocationId;
public MatchingDeviceLibrary setConfigName(){ public MatchingDeviceLibrary setConfigName(){
ConfigCache configCache = SpringUtils.getBean("initConfigCache"); ConfigCache configCache = SpringUtils.getBean("initConfigCache");
......
...@@ -62,4 +62,10 @@ public class MatchingDeviceEditVo { ...@@ -62,4 +62,10 @@ public class MatchingDeviceEditVo {
@ApiModelProperty(value = "删除相关装备id") @ApiModelProperty(value = "删除相关装备id")
private Integer deleteDeviceId; private Integer deleteDeviceId;
@ApiModelProperty(value = "存放位置")
private String matchingDeviceStorageLocation;
@ApiModelProperty(value = "存放位置id")
private Integer matchingDeviceStorageLocationId;
} }
...@@ -58,6 +58,12 @@ public class MatchingDeviceSaveVo { ...@@ -58,6 +58,12 @@ public class MatchingDeviceSaveVo {
@ApiModelProperty(value = "序列号集合") @ApiModelProperty(value = "序列号集合")
private List<String> seqList; private List<String> seqList;
@ApiModelProperty(value = "存放位置")
private String matchingDeviceStorageLocation;
@ApiModelProperty(value = "存放位置id")
private Integer matchingDeviceStorageLocationId;
public MatchingDeviceLibrary toDo() { public MatchingDeviceLibrary toDo() {
MatchingDeviceLibrary matchingDeviceLibraryEntity = new MatchingDeviceLibrary(); MatchingDeviceLibrary matchingDeviceLibraryEntity = new MatchingDeviceLibrary();
BeanUtils.copyProperties(this, matchingDeviceLibraryEntity); BeanUtils.copyProperties(this, matchingDeviceLibraryEntity);
......
...@@ -33,6 +33,9 @@ public class MatchingDeviceSelectVo extends CustomPage { ...@@ -33,6 +33,9 @@ public class MatchingDeviceSelectVo extends CustomPage {
@ApiModelProperty(value = "查询是否打印标签(有没有表面号)装备") @ApiModelProperty(value = "查询是否打印标签(有没有表面号)装备")
private Integer isPrint; private Integer isPrint;
@ApiModelProperty(value = "存放位置id")
private Integer matchingDeviceStorageLocationId;
private String typeDim; private String typeDim;
private String modelDim; private String modelDim;
......
...@@ -31,4 +31,6 @@ public class StorageBillDetail { ...@@ -31,4 +31,6 @@ public class StorageBillDetail {
private String typeName; private String typeName;
@ApiModelProperty(value = "装备存放位置",notes = "默认是库房") @ApiModelProperty(value = "装备存放位置",notes = "默认是库房")
private String storageLocation; private String storageLocation;
@ApiModelProperty(value = "装备存放位置的id",notes = "默认是库房id")
private Integer storageLocationId;
} }
...@@ -16,17 +16,25 @@ public class StorageBillDetailVo { ...@@ -16,17 +16,25 @@ public class StorageBillDetailVo {
@ApiModelProperty(value = "配件列表") @ApiModelProperty(value = "配件列表")
List<StorageBillDetailVo> list; List<StorageBillDetailVo> list;
@ApiModelProperty(value = "列装id") @ApiModelProperty(value = "列装id")
private Integer packingId; private Integer packingId;
@ApiModelProperty(value = "入库数量") @ApiModelProperty(value = "入库数量")
private Integer storageCount; private Integer storageCount;
@ApiModelProperty(value = "序列号区间") @ApiModelProperty(value = "序列号区间")
private String seqInterval; private String seqInterval;
@ApiModelProperty(value = "生产号区间") @ApiModelProperty(value = "生产号区间")
private String prodInterval; private String prodInterval;
@ApiModelProperty(value = "列装装备") @ApiModelProperty(value = "列装装备")
private PackingLibrary packingLibrary; private PackingLibrary packingLibrary;
@ApiModelProperty(value = "装备存放位置",notes = "默认是库房") @ApiModelProperty(value = "装备存放位置",notes = "默认是库房")
private String storageLocation; private String storageLocation;
@ApiModelProperty(value = "装备存放位置的id",notes = "默认是库房id")
private Integer storageLocationId;
} }
...@@ -118,6 +118,9 @@ public class StorageBillSaveVo { ...@@ -118,6 +118,9 @@ public class StorageBillSaveVo {
@ApiModelProperty(value = "装备存放位置",notes = "默认是库房") @ApiModelProperty(value = "装备存放位置",notes = "默认是库房")
private String storageLocation ; private String storageLocation ;
@ApiModelProperty(value = "装备存放位置的id",notes = "默认是库房id")
private Integer storageLocationId;
@ApiModelProperty(value = "是否是试用装备",notes = "0 是正式 1 是测试") @ApiModelProperty(value = "是否是试用装备",notes = "0 是正式 1 是测试")
private Integer tryOutDevice = 0; private Integer tryOutDevice = 0;
......
package com.tykj.dev.union; //package com.tykj.dev.union;
//
/** ///**
* @author zjm // * @author zjm
* @version 1.0.0 // * @version 1.0.0
* @ClassName AreaController.java // * @ClassName AreaController.java
* @Description TODO // * @Description TODO
* @createTime 2020年09月04日 13:34:00 // * @createTime 2020年09月04日 13:34:00
*/ // */
//
import com.tykj.dev.config.swagger.AutoDocument; //import com.tykj.dev.config.swagger.AutoDocument;
import com.tykj.dev.device.user.subject.dao.AreaDao; //import com.tykj.dev.device.user.subject.dao.AreaDao;
import com.tykj.dev.device.user.subject.entity.Area; //import com.tykj.dev.device.user.subject.entity.Area;
import com.tykj.dev.device.user.subject.entity.SecurityUser; //import com.tykj.dev.device.user.subject.entity.SecurityUser;
import com.tykj.dev.device.user.subject.service.AreaService; //import com.tykj.dev.device.user.subject.service.AreaService;
import com.tykj.dev.misc.exception.ApiException; //import com.tykj.dev.misc.exception.ApiException;
import io.swagger.annotations.Api; //import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; //import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; //import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity; //import org.springframework.http.ResponseEntity;
import org.springframework.security.core.annotation.AuthenticationPrincipal; //import org.springframework.security.core.annotation.AuthenticationPrincipal;
import org.springframework.web.bind.annotation.*; //import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore; //import springfox.documentation.annotations.ApiIgnore;
//
import java.util.Optional; //import java.util.Optional;
//
/** ///**
* 区域视图层 // * 区域视图层
*/ // */
@RestController //@RestController
@RequestMapping("/run") //@RequestMapping("/run")
public class RunController { //public class RunController {
@Autowired // @Autowired
DataInit dataInit; // DataInit dataInit;
@GetMapping(value = "/init2") // @GetMapping(value = "/init2")
public ResponseEntity addPermissions(@ApiIgnore @AuthenticationPrincipal SecurityUser securityUser) { // public ResponseEntity addPermissions(@ApiIgnore @AuthenticationPrincipal SecurityUser securityUser) {
dataInit.init2(); // dataInit.init2();
return ResponseEntity.ok("ok"); // return ResponseEntity.ok("ok");
} // }
//
//
} //}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论