buzhanyi 2 éve
szülő
commit
fae5bb42b2

+ 3 - 6
purchase-admin/src/main/java/com/ozs/web/controller/home/SystemHomepageController.java

@@ -119,24 +119,21 @@ public class SystemHomepageController extends BaseController {
     @GetMapping("/demandUnit/will/demandWaitCommit")
     @Log(title = ModularConstans.systemHome, businessType = BusinessType.QUERY)
     public AjaxResult demandUnit() {
-        List<PmDemandResVo> resVos = pmDemandService.demandWaitCommit();
-        return AjaxResult.success(resVos);
+        return AjaxResult.success(pmDemandService.listToVoList(pmDemandService.demandWaitCommit()));
     }
 
     @ApiOperation(value = "需求单位首页待办事项(合同待填制)")
     @GetMapping("/demandUnit/will/contractWaitFilled")
     @Log(title = ModularConstans.systemHome, businessType = BusinessType.QUERY)
     public AjaxResult contractWaitFilled() {
-        List<PmDemandResVo> resVos = pmDemandService.contractWaitFilled();
-        return AjaxResult.success(resVos);
+        return AjaxResult.success(pmDemandService.listToVoList(pmDemandService.contractWaitFilled()));
     }
 
     @ApiOperation(value = "需求单位首页待办事项(项目建设待完成)")
     @GetMapping("/demandUnit/will/projectWaitFinish")
     @Log(title = ModularConstans.systemHome, businessType = BusinessType.QUERY)
     public AjaxResult projectWaitFinish() {
-        List<PmDemandResVo> resVos = pmDemandService.projectWaitFinish();
-        return AjaxResult.success(resVos);
+        return AjaxResult.success(pmDemandService.listToVoList(pmDemandService.projectWaitFinish()));
     }
 
     @ApiOperation(value = "采购管理部门首页待办事项(全部)")

+ 16 - 25
purchase-system/src/main/java/com/ozs/plan/service/impl/PlanYearsServiceImpl.java

@@ -819,30 +819,13 @@ public class PlanYearsServiceImpl extends ServiceImpl<PlanYearsMapper, PlanYears
      */
     @Override
     public AjaxResult demandUnitWillManipulateTotal() {
-        List<HomeToDoQueryResVo> homeRes = new ArrayList<>();
         //计划待提交,需求待提交,合同待填制,项目建设待完成
         List<PlanQuarterResponseVo> planRes = getListByProjectStatus(ProjectStatus.PLANWAITCOMMIT.getCode());
-        List<PmDemandResVo> demandRes = demandService.demandWaitCommit();
+        List<PmDemand> demandRes = demandService.demandWaitCommit();
         demandRes.addAll(demandService.contractWaitFilled());
         demandRes.addAll(demandService.projectWaitFinish());
-        //转为首页table展示数据
-        if (!ObjectUtils.isEmpty(planRes) && planRes.size() > 0) {
-            for (PlanQuarterResponseVo planVo : planRes) {
-                HomeToDoQueryResVo home = new HomeToDoQueryResVo();
-                BeanUtils.copyProperties(planVo, home);
-                homeRes.add(home);
-            }
-        }
-        if (!ObjectUtils.isEmpty(demandRes) && demandRes.size() > 0) {
-            for (PmDemandResVo demandResVo : demandRes) {
-                HomeToDoQueryResVo home = new HomeToDoQueryResVo();
-                home.setEvaluation(BigDecimal.valueOf(demandResVo.getEvaluation()));
-                BeanUtils.copyProperties(demandResVo, home);
-                homeRes.add(home);
-            }
-        }
-
-        return AjaxResult.success(homeRes);
+        List<PmDemandResVo> resVos = demandService.listToVoList(demandRes);
+        return AjaxResult.success(planAndProjectToHome(planRes, resVos));
     }
 
     /**
@@ -886,12 +869,21 @@ public class PlanYearsServiceImpl extends ServiceImpl<PlanYearsMapper, PlanYears
 
     @Override
     public AjaxResult purchasingManagementWillManipulateTotal() {
-        List<HomeToDoQueryResVo> homeRes = new ArrayList<>();
         //计划待审核,需求待审核,任务待下达
         List<PlanQuarterResponseVo> planRes = getListByProjectStatus(ProjectStatus.PLANWAIEXAMINE.getCode());
         List<PmDemand> demandRes = demandService.demandWaitExamine();
         demandRes.addAll(demandService.taskWaitRelease());
-        List<PmDemandResVo> vos = demandService.listToVoList(demandRes);
+        List<PmDemandResVo> resVos = demandService.listToVoList(demandRes);
+        return AjaxResult.success(planAndProjectToHome(planRes, resVos));
+    }
+
+    /**
+     * 计划数据和项目数据一起返回给 首页--待办事项
+     *
+     * @return
+     */
+    public List<HomeToDoQueryResVo> planAndProjectToHome(List<PlanQuarterResponseVo> planRes, List<PmDemandResVo> demandRes) {
+        List<HomeToDoQueryResVo> homeRes = new ArrayList<>();
         //转为首页table展示数据
         if (!ObjectUtils.isEmpty(planRes) && planRes.size() > 0) {
             for (PlanQuarterResponseVo planVo : planRes) {
@@ -901,15 +893,14 @@ public class PlanYearsServiceImpl extends ServiceImpl<PlanYearsMapper, PlanYears
             }
         }
         if (!ObjectUtils.isEmpty(demandRes) && demandRes.size() > 0) {
-            for (PmDemandResVo demandResVo : vos) {
+            for (PmDemandResVo demandResVo : demandRes) {
                 HomeToDoQueryResVo home = new HomeToDoQueryResVo();
                 home.setEvaluation(BigDecimal.valueOf(demandResVo.getEvaluation()));
                 BeanUtils.copyProperties(demandResVo, home);
                 homeRes.add(home);
             }
         }
-
-        return AjaxResult.success(homeRes);
+        return homeRes;
     }
 
     @Override

+ 3 - 3
purchase-system/src/main/java/com/ozs/pm/service/IPmDemandService.java

@@ -139,21 +139,21 @@ public interface IPmDemandService extends IService<PmDemand> {
      *
      * @return
      */
-    List<PmDemandResVo> demandWaitCommit();
+    List<PmDemand> demandWaitCommit();
 
     /**
      * 查询需求单位首页待办事项(合同待填制)
      *
      * @return
      */
-    List<PmDemandResVo> contractWaitFilled();
+    List<PmDemand> contractWaitFilled();
 
     /**
      * 查询需求单位首页待办事项(项目建设待完成)
      *
      * @return
      */
-    List<PmDemandResVo> projectWaitFinish();
+    List<PmDemand> projectWaitFinish();
 
     /**
      * 采购管理部门首页待办事项(需求待审核)

+ 6 - 6
purchase-system/src/main/java/com/ozs/pm/service/impl/PmDemandServiceImpl.java

@@ -1787,21 +1787,21 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
     }
 
     @Override
-    public List<PmDemandResVo> demandWaitCommit() {
+    public List<PmDemand> demandWaitCommit() {
         List<PmDemand> byStatus = getListByStatus(PmProjectStatus.DEMAND_WAIT_COMMIT.getCode());
-        return listToVoList(byStatus);
+        return (byStatus);
     }
 
     @Override
-    public List<PmDemandResVo> contractWaitFilled() {
+    public List<PmDemand> contractWaitFilled() {
         List<PmDemand> byStatus = getListByStatus(PmProjectStatus.CONTRACT_WAIT_FILL.getCode());
-        return listToVoList(byStatus);
+        return (byStatus);
     }
 
     @Override
-    public List<PmDemandResVo> projectWaitFinish() {
+    public List<PmDemand> projectWaitFinish() {
         List<PmDemand> byStatus = getListByStatus(PmProjectStatus.UNDER_CONSTRUCTION.getCode());
-        return listToVoList(byStatus);
+        return (byStatus);
     }
 
     @Override