|
@@ -6,8 +6,10 @@ import com.zglc.kg.base.Result;
|
|
import tk.mybatis.mapper.entity.Example;
|
|
import tk.mybatis.mapper.entity.Example;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
|
|
+import java.util.HashMap;
|
|
import java.util.Iterator;
|
|
import java.util.Iterator;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
+import java.util.Map;
|
|
|
|
|
|
@Service
|
|
@Service
|
|
public class DeviceService {
|
|
public class DeviceService {
|
|
@@ -43,7 +45,7 @@ public class DeviceService {
|
|
DeviceEntity device = deviceDao.getLastInsert();
|
|
DeviceEntity device = deviceDao.getLastInsert();
|
|
Device1Entity device1 = new Device1Entity();
|
|
Device1Entity device1 = new Device1Entity();
|
|
// device1.setId(device.getId().longValue());
|
|
// device1.setId(device.getId().longValue());
|
|
- device1.setDevice_name(device.getDevice_name());
|
|
|
|
|
|
+ device1.setName(device.getDevice_name());
|
|
device1.setDevice_type(device.getDevice_type());
|
|
device1.setDevice_type(device.getDevice_type());
|
|
device1.setDevice_describe(device.getDevice_describe());
|
|
device1.setDevice_describe(device.getDevice_describe());
|
|
device1.setAircraft_id(device.getAircraft_id());
|
|
device1.setAircraft_id(device.getAircraft_id());
|
|
@@ -54,7 +56,7 @@ public class DeviceService {
|
|
device1.setSubsys_name(device.getSubsys_name());
|
|
device1.setSubsys_name(device.getSubsys_name());
|
|
device1.setMysqlId(device.getId());
|
|
device1.setMysqlId(device.getId());
|
|
aircraftSystemRelation.setEndNode(device1);
|
|
aircraftSystemRelation.setEndNode(device1);
|
|
- aircraftSystemRelation.setRelationAS("包含");
|
|
|
|
|
|
+ aircraftSystemRelation.setRelation("包含");
|
|
aircraftSystemRelationDao.save(aircraftSystemRelation);
|
|
aircraftSystemRelationDao.save(aircraftSystemRelation);
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
@@ -64,7 +66,7 @@ public class DeviceService {
|
|
systemSubsystemRelation.setStartNode(device1);
|
|
systemSubsystemRelation.setStartNode(device1);
|
|
DeviceEntity device = deviceDao.getLastInsert();
|
|
DeviceEntity device = deviceDao.getLastInsert();
|
|
Device1Entity device2 = new Device1Entity();
|
|
Device1Entity device2 = new Device1Entity();
|
|
- device2.setDevice_name(device.getDevice_name());
|
|
|
|
|
|
+ device2.setName(device.getDevice_name());
|
|
device2.setDevice_type(device.getDevice_type());
|
|
device2.setDevice_type(device.getDevice_type());
|
|
device2.setDevice_describe(device.getDevice_describe());
|
|
device2.setDevice_describe(device.getDevice_describe());
|
|
device2.setAircraft_id(device.getAircraft_id());
|
|
device2.setAircraft_id(device.getAircraft_id());
|
|
@@ -75,7 +77,7 @@ public class DeviceService {
|
|
device2.setSubsys_name(device.getSubsys_name());
|
|
device2.setSubsys_name(device.getSubsys_name());
|
|
device2.setMysqlId(device.getId());
|
|
device2.setMysqlId(device.getId());
|
|
systemSubsystemRelation.setEndNode(device2);
|
|
systemSubsystemRelation.setEndNode(device2);
|
|
- systemSubsystemRelation.setRelationSysSub("包含");
|
|
|
|
|
|
+ systemSubsystemRelation.setRelation("包含");
|
|
systemSubsystemRelationDao.save(systemSubsystemRelation);
|
|
systemSubsystemRelationDao.save(systemSubsystemRelation);
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
@@ -85,7 +87,7 @@ public class DeviceService {
|
|
subsystemDeviceRelation.setStartNode(device1);
|
|
subsystemDeviceRelation.setStartNode(device1);
|
|
DeviceEntity device = deviceDao.getLastInsert();
|
|
DeviceEntity device = deviceDao.getLastInsert();
|
|
Device1Entity device2 = new Device1Entity();
|
|
Device1Entity device2 = new Device1Entity();
|
|
- device2.setDevice_name(device.getDevice_name());
|
|
|
|
|
|
+ device2.setName(device.getDevice_name());
|
|
device2.setDevice_type(device.getDevice_type());
|
|
device2.setDevice_type(device.getDevice_type());
|
|
device2.setDevice_describe(device.getDevice_describe());
|
|
device2.setDevice_describe(device.getDevice_describe());
|
|
device2.setAircraft_id(device.getAircraft_id());
|
|
device2.setAircraft_id(device.getAircraft_id());
|
|
@@ -96,7 +98,7 @@ public class DeviceService {
|
|
device2.setSubsys_name(device.getSubsys_name());
|
|
device2.setSubsys_name(device.getSubsys_name());
|
|
device2.setMysqlId(device.getId());
|
|
device2.setMysqlId(device.getId());
|
|
subsystemDeviceRelation.setEndNode(device2);
|
|
subsystemDeviceRelation.setEndNode(device2);
|
|
- subsystemDeviceRelation.setRelationSubD("包含");
|
|
|
|
|
|
+ subsystemDeviceRelation.setRelation("包含");
|
|
subsystemDeviceRelationDao.save(subsystemDeviceRelation);
|
|
subsystemDeviceRelationDao.save(subsystemDeviceRelation);
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
@@ -147,7 +149,7 @@ public class DeviceService {
|
|
if (tmpData != null) {
|
|
if (tmpData != null) {
|
|
int index = deviceDao.updateByPrimaryKeySelective(data);
|
|
int index = deviceDao.updateByPrimaryKeySelective(data);
|
|
Device1Entity device1 = device1Dao.getDevice1EntitiesByMysqlId(data.getId());
|
|
Device1Entity device1 = device1Dao.getDevice1EntitiesByMysqlId(data.getId());
|
|
- device1.setDevice_name(data.getDevice_name());
|
|
|
|
|
|
+ device1.setName(data.getDevice_name());
|
|
device1.setDevice_type(data.getDevice_type());
|
|
device1.setDevice_type(data.getDevice_type());
|
|
device1.setDevice_describe(data.getDevice_describe());
|
|
device1.setDevice_describe(data.getDevice_describe());
|
|
device1.setAircraft_id(data.getAircraft_id());
|
|
device1.setAircraft_id(data.getAircraft_id());
|
|
@@ -171,6 +173,11 @@ public class DeviceService {
|
|
return Result.result(flag, msg, msg);
|
|
return Result.result(flag, msg, msg);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public Result<List<AircraftSystemRelationEntity>> findAllAircraftSystemRe(){
|
|
|
|
+ List<AircraftSystemRelationEntity> list = device1Dao.findAllAircraftSystemRe();
|
|
|
|
+ return Result.success(list);
|
|
|
|
+ }
|
|
|
|
+
|
|
public List<DeviceEntity> listAll(int deviceType) {
|
|
public List<DeviceEntity> listAll(int deviceType) {
|
|
Example example = new Example(DeviceEntity.class);
|
|
Example example = new Example(DeviceEntity.class);
|
|
example.createCriteria().andEqualTo("device_type", deviceType);
|
|
example.createCriteria().andEqualTo("device_type", deviceType);
|
|
@@ -208,9 +215,6 @@ public class DeviceService {
|
|
return deviceDao.selectByPrimaryKey(id);
|
|
return deviceDao.selectByPrimaryKey(id);
|
|
}
|
|
}
|
|
|
|
|
|
-// public Integer getCount() {
|
|
|
|
-// return deviceDao.getCount();
|
|
|
|
-// }
|
|
|
|
|
|
|
|
public Result<List<DeviceEntity>> findByName(String name,Integer deviceType){
|
|
public Result<List<DeviceEntity>> findByName(String name,Integer deviceType){
|
|
if (name == null || "".equals(name)){
|
|
if (name == null || "".equals(name)){
|
|
@@ -223,4 +227,13 @@ public class DeviceService {
|
|
List<DeviceEntity> list = deviceDao.findByName1("%" + name + "%",deviceType);
|
|
List<DeviceEntity> list = deviceDao.findByName1("%" + name + "%",deviceType);
|
|
return Result.success(list);
|
|
return Result.success(list);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ public Result<Map<String, Object>> findAircraftKg(String name){
|
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
|
+// if (type == null || "".equals(type) || "all".equals(type)){
|
|
|
|
+ map.put("AircraftSystemRe", device1Dao.findAircraftSystemReByAircraft(name));
|
|
|
|
+ map.put("SystemSubsystemRe", device1Dao.findSystemSubsystemReByAircraft(name));
|
|
|
|
+ map.put("SubsystemDeviceRe", device1Dao.findSubsystemDeviceReByAircraft(name));
|
|
|
|
+ return Result.success(map);
|
|
|
|
+ }
|
|
}
|
|
}
|