|
@@ -3,6 +3,8 @@ package com.lc.ibps.components.equipment.domain;
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
|
|
|
|
|
|
|
|
+import com.lc.ibps.entrust.dao.PerfVerificationRecordDao;
|
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.context.annotation.Scope;
|
|
import org.springframework.context.annotation.Scope;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
@@ -21,6 +23,7 @@ import com.lc.ibps.components.equipment.repository.AccessoriesDeviceRepository;
|
|
|
import com.lc.ibps.components.equipment.persistence.entity.AccessoriesDevicePo;
|
|
import com.lc.ibps.components.equipment.persistence.entity.AccessoriesDevicePo;
|
|
|
import com.lc.ibps.components.equipment.repository.MaintenanceItemRepository;
|
|
import com.lc.ibps.components.equipment.repository.MaintenanceItemRepository;
|
|
|
import com.lc.ibps.components.equipment.persistence.entity.MaintenanceItemPo;
|
|
import com.lc.ibps.components.equipment.persistence.entity.MaintenanceItemPo;
|
|
|
|
|
+import com.lc.ibps.components.equipment.persistence.entity.PerfVerificationRecordPo;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 设备档案卡 领域对象实体
|
|
* 设备档案卡 领域对象实体
|
|
@@ -49,6 +52,9 @@ public class EquipmentCard extends AbstractDomain<String, EquipmentCardPo>{
|
|
|
@Resource
|
|
@Resource
|
|
|
private MaintenanceItemRepository maintenanceItemRepository;
|
|
private MaintenanceItemRepository maintenanceItemRepository;
|
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private PerfVerificationRecordDao perfVerificationRecordDao;
|
|
|
|
|
+
|
|
|
protected void init(){
|
|
protected void init(){
|
|
|
//
|
|
//
|
|
|
}
|
|
}
|
|
@@ -82,7 +88,8 @@ public class EquipmentCard extends AbstractDomain<String, EquipmentCardPo>{
|
|
|
MaintenanceItem maintenanceItem = maintenanceItemRepository.newInstance();
|
|
MaintenanceItem maintenanceItem = maintenanceItemRepository.newInstance();
|
|
|
maintenanceItem.deleteByMainId(getData().getId());
|
|
maintenanceItem.deleteByMainId(getData().getId());
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
+ // “附属设备及配件” tab页数据的处理
|
|
|
AccessoriesDevice accessoriesDevice = accessoriesDeviceRepository.newInstance();
|
|
AccessoriesDevice accessoriesDevice = accessoriesDeviceRepository.newInstance();
|
|
|
if(BeanUtils.isNotEmpty(getData().getAccessoriesDevicePoList())){
|
|
if(BeanUtils.isNotEmpty(getData().getAccessoriesDevicePoList())){
|
|
|
for(AccessoriesDevicePo accessoriesDevicePo:getData().getAccessoriesDevicePoList()){
|
|
for(AccessoriesDevicePo accessoriesDevicePo:getData().getAccessoriesDevicePoList()){
|
|
@@ -91,6 +98,8 @@ public class EquipmentCard extends AbstractDomain<String, EquipmentCardPo>{
|
|
|
accessoriesDevice.save(accessoriesDevicePo);
|
|
accessoriesDevice.save(accessoriesDevicePo);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ //“维护项目” tab页数据的处理
|
|
|
MaintenanceItem maintenanceItem = maintenanceItemRepository.newInstance();
|
|
MaintenanceItem maintenanceItem = maintenanceItemRepository.newInstance();
|
|
|
if(BeanUtils.isNotEmpty(getData().getMaintenanceItemPoList())){
|
|
if(BeanUtils.isNotEmpty(getData().getMaintenanceItemPoList())){
|
|
|
for(MaintenanceItemPo maintenanceItemPo:getData().getMaintenanceItemPoList()){
|
|
for(MaintenanceItemPo maintenanceItemPo:getData().getMaintenanceItemPoList()){
|
|
@@ -99,6 +108,30 @@ public class EquipmentCard extends AbstractDomain<String, EquipmentCardPo>{
|
|
|
maintenanceItem.save(maintenanceItemPo);
|
|
maintenanceItem.save(maintenanceItemPo);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ //“性能验证记录” tab页数据的处理
|
|
|
|
|
+ if(BeanUtils.isNotEmpty(getData().getPerfVerificationRecordPoList())){
|
|
|
|
|
+ java.util.List<String> existingIds = perfVerificationRecordDao.getIdsBySheBeiId(getData().getId());
|
|
|
|
|
+ java.util.List<String> currentIds = new java.util.ArrayList<>();
|
|
|
|
|
+ for(PerfVerificationRecordPo po : getData().getPerfVerificationRecordPoList()){
|
|
|
|
|
+ po.setSheBeiId(getData().getId());
|
|
|
|
|
+ if(StringUtil.isEmpty(po.getId())){
|
|
|
|
|
+ po.setId(com.lc.ibps.base.framework.id.UniqueIdUtil.getId());
|
|
|
|
|
+ perfVerificationRecordDao.insert(po);
|
|
|
|
|
+ }else{
|
|
|
|
|
+ perfVerificationRecordDao.update(po);
|
|
|
|
|
+ }
|
|
|
|
|
+ currentIds.add(po.getId());
|
|
|
|
|
+ }
|
|
|
|
|
+ for(String existingId : existingIds){
|
|
|
|
|
+ if(!currentIds.contains(existingId)){
|
|
|
|
|
+ perfVerificationRecordDao.deleteById(existingId);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -123,4 +156,4 @@ public class EquipmentCard extends AbstractDomain<String, EquipmentCardPo>{
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
-}
|
|
|
|
|
|
|
+}
|