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

feat(装备模块): 装备可以进行修改型号

装备可以进行修改型号
上级 d54ea284
...@@ -722,6 +722,7 @@ public class DeviceLibraryController { ...@@ -722,6 +722,7 @@ public class DeviceLibraryController {
@CacheEvict(value = "devicesLibraryList",key = "'device'",allEntries = true) @CacheEvict(value = "devicesLibraryList",key = "'device'",allEntries = true)
public ResponseEntity updateDeviceLibrary(@RequestBody @Validated DeviceEditVo deviceEditVo) { public ResponseEntity updateDeviceLibrary(@RequestBody @Validated DeviceEditVo deviceEditVo) {
DeviceLibrary deviceLibraryEntity = deviceLibraryService.getOne(deviceEditVo.getDeviceId()); DeviceLibrary deviceLibraryEntity = deviceLibraryService.getOne(deviceEditVo.getDeviceId());
deviceLibraryEntity.setConfigName();
//更新装备信息 //更新装备信息
if (deviceEditVo.getUpdateVoList() != null) { if (deviceEditVo.getUpdateVoList() != null) {
DeviceLibraryUpdateVo libraryUpdateVo = deviceEditVo.getUpdateVoList(); DeviceLibraryUpdateVo libraryUpdateVo = deviceEditVo.getUpdateVoList();
...@@ -752,13 +753,15 @@ public class DeviceLibraryController { ...@@ -752,13 +753,15 @@ public class DeviceLibraryController {
deviceLogService.addLog(deviceLogDto); deviceLogService.addLog(deviceLogDto);
deviceLibraryEntity.setMatchingRange(libraryUpdateVo.getMatchingRange()); deviceLibraryEntity.setMatchingRange(libraryUpdateVo.getMatchingRange());
} }
if (libraryUpdateVo.getModel() != null && !libraryUpdateVo.getModel().equals(deviceLibraryEntity.getModel())) { // if (libraryUpdateVo.getModel() != null && !libraryUpdateVo.getModel().equals(deviceLibraryEntity.getModel())) {
//添加装备日志 // //添加装备日志
String remark = "将装备的型号由" + deviceLibraryEntity.getModel() + "改为" + libraryUpdateVo.getModel(); // //修改型号就要修改列装id
DeviceLogDto deviceLogDto = new DeviceLogDto(deviceEditVo.getDeviceId(), remark, null,null,null); // String remark = "将装备的型号由" + deviceLibraryEntity.getModel() + "改为" + libraryUpdateVo.getModel();
deviceLogService.addLog(deviceLogDto); // DeviceLogDto deviceLogDto = new DeviceLogDto(deviceEditVo.getDeviceId(), remark, null,null,null);
deviceLibraryEntity.setModel(libraryUpdateVo.getModel()); // deviceLogService.addLog(deviceLogDto);
} // deviceLibraryEntity.setModel(libraryUpdateVo.getModel());
// }
if (libraryUpdateVo.getName() != null && !libraryUpdateVo.getName().equals(deviceLibraryEntity.getName())) { if (libraryUpdateVo.getName() != null && !libraryUpdateVo.getName().equals(deviceLibraryEntity.getName())) {
//添加装备日志 //添加装备日志
String remark = "将装备的名称由" + deviceLibraryEntity.getName() + "改为" + libraryUpdateVo.getName(); String remark = "将装备的名称由" + deviceLibraryEntity.getName() + "改为" + libraryUpdateVo.getName();
...@@ -838,6 +841,36 @@ public class DeviceLibraryController { ...@@ -838,6 +841,36 @@ public class DeviceLibraryController {
deviceLogService.addLog(deviceLogDto); deviceLogService.addLog(deviceLogDto);
deviceLibraryEntity.setTryOutDevice(libraryUpdateVo.getTryOutDevice()); deviceLibraryEntity.setTryOutDevice(libraryUpdateVo.getTryOutDevice());
} }
if (libraryUpdateVo.getPackingVo().getPackingId() != null && !libraryUpdateVo.getPackingVo().getPackingId().equals(deviceLibraryEntity.getPackingId())) {
//添加装备日志
//修改型号就要修改列装id
PackingVo packingVo = libraryUpdateVo.getPackingVo();
String remarkModel = "将装备的型号由" + deviceLibraryEntity.getModel() + "改为" + packingVo.getModel();
String remarkType = "";
String remarkName = "";
String remarkMatchingRange = "";
deviceLibraryEntity.setModel(packingVo.getModel());
deviceLibraryEntity.setPackingId(packingVo.getPackingId());
if (!deviceLibraryEntity.getName().equals(packingVo.getName())){
remarkName = "将装备的名称由" + deviceLibraryEntity.getName() + "改为" + packingVo.getName();
deviceLibraryEntity.setName(packingVo.getName());
}
//修改形态
if (!deviceLibraryEntity.getType().equals(packingVo.getType())){
remarkType= "将装备的形态由" + deviceLibraryEntity.getTypeName() + "改为" + packingVo.getTypeName();
deviceLibraryEntity.setType(packingVo.getType());
}
//修改配用范围
if (!deviceLibraryEntity.getMatchingRange().equals(packingVo.getMatchingRange())){
remarkMatchingRange = "将装备的配用范围由" + deviceLibraryEntity.getMatchingRangeName() + "改为" + packingVo.getMatchingRangeName();
deviceLibraryEntity.setMatchingRange(packingVo.getMatchingRange());
}
String lastRemark = (remarkModel+remarkType+remarkName+remarkMatchingRange).replaceAll("\\\"", "");
DeviceLogDto deviceLogDto = new DeviceLogDto(deviceEditVo.getDeviceId(), lastRemark, null,null,null);
deviceLogService.addLog(deviceLogDto);
}
deviceLibraryService.update(deviceLibraryEntity); deviceLibraryService.update(deviceLibraryEntity);
} }
//添加绑定配件 //添加绑定配件
......
...@@ -57,5 +57,8 @@ public class DeviceLibraryUpdateVo { ...@@ -57,5 +57,8 @@ public class DeviceLibraryUpdateVo {
@ApiModelProperty(value = "是否是试用装备",notes = "0 是正式 1 是测试") @ApiModelProperty(value = "是否是试用装备",notes = "0 是正式 1 是测试")
private Integer tryOutDevice = 0; private Integer tryOutDevice = 0;
@ApiModelProperty(value = "列装vo")
private PackingVo packingVo;
} }
package com.tykj.dev.device.library.subject.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author zsp
* @create 2022/1/26 10:41
*/
@Data
@ApiModel("列装库vo")
public class PackingVo {
@ApiModelProperty(value = "列装的id")
private Integer packingId;
/**
* 型号
*/
@ApiModelProperty(value = "型号")
private String model;
/**
* 名称
*/
@ApiModelProperty(value = "名称")
private String name;
/**
* 配用范围
*/
@ApiModelProperty(value = "配用范围",notes = "1 省以下纵向 2 中央到省 3 省以下横向 4 其他")
private Integer matchingRange;
/**
* 配用范围
*/
@ApiModelProperty(value = "配用范围",notes = "省以下纵向 中央到省 省以下横向 其他")
private String matchingRangeName;
/**
* 形态
*/
@ApiModelProperty(value = "形态")
private Integer type;
/**
* 形态
*/
@ApiModelProperty(value = "形态")
private String typeName;
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论