|
@@ -137,6 +137,22 @@ public class TDeviceListServiceImpl implements ITDeviceListService
|
|
|
@Override
|
|
|
public int deleteTDeviceListByIds(Integer[] ids)
|
|
|
{
|
|
|
+ List<TDeviceList> tDeviceLists = tDeviceListMapper.selectTDeviceList();
|
|
|
+ if (StringUtils.isNotEmpty(ids))
|
|
|
+ {
|
|
|
+ for (Integer id : ids)
|
|
|
+ {
|
|
|
+ for (TDeviceList tDevice : tDeviceLists)
|
|
|
+ {
|
|
|
+ if (tDevice.getId().equals(id)){
|
|
|
+ TFacility tFacility = tFacilityMapper.selectTFacilityByCode(tDevice.getDeviceId());
|
|
|
+ if (StringUtils.isNotNull(tFacility)){
|
|
|
+ tFacilityMapper.deleteTFacilityById(tFacility.getId());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
return tDeviceListMapper.deleteTDeviceListByIds(ids);
|
|
|
}
|
|
|
|
|
@@ -149,6 +165,11 @@ public class TDeviceListServiceImpl implements ITDeviceListService
|
|
|
@Override
|
|
|
public int deleteTDeviceListById(Integer id)
|
|
|
{
|
|
|
+ TDeviceList tDevice= this.selectTDeviceListById(id);
|
|
|
+ TFacility tFacility = tFacilityMapper.selectTFacilityByCode(tDevice.getDeviceId());
|
|
|
+ if (StringUtils.isNotNull(tFacility)){
|
|
|
+ tFacilityMapper.deleteTFacilityById(tFacility.getId());
|
|
|
+ }
|
|
|
return tDeviceListMapper.deleteTDeviceListById(id);
|
|
|
}
|
|
|
|