提交 f5bee343 authored 作者: 邓砥奕's avatar 邓砥奕

[修改bug]修改销毁、入库、更新列装库等bug

上级 e6fd1ee7
......@@ -17,6 +17,7 @@ import com.tykj.dev.device.task.subject.bto.TaskBto;
import com.tykj.dev.device.user.subject.entity.User;
import com.tykj.dev.device.user.subject.service.UserPublicService;
import com.tykj.dev.device.user.util.AuthenticationUtils;
import com.tykj.dev.device.user.util.UserUtils;
import com.tykj.dev.misc.base.BusinessEnum;
import com.tykj.dev.misc.base.StatusEnum;
import com.tykj.dev.misc.utils.ListUtil;
......@@ -60,6 +61,8 @@ public class DeviceDestroyController {
MyWebSocket myWebSocket;
@Autowired
private AuthenticationUtils AuthenticationUtils;
@Autowired
private UserUtils userUtils;
public DeviceDestroyController(DeviceDestroyBillService deviceDestroyBillServiceyBillService, TaskService taskService, DeviceLibraryService deviceLibraryService, UserPublicService userPublicService, DeviceLogService deviceLogService, TaskLogService taskLogService) {
this.deviceDestroyBillService = deviceDestroyBillServiceyBillService;
......@@ -256,7 +259,7 @@ public class DeviceDestroyController {
".",
destroyBill.getId(),
BusinessEnum.DESTROY.id,
destroyBill.getStartUserAId(),
userUtils.getCurrentUnitId(),
1,
"",
ListUtil.createList(destroyBill.getStartUserAId(), destroyBill.getStartUserBId()));
......
......@@ -108,4 +108,9 @@ public interface DeviceLibraryService {
* 查询在库所有装备的型号
*/
List<String> getAllInLibraryModels();
/**
* 查询可清退装备
*/
List<DeviceLibrary> getSendBackDevice(DeviceLibrarySelectVo deviceLibrarySelectVo);
}
......@@ -303,6 +303,14 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
return new ArrayList<>(s);
}
/**
* 查询可清退装备
*/
@Override
public List<DeviceLibrary> getSendBackDevice(DeviceLibrarySelectVo deviceLibrarySelectVo) {
return deviceLibraryDao.findAll(getSelectSpecification3(deviceLibrarySelectVo));
}
@Override
public List<DeviceLibrary> getAllList(DeviceLibrarySelectVo deviceLibrarySelectVo) {
return deviceLibraryDao.findAll(getSelectSpecification4(deviceLibrarySelectVo));
......@@ -372,6 +380,12 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
return predicateBuilder.build();
}
private Specification<DeviceLibrary> getSelectSpecification3(DeviceLibrarySelectVo deviceLibrarySelectVo) {
PredicateBuilder<DeviceLibrary> predicateBuilder = getPredicateBuilder(deviceLibrarySelectVo);
predicateBuilder.notIn("ownUnit", userUtils.getCurrentUserUnitName());
return predicateBuilder.build();
}
private Specification<DeviceLibrary> getSelectSpecification4(DeviceLibrarySelectVo deviceLibrarySelectVo) {
PredicateBuilder<DeviceLibrary> predicateBuilder = getPredicateBuilder(deviceLibrarySelectVo);
return predicateBuilder.build();
......
......@@ -69,30 +69,40 @@ public class PackingLibraryController {
//更新列装信息
if (packingEditVo.getUpdateVoList() != null) {
PackingLibrary packingLibraryEntity = packingLibraryService.getOne(packingEditVo.getPackingId());
//获取配件列装
List<PackingLibrary> packingLibraries = packingLibraryService.selectAllPart(packingEditVo.getPackingId());
PackingLibraryUpdateVo p = packingEditVo.getUpdateVoList();
if (p.getApplyType() != null) {
packingLibraryEntity.setApplyType(p.getApplyType());
packingLibraries.forEach(packingLibrary -> packingLibrary.setApplyType(p.getApplyType()));
}
if (p.getCreateUnit() != null) {
packingLibraryEntity.setCreateUnit(p.getCreateUnit());
packingLibraries.forEach(packingLibrary -> packingLibrary.setCreateUnit(p.getCreateUnit()));
}
if (p.getFileName() != null) {
packingLibraryEntity.setFileName(p.getFileName());
packingLibraries.forEach(packingLibrary -> packingLibrary.setFileName(p.getFileName()));
}
if (p.getFileUrl() != null) {
packingLibraryEntity.setFileUrl(p.getFileUrl());
packingLibraries.forEach(packingLibrary -> packingLibrary.setFileUrl(p.getFileUrl()));
}
if (p.getImageName() != null) {
packingLibraryEntity.setImageName(p.getImageName());
packingLibraries.forEach(packingLibrary -> packingLibrary.setImageName(p.getImageName()));
}
if (p.getImageUrl() != null) {
packingLibraryEntity.setImageUrl(p.getImageUrl());
packingLibraries.forEach(packingLibrary -> packingLibrary.setImageUrl(p.getImageUrl()));
}
if (p.getInvisibleRange() != null) {
packingLibraryEntity.setInvisibleRange(p.getInvisibleRange());
packingLibraries.forEach(packingLibrary -> packingLibrary.setInvisibleRange(p.getInvisibleRange()));
}
if (p.getMatchingRange() != null) {
packingLibraryEntity.setMatchingRange(p.getMatchingRange());
packingLibraries.forEach(packingLibrary -> packingLibrary.setMatchingRange(p.getMatchingRange()));
}
if (p.getModel() != null) {
packingLibraryEntity.setModel(p.getModel());
......@@ -102,23 +112,47 @@ public class PackingLibraryController {
}
if (p.getNature() != null) {
packingLibraryEntity.setNature(p.getNature());
packingLibraries.forEach(packingLibrary -> packingLibrary.setNature(p.getNature()));
}
if (p.getPrice() != null) {
packingLibraryEntity.setPrice(p.getPrice());
packingLibraries.forEach(packingLibrary -> packingLibrary.setPrice(p.getPrice()));
}
if (p.getProdUnit() != null) {
packingLibraryEntity.setProdUnit(p.getProdUnit());
packingLibraries.forEach(packingLibrary -> packingLibrary.setProdUnit(p.getProdUnit()));
}
if (p.getSecretLevel() != null) {
packingLibraryEntity.setSecretLevel(p.getSecretLevel());
packingLibraries.forEach(packingLibrary -> packingLibrary.setSecretLevel(p.getSecretLevel()));
}
if (p.getStatus() != null) {
packingLibraryEntity.setStatus(p.getStatus());
packingLibraries.forEach(packingLibrary -> packingLibrary.setStatus(p.getStatus()));
}
if (p.getType() != null) {
packingLibraryEntity.setType(p.getType());
}
packingLibraryService.update(packingLibraryEntity);
packingLibraries.forEach(packingLibrary -> packingLibraryService.update(packingLibrary));
}
//更新配件信息
if (packingEditVo.getPartUpdateVoList()!=null){
packingEditVo.getPartUpdateVoList().forEach(packingLibraryUpdateVo -> {
if (packingLibraryUpdateVo.getPackingId() > 0){
PackingLibrary packingLibrary = packingLibraryService.getOne(packingLibraryUpdateVo.getPackingId());
if (packingLibraryUpdateVo.getModel()!=null){
packingLibrary.setModel(packingLibraryUpdateVo.getModel());
}
if (packingLibraryUpdateVo.getName()!=null){
packingLibrary.setName(packingLibraryUpdateVo.getName());
}
if (packingLibraryUpdateVo.getType()!=null){
packingLibrary.setType(packingLibraryUpdateVo.getType());
}
packingLibraryService.update(packingLibrary);
}
});
}
//添加新增配件
if (packingEditVo.getPartAddList() != null) {
......
......@@ -18,6 +18,9 @@ public class PackingEditVo {
@ApiModelProperty(value = "列装库更新信息")
private PackingLibraryUpdateVo updateVoList;
@ApiModelProperty(value = "列装库配件更新信息")
private List<PackingLibraryUpdateVo> partUpdateVoList;
@ApiModelProperty(value = "新增配件信息列表")
private List<PartSaveVo> partAddList;
......
......@@ -19,6 +19,7 @@ import com.tykj.dev.device.task.subject.bto.TaskBto;
import com.tykj.dev.device.user.subject.entity.User;
import com.tykj.dev.device.user.subject.service.UserPublicService;
import com.tykj.dev.device.user.util.AuthenticationUtils;
import com.tykj.dev.device.user.util.UserUtils;
import com.tykj.dev.misc.base.BusinessEnum;
import com.tykj.dev.misc.base.StatusEnum;
import com.tykj.dev.misc.utils.ListUtil;
......@@ -69,6 +70,9 @@ public class DeviceRetiredController {
@Autowired
private UserPublicService userPublicService;
@Autowired
private UserUtils userUtils;
public DeviceRetiredController(DeviceRetiredBillService deviceRetiredBillService, TaskService taskService, PackingLibraryService packingLibraryService, DeviceLibraryService deviceLibraryService, DeviceLogService deviceLogService, TaskLogService taskLogService) {
this.deviceRetiredBillService = deviceRetiredBillService;
this.taskService = taskService;
......@@ -124,6 +128,8 @@ public class DeviceRetiredController {
deviceRetiredDetailResultVo.setRetiredStatus(deviceRetiredBillEntity.getRetiredStatus());
deviceRetiredDetailResultVo.setConfirmUser(userPublicService.getOne(deviceRetiredBillEntity.getUserBId()).getName());
deviceRetiredDetailResultVo.setStartUser(userPublicService.getOne(deviceRetiredBillEntity.getUserAId()).getName());
deviceRetiredDetailResultVo.setConfirmUserId(deviceRetiredBillEntity.getUserBId());
deviceRetiredDetailResultVo.setStartUserId(deviceRetiredBillEntity.getUserAId());
return ResultUtil.success(deviceRetiredDetailResultVo);
}
......@@ -218,7 +224,7 @@ public class DeviceRetiredController {
".",
retiredBill.getId(),
BusinessEnum.RETIRED.id,
retiredBill.getUserAId(),
userUtils.getCurrentUnitId(),
1,
"",
ListUtil.createList(retiredBill.getUserAId(), retiredBill.getUserBId()));
......
......@@ -18,6 +18,12 @@ import java.util.List;
@ApiModel("销毁详情查询类")
public class DeviceRetiredDetailResultVo {
@ApiModelProperty(value = "发起人id", example = "1")
private Integer startUserId;
@ApiModelProperty(value = "审核人id", example = "1")
private Integer confirmUserId;
@ApiModelProperty(value = "发起人", example = "1")
private String startUser;
......
......@@ -186,6 +186,7 @@ public class StorageBillController {
//改变装备状态,添加装备日志
for (DeviceLibrary d : libraryEntities) {
d.setLifeStatus(2);
deviceLibraryService.update(d);
DeviceLogDto deviceLogDto = new DeviceLogDto(d.getId(), "入库审核成功", null);
deviceLogService.addLog(deviceLogDto);
}
......@@ -204,6 +205,7 @@ public class StorageBillController {
//改变装备状态,添加装备日志
for (DeviceLibrary d : libraryEntities) {
d.setLifeStatus(1);
deviceLibraryService.update(d);
DeviceLogDto deviceLogDto = new DeviceLogDto(d.getId(), "入库审核失败", null);
deviceLogService.addLog(deviceLogDto);
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论