|
@@ -11,11 +11,16 @@ import com.ozs.pm.doman.vo.requestVo.PmRequestVo;
|
|
|
import com.ozs.pm.doman.vo.responseVo.*;
|
|
|
import com.ozs.pm.mapper.PmDemandMapper;
|
|
|
import com.ozs.pm.service.*;
|
|
|
+import com.ozs.system.domain.SysFileInfo;
|
|
|
+import com.ozs.system.domain.SysFileRef;
|
|
|
import com.ozs.system.domain.vo.responseVo.SysDeptResponseVo;
|
|
|
import com.ozs.system.service.ISysDeptService;
|
|
|
import com.ozs.system.service.ISysDictDataService;
|
|
|
+import com.ozs.system.service.SysFileRefService;
|
|
|
+import com.ozs.system.service.SysFileService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
+import org.springframework.util.ObjectUtils;
|
|
|
|
|
|
|
|
|
/**
|
|
@@ -42,6 +47,10 @@ public class PmDemandServiceImpl implements IPmDemandService
|
|
|
|
|
|
@Autowired
|
|
|
private ISysDictDataService dictDataService;
|
|
|
+ @Autowired
|
|
|
+ private SysFileService fileService;
|
|
|
+ @Autowired
|
|
|
+ private SysFileRefService sysFileRefService;
|
|
|
|
|
|
/**
|
|
|
* 查询采购需求
|
|
@@ -62,11 +71,16 @@ public class PmDemandServiceImpl implements IPmDemandService
|
|
|
vo.setPurchaseDeptName(sysDeptResponseVo.getDeptName());
|
|
|
}
|
|
|
|
|
|
- String purchaseServicesName = dictDataService.selectDictLabel("purchase_services",vo.getPurchaseServices());
|
|
|
+ String purchaseServicesName = dictDataService.selectDictLabel("purchase_services", vo.getPurchaseServices());
|
|
|
if(StringUtils.isNotEmpty(purchaseServicesName)){
|
|
|
vo.setPurchaseServicesName(purchaseServicesName);
|
|
|
}
|
|
|
|
|
|
+ HashMap<String, String> fileMap = getFileMap(vo.getDemandId(),"4");
|
|
|
+ if(fileMap != null){
|
|
|
+ vo.setFileMap(fileMap);
|
|
|
+ }
|
|
|
+
|
|
|
//项目类型
|
|
|
for (ProjectTypes value : ProjectTypes.values()) {
|
|
|
if (vo.getProjectType() != null && vo.getProjectType().equals(value.getCode())) {
|
|
@@ -112,7 +126,6 @@ public class PmDemandServiceImpl implements IPmDemandService
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
if(ProjectTypes.EQUIPMENTTYPE.getCode().equals(vo.getProjectType())){//装备类
|
|
|
PmDemandEquip obj = new PmDemandEquip();
|
|
|
obj.setDemandId(demandId);
|
|
@@ -128,6 +141,11 @@ public class PmDemandServiceImpl implements IPmDemandService
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ HashMap<String, String> fileMap1 = getFileMap(vo.getDemandId(),"5");
|
|
|
+ if(fileMap1 != null){
|
|
|
+ vo.setFileMap(fileMap1);
|
|
|
+ }
|
|
|
+
|
|
|
vo.setPmDemandEquipResponseVo(responseVo);
|
|
|
}
|
|
|
} else if(ProjectTypes.MATERIALTYPE.getCode().equals(vo.getProjectType())){ //物资类
|
|
@@ -144,6 +162,10 @@ public class PmDemandServiceImpl implements IPmDemandService
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
+ HashMap<String, String> fileMap2 = getFileMap(vo.getDemandId(),"6");
|
|
|
+ if(fileMap2 != null){
|
|
|
+ vo.setFileMap(fileMap2);
|
|
|
+ }
|
|
|
vo.setPmDemandMaterialsResponseVo(responseVo);
|
|
|
}
|
|
|
} else if(ProjectTypes.SERVICESTYPE.getCode().equals(vo.getProjectType())){//服务类
|
|
@@ -160,6 +182,10 @@ public class PmDemandServiceImpl implements IPmDemandService
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
+ HashMap<String, String> fileMap3 = getFileMap(vo.getDemandId(),"7");
|
|
|
+ if(fileMap3 != null){
|
|
|
+ vo.setFileMap(fileMap3);
|
|
|
+ }
|
|
|
vo.setPmDemandServeResponseVo(responseVo);
|
|
|
}
|
|
|
} else if(ProjectTypes.PLANTOEXAMINETYPE.getCode().equals(vo.getProjectType())){//工程类
|
|
@@ -197,7 +223,10 @@ public class PmDemandServiceImpl implements IPmDemandService
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+ HashMap<String, String> fileMap4 = getFileMap(vo.getDemandId(),"8");
|
|
|
+ if(fileMap4 != null){
|
|
|
+ vo.setFileMap(fileMap4);
|
|
|
+ }
|
|
|
vo.setPmDemandEngineeringResponseVo(responseVo);
|
|
|
}
|
|
|
}
|
|
@@ -317,4 +346,21 @@ public class PmDemandServiceImpl implements IPmDemandService
|
|
|
return pmDemandMapper.updatePmDemand(pmDemand);
|
|
|
}
|
|
|
|
|
|
+ private HashMap<String, String> getFileMap(Long redId,String type){
|
|
|
+ HashMap<String, Object> map = new HashMap<>();
|
|
|
+ map.put("red_id", redId);
|
|
|
+ map.put("type", type);
|
|
|
+ List<SysFileRef> fileRefs = sysFileRefService.listByMap(map);
|
|
|
+ if (!ObjectUtils.isEmpty(fileRefs)) {
|
|
|
+ HashMap<String, String> fileMap = new HashMap<>();
|
|
|
+ for (SysFileRef ref : fileRefs) {
|
|
|
+ SysFileInfo fileInfo = fileService.getById(ref.getFileId());
|
|
|
+ fileMap.put(fileInfo.getFileUrl(), fileInfo.getFileName());
|
|
|
+ }
|
|
|
+ return fileMap;
|
|
|
+ } else {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
}
|