|
@@ -94,8 +94,6 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
|
|
|
|
|
|
@Autowired
|
|
|
private PmProjectConstructionService pmProjectConstructionService;
|
|
|
- @Autowired
|
|
|
- private PmDemandMapper demandMapper;
|
|
|
|
|
|
@Autowired
|
|
|
private BaseNoticeTypeService baseNoticeTypeService;
|
|
@@ -519,12 +517,14 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
|
|
|
*/
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
- public boolean bookBuilding(PmBookBuildingReqVo vo) {
|
|
|
+ public boolean bookBuilding(PmBookBuildingReqVo vo) throws Exception {
|
|
|
PmDemand pmDemand = this.getById(vo.getDemandId());
|
|
|
String projectType = pmDemand.getProjectType();
|
|
|
if(ProjectTypes.EQUIPMENTTYPE.getCode().equals(projectType)){ //装备类
|
|
|
PmDemandEquipReqVo pmDemandEquipReqVo = vo.getPmDemandEquipReqVo();
|
|
|
-
|
|
|
+ if(ObjectUtils.isEmpty(pmDemandEquipReqVo)){
|
|
|
+ throw new Exception("该需求是装备类的,pmDemandEquipReqVo不能为空");
|
|
|
+ }
|
|
|
LambdaQueryWrapper<PmDemandEquip> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
lambdaQueryWrapper.eq(PmDemandEquip::getDemandId,vo.getDemandId());
|
|
|
PmDemandEquip pmDemandEquip = iPmDemandEquipService.getOne(lambdaQueryWrapper);
|
|
@@ -550,7 +550,9 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
|
|
|
|
|
|
} else if(ProjectTypes.MATERIALTYPE.getCode().equals(projectType)) { //物资类
|
|
|
PmDemandMaterialsReqVo pmDemandMaterialsReqVo = vo.getPmDemandMaterialsReqVo();
|
|
|
-
|
|
|
+ if(ObjectUtils.isEmpty(pmDemandMaterialsReqVo)){
|
|
|
+ throw new Exception("该需求是物资类的,pmDemandMaterialsReqVo不能为空");
|
|
|
+ }
|
|
|
LambdaQueryWrapper<PmDemandMaterials> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
lambdaQueryWrapper.eq(PmDemandMaterials::getDemandId,vo.getDemandId());
|
|
|
PmDemandMaterials pmDemandMaterials = iPmDemandMaterialsService.getOne(lambdaQueryWrapper);
|
|
@@ -576,7 +578,9 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
|
|
|
|
|
|
} else if(ProjectTypes.SERVICESTYPE.getCode().equals(projectType)) { //服务类
|
|
|
PmDemandServeReqVo pmDemandServeReqVo = vo.getPmDemandServeReqVo();
|
|
|
-
|
|
|
+ if(ObjectUtils.isEmpty(pmDemandServeReqVo)){
|
|
|
+ throw new Exception("该需求是服务类的,pmDemandServeReqVo不能为空");
|
|
|
+ }
|
|
|
LambdaQueryWrapper<PmDemandServe> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
lambdaQueryWrapper.eq(PmDemandServe::getDemandId,vo.getDemandId());
|
|
|
PmDemandServe pmDemandServe = iPmDemandServeService.getOne(lambdaQueryWrapper);
|
|
@@ -601,7 +605,9 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
|
|
|
|
|
|
} else if(ProjectTypes.PLANTOEXAMINETYPE.getCode().equals(projectType)) { //工程类
|
|
|
PmDemandEngineeringReqVo pmDemandEngineeringReqVo = vo.getPmDemandEngineeringReqVo();
|
|
|
-
|
|
|
+ if(ObjectUtils.isEmpty(pmDemandEngineeringReqVo)){
|
|
|
+ throw new Exception("该需求是工程类的,pmDemandEngineeringReqVo不能为空");
|
|
|
+ }
|
|
|
LambdaQueryWrapper<PmDemandEngineering> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
lambdaQueryWrapper.eq(PmDemandEngineering::getDemandId,vo.getDemandId());
|
|
|
PmDemandEngineering pmDemandEngineering = iPmDemandEngineeringService.getOne(lambdaQueryWrapper);
|
|
@@ -1550,7 +1556,7 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
|
|
|
public AjaxResult getListByStatus(String projectStatus) {
|
|
|
LambdaQueryWrapper<PmDemand> lw = new LambdaQueryWrapper<PmDemand>();
|
|
|
lw.eq(PmDemand::getProjectStatus, projectStatus);
|
|
|
- List<PmDemand> demandList = demandMapper.selectList(lw);
|
|
|
+ List<PmDemand> demandList = this.baseMapper.selectList(lw);
|
|
|
//数据转换
|
|
|
List<PmDemandResVo> pmDemandResponseVoList = new ArrayList<>();
|
|
|
if (!ObjectUtils.isEmpty(demandList) && demandList.size() > 0) {
|