|
@@ -15,7 +15,6 @@ import com.huashe.park.core.mapper.ConsUnitInfoMapper;
|
|
|
import com.huashe.park.core.service.IConsPileHoleInfoService;
|
|
|
import com.huashe.park.core.service.IConsUnitInfoService;
|
|
|
import com.huashe.park.core.service.IConsUnitMachineRelService;
|
|
|
-import com.huashe.park.domain.dto.cons.ConsUnitHole;
|
|
|
import com.huashe.park.domain.dto.cons.ConsUnitMachine;
|
|
|
import com.huashe.park.domain.entity.ConsPileHoleInfo;
|
|
|
import com.huashe.park.domain.entity.ConsUnitInfo;
|
|
@@ -147,11 +146,6 @@ public class ConsUnitInfoServiceImpl implements IConsUnitInfoService {
|
|
|
return consUnitInfoMapper.hasChildById(id) > 0;
|
|
|
}
|
|
|
|
|
|
- @Override
|
|
|
- public boolean hasHoleById(Long id) {
|
|
|
- return consUnitInfoMapper.hasHoleById(id) > 0;
|
|
|
- }
|
|
|
-
|
|
|
/**
|
|
|
* 删除施工单元信息
|
|
|
*
|
|
@@ -163,17 +157,18 @@ public class ConsUnitInfoServiceImpl implements IConsUnitInfoService {
|
|
|
if (hasChildById(id)) {
|
|
|
throw new ServiceException(MessageUtils.message("cons.unit.delete.no.child"));
|
|
|
}
|
|
|
- if (hasHoleById(id)) {
|
|
|
- throw new ServiceException(MessageUtils.message("cons.unit.has.no.hole"));
|
|
|
- }
|
|
|
+ pileHoleInfoService.deleteConsPileHoleInfoByConsUnitId(id);
|
|
|
+ consUnitMachineRelService.deleteConsUnitMachineRelByUnitId(id);
|
|
|
return consUnitInfoMapper.deleteConsUnitInfoById(id);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public void importConsUnitHole(ConsUnitHole consUnitHole) {
|
|
|
+ public void importConsUnitHole(ConsUnitInfo consUnitHole) {
|
|
|
int lastIndex = RuoYiConfig.getUploadPath().lastIndexOf("/");
|
|
|
String filePath = consUnitHole.getFileId().replaceFirst(PROFILE,
|
|
|
RuoYiConfig.getUploadPath().substring(0, lastIndex));
|
|
|
+ consUnitInfoMapper.updateConsUnitInfo(consUnitHole);
|
|
|
+ pileHoleInfoService.deleteConsPileHoleInfoByConsUnitId(consUnitHole.getId());
|
|
|
excelHandle.importExcel(filePath, ConsPileHoleInfo.class, (data) -> {
|
|
|
data.forEach((d) -> {
|
|
|
d.setConsUnitId(consUnitHole.getId());
|