|
@@ -53,7 +53,8 @@ public class PmDemandServiceImpl implements IPmDemandService
|
|
|
private SysFileService fileService;
|
|
|
@Autowired
|
|
|
private SysFileRefService sysFileRefService;
|
|
|
-
|
|
|
+ @Autowired
|
|
|
+ private IPmFlowChartService iPmFlowChartService;
|
|
|
/**
|
|
|
* 查询采购需求
|
|
|
*
|
|
@@ -503,9 +504,102 @@ public class PmDemandServiceImpl implements IPmDemandService
|
|
|
* @return 采购需求
|
|
|
*/
|
|
|
@Override
|
|
|
- public PmDemandResVo viewFlowChart(Long demandId) {
|
|
|
- PmDemandResVo pmDemandResVo = new PmDemandResVo();
|
|
|
- return pmDemandResVo;
|
|
|
+ public String viewFlowChart(Long demandId) {
|
|
|
+ PmDemand pmDemand = pmDemandMapper.selectPmDemandByDemandId(demandId);
|
|
|
+ String projectStatus = String.valueOf(pmDemand.getProjectStatus());
|
|
|
+ String moduleName = null;
|
|
|
+ //todo
|
|
|
+ if (PmProjectStatus.DEMAND_WAIT_FILL.getCode().equals(projectStatus) || PmProjectStatus.DEMAND_AUDIT_RETURN.getCode().equals(projectStatus)) {
|
|
|
+ moduleName = "需求填制";
|
|
|
+ } else if(PmProjectStatus.DEMAND_WAIT_COMMIT.getCode().equals(projectStatus)) {
|
|
|
+ moduleName = "需求提交";
|
|
|
+ } else if(PmProjectStatus.DEMAND_WAIT_AUDIT.getCode().equals(projectStatus)) {
|
|
|
+ moduleName = "需求审核";
|
|
|
+ } else if(PmProjectStatus.TASK_WAIT_RELEASE.getCode().equals(projectStatus)) {
|
|
|
+ moduleName = "任务下达";
|
|
|
+ } else if(PmProjectStatus.BID_INFO_WAIT_FILL.getCode().equals(projectStatus)) {
|
|
|
+ moduleName = "中标情况填制";
|
|
|
+ } else if(PmProjectStatus.CONTRACT_WAIT_FILL.getCode().equals(projectStatus)) {
|
|
|
+ moduleName = "合同填制";
|
|
|
+ } else if(PmProjectStatus.UNDER_CONSTRUCTION.getCode().equals(projectStatus)) {
|
|
|
+ moduleName = "建设文档填制";
|
|
|
+ } else if(PmProjectStatus.COMPLETION_CONSTRUCTION.getCode().equals(projectStatus)) {
|
|
|
+ moduleName = "项目归档";
|
|
|
+ }
|
|
|
+ return moduleName;
|
|
|
+ }
|
|
|
+
|
|
|
+ public PmFlowChartResVo getModuleInfo(Long demandId,String moduleName){
|
|
|
+ PmDemand pmDemand = pmDemandMapper.selectPmDemandByDemandId(demandId);
|
|
|
+ String projectType = pmDemand.getProjectType();
|
|
|
+
|
|
|
+ PmFlowChart pmFlowChartReq = new PmFlowChart();
|
|
|
+ pmFlowChartReq.setModuleName(moduleName);
|
|
|
+ List<PmFlowChart> pmFlowChartList = iPmFlowChartService.selectPmFlowChartList(pmFlowChartReq);
|
|
|
+ if(pmFlowChartList == null || pmFlowChartList.size() ==0){
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ PmFlowChartResVo vo = new PmFlowChartResVo();
|
|
|
+ BeanUtils.copyProperties(pmFlowChartList.get(0), vo);
|
|
|
+
|
|
|
+ if("需求填制".equals(moduleName)) {
|
|
|
+ HashMap<String, String> fileMap = getFileMap(demandId,SysFileRefEnum.PM_DEMAND.getType());
|
|
|
+ if(fileMap != null){
|
|
|
+ vo.setFileMap(fileMap);
|
|
|
+ }
|
|
|
+ } else if("需求提交".equals(moduleName)) {
|
|
|
+ if(ProjectTypes.EQUIPMENTTYPE.getCode().equals(projectType)){ //装备类
|
|
|
+ PmDemandEquip pmDemandEquipReq = new PmDemandEquip();
|
|
|
+ pmDemandEquipReq.setDemandId(demandId);
|
|
|
+ List<PmDemandEquip> pmDemandEquipList = iPmDemandEquipService.selectPmDemandEquipList(pmDemandEquipReq);
|
|
|
+ if(pmDemandEquipList != null && pmDemandEquipList.size() > 0){
|
|
|
+ HashMap<String, String> fileMap = getFileMap(pmDemandEquipList.get(0).getDemandEquipId(),SysFileRefEnum.PM_DEMAND_EQUIP.getType());
|
|
|
+ if(fileMap != null){
|
|
|
+ vo.setFileMap(fileMap);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else if(ProjectTypes.MATERIALTYPE.getCode().equals(projectType)) { //物资类
|
|
|
+ PmDemandMaterials pmDemandMaterialsReq = new PmDemandMaterials();
|
|
|
+ pmDemandMaterialsReq.setDemandId(demandId);
|
|
|
+ List<PmDemandMaterials> pmDemandMaterialsList = iPmDemandMaterialsService.selectPmDemandMaterialsList(pmDemandMaterialsReq);
|
|
|
+ if(pmDemandMaterialsList != null && pmDemandMaterialsList.size() > 0){
|
|
|
+ HashMap<String, String> fileMap = getFileMap(pmDemandMaterialsList.get(0).getDemandMaterialsId(),SysFileRefEnum.PM_DEMAND_MATERIALS.getType());
|
|
|
+ if(fileMap != null){
|
|
|
+ vo.setFileMap(fileMap);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else if(ProjectTypes.SERVICESTYPE.getCode().equals(projectType)) { //服务类
|
|
|
+ PmDemandServe pmDemandServeReq = new PmDemandServe();
|
|
|
+ pmDemandServeReq.setDemandId(demandId);
|
|
|
+ List<PmDemandServe> pmDemandServeList = iPmDemandServeService.selectPmDemandServeList(pmDemandServeReq);
|
|
|
+ if(pmDemandServeList != null && pmDemandServeList.size() > 0){
|
|
|
+ HashMap<String, String> fileMap = getFileMap(pmDemandServeList.get(0).getDemandServeId(),SysFileRefEnum.PM_DEMAND_SERVE.getType());
|
|
|
+ if(fileMap != null){
|
|
|
+ vo.setFileMap(fileMap);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else if(ProjectTypes.PLANTOEXAMINETYPE.getCode().equals(projectType)) { //工程类
|
|
|
+ PmDemandEngineering pmDemandEngineeringReq = new PmDemandEngineering();
|
|
|
+ pmDemandEngineeringReq.setDemandId(demandId);
|
|
|
+ List<PmDemandEngineering> pmDemandEngineeringList = iPmDemandEngineeringService.selectPmDemandEngineeringList(pmDemandEngineeringReq);
|
|
|
+ if(pmDemandEngineeringList != null && pmDemandEngineeringList.size() > 0){
|
|
|
+ HashMap<String, String> fileMap = getFileMap(pmDemandEngineeringList.get(0).getDemandEngineeringId(),SysFileRefEnum.PM_DEMAND_ENGINEERING.getType());
|
|
|
+ if(fileMap != null){
|
|
|
+ vo.setFileMap(fileMap);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ } else if("需求审核".equals(moduleName)) {
|
|
|
+ HashMap<String, String> fileMap = getFileMap(demandId,SysFileRefEnum.PM_DEMAND_EXAMINE.getType());
|
|
|
+ if(fileMap != null){
|
|
|
+ vo.setFileMap(fileMap);
|
|
|
+ }
|
|
|
+ } else if("任务下达".equals(moduleName)) {
|
|
|
+ //todo
|
|
|
+ }
|
|
|
+
|
|
|
+ return vo;
|
|
|
}
|
|
|
|
|
|
/**
|