From 9b7952df42951eba0a10292ce252dd40c0f96571 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Tue, 7 Nov 2023 13:57:38 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=B8=E5=BF=83=E4=B8=9A=E5=8A=A1=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=20=E6=94=B9=E9=80=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/DeclaredProjectController.java | 5 ++-- .../manage/DeclaredProjectManage.java | 33 +++++++++++----------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/controller/DeclaredProjectController.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/controller/DeclaredProjectController.java index 5a7d991..d7d8944 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/controller/DeclaredProjectController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/controller/DeclaredProjectController.java @@ -49,8 +49,9 @@ public class DeclaredProjectController { @GetMapping("/core-biz") public JSONObject bizList(@RequestParam(required = false) String businessName, @RequestParam(required = false) Integer pageSize, - @RequestParam(required = false) Integer pageNumber) { - return declaredProjectManage.bizList(businessName,pageSize,pageNumber); + @RequestParam(required = false) Integer pageNumber, + @RequestParam(required = false) String orgCode) { + return declaredProjectManage.bizList(businessName,pageSize,pageNumber,orgCode); } @ApiOperation(value = "申报项目草稿箱列表", notes = "申报项目草稿箱列表") diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DeclaredProjectManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DeclaredProjectManage.java index cc2d898..816064b 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DeclaredProjectManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DeclaredProjectManage.java @@ -13,6 +13,7 @@ import com.ningdatech.basic.function.VUtils; import com.ningdatech.basic.model.PageVo; import com.ningdatech.basic.util.CollUtils; import com.ningdatech.basic.util.NdDateUtils; +import com.ningdatech.basic.util.StrPool; import com.ningdatech.pmapi.common.constant.BizConst; import com.ningdatech.pmapi.common.constant.RegionConst; import com.ningdatech.pmapi.common.enumeration.CommonEnum; @@ -448,7 +449,7 @@ public class DeclaredProjectManage { * @param businessName * @return */ - public JSONObject bizList(String businessName,Integer limit, Integer page) { + public JSONObject bizList(String businessName,Integer limit, Integer page,String orgCode) { JSONObject jsonObject = new JSONObject(); UserInfoDetails user = LoginUserUtil.loginUserDetail(); if(BizConst.DEV.equals(active)){ @@ -457,7 +458,7 @@ public class DeclaredProjectManage { return jsonObject; } if(StringUtils.isNotBlank(businessName)){ - JSONArray dataArray = JSONArray.parseArray(jsonObject.getString("data")); + JSONArray dataArray = jsonObject.getJSONArray(BizConst.RESPONSE_KEY_DATA); if(CollUtil.isEmpty(dataArray)){ return new JSONObject(); } @@ -475,24 +476,22 @@ public class DeclaredProjectManage { } }else if(BizConst.PRE.equals(active) || BizConst.PROD.equals(active)){ - jsonObject = projectIrsManage.searchCoreBiz(businessName,user.getEmpPosUnitCode(),limit,page); - //主管单位的 - String mainOrgCode = userInfoHelper.getMainOrgCode(user.getEmpPosUnitCode()); - if(StringUtils.isNotBlank(mainOrgCode)){ - JSONObject mainOrgCoreBiz = projectIrsManage.searchCoreBiz(businessName, - mainOrgCode,limit,page); - if(Objects.nonNull(mainOrgCoreBiz) && - CollUtil.isNotEmpty(mainOrgCoreBiz.getJSONArray(BizConst.RESPONSE_KEY_DATA))){ - JSONArray mainOrgCoreArray = mainOrgCoreBiz.getJSONArray(BizConst.RESPONSE_KEY_DATA); - if(Objects.nonNull(jsonObject)){ - if(Objects.isNull(jsonObject.getJSONArray(BizConst.RESPONSE_KEY_DATA))){ - jsonObject.put(BizConst.RESPONSE_KEY_DATA,mainOrgCoreArray); - }else{ - jsonObject.getJSONArray(BizConst.RESPONSE_KEY_DATA).addAll(mainOrgCoreArray); - jsonObject.put(BizConst.RESPONSE_KEY_DATA,mainOrgCoreArray); + if(StringUtils.isNotBlank(orgCode)){ + String[] orgCodes = orgCode.split(StrPool.COMMA); + JSONArray finalArray = new JSONArray(); + for(String og : orgCodes){ + JSONObject res = projectIrsManage.searchCoreBiz(businessName,og,limit,page); + if(Objects.nonNull(res)){ + JSONArray dataArray = res.getJSONArray(BizConst.RESPONSE_KEY_DATA); + if(CollUtil.isNotEmpty(dataArray)){ + finalArray.addAll(dataArray); } } } + jsonObject.put("data",finalArray); + jsonObject.put("total",finalArray.size()); + }else{ + jsonObject = projectIrsManage.searchCoreBiz(businessName,user.getEmpPosUnitCode(),limit,page); } } return jsonObject;