|
|
@ -5,9 +5,12 @@ import java.util.Iterator;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.os.common.exception.ServiceException;
|
|
|
|
import com.os.common.utils.DateUtils;
|
|
|
|
import com.os.common.utils.DateUtils;
|
|
|
|
import com.os.common.utils.StringUtils;
|
|
|
|
import com.os.common.utils.StringUtils;
|
|
|
|
|
|
|
|
import com.os.ems.base.domain.EmsBaseMonitorWorkUnit;
|
|
|
|
import com.os.ems.base.domain.TreeSelects;
|
|
|
|
import com.os.ems.base.domain.TreeSelects;
|
|
|
|
|
|
|
|
import com.os.ems.base.mapper.EmsBaseMonitorWorkUnitMapper;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
import com.os.ems.base.mapper.EmsBaseWorkUnitMapper;
|
|
|
|
import com.os.ems.base.mapper.EmsBaseWorkUnitMapper;
|
|
|
@ -26,6 +29,9 @@ public class EmsBaseWorkUnitServiceImpl implements IEmsBaseWorkUnitService
|
|
|
|
@Autowired
|
|
|
|
@Autowired
|
|
|
|
private EmsBaseWorkUnitMapper emsBaseWorkUnitMapper;
|
|
|
|
private EmsBaseWorkUnitMapper emsBaseWorkUnitMapper;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
|
|
|
private EmsBaseMonitorWorkUnitMapper emsBaseMonitorWorkUnitMapper;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 查询统计单元信息
|
|
|
|
* 查询统计单元信息
|
|
|
|
*
|
|
|
|
*
|
|
|
@ -85,6 +91,15 @@ public class EmsBaseWorkUnitServiceImpl implements IEmsBaseWorkUnitService
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public int deleteEmsBaseWorkUnitByObjIds(Long[] objIds)
|
|
|
|
public int deleteEmsBaseWorkUnitByObjIds(Long[] objIds)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
for (Long objId : objIds) {
|
|
|
|
|
|
|
|
EmsBaseWorkUnit baseWorkUnit = this.selectEmsBaseWorkUnitByObjId(objId);
|
|
|
|
|
|
|
|
EmsBaseMonitorWorkUnit monitorWorkUnit = new EmsBaseMonitorWorkUnit();
|
|
|
|
|
|
|
|
monitorWorkUnit.setWorkUnitCode(baseWorkUnit.getWorkUnitCode());
|
|
|
|
|
|
|
|
List<EmsBaseMonitorWorkUnit> workUnits = emsBaseMonitorWorkUnitMapper.selectEmsBaseMonitorWorkUnitList(monitorWorkUnit);
|
|
|
|
|
|
|
|
if (workUnits.size() > 0){
|
|
|
|
|
|
|
|
throw new ServiceException(baseWorkUnit.getWorkUnitName() + "已关联计量设备,无法删除!");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
return emsBaseWorkUnitMapper.deleteEmsBaseWorkUnitByObjIds(objIds);
|
|
|
|
return emsBaseWorkUnitMapper.deleteEmsBaseWorkUnitByObjIds(objIds);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|