Browse Source

核心业务接口 改造

tags/24080901
PoffyZhang 1 year ago
parent
commit
9b7952df42
2 changed files with 19 additions and 19 deletions
  1. +3
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/controller/DeclaredProjectController.java
  2. +16
    -17
      pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DeclaredProjectManage.java

+ 3
- 2
pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/controller/DeclaredProjectController.java View File

@@ -49,8 +49,9 @@ public class DeclaredProjectController {
@GetMapping("/core-biz") @GetMapping("/core-biz")
public JSONObject bizList(@RequestParam(required = false) String businessName, public JSONObject bizList(@RequestParam(required = false) String businessName,
@RequestParam(required = false) Integer pageSize, @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 = "申报项目草稿箱列表") @ApiOperation(value = "申报项目草稿箱列表", notes = "申报项目草稿箱列表")


+ 16
- 17
pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DeclaredProjectManage.java View File

@@ -13,6 +13,7 @@ import com.ningdatech.basic.function.VUtils;
import com.ningdatech.basic.model.PageVo; import com.ningdatech.basic.model.PageVo;
import com.ningdatech.basic.util.CollUtils; import com.ningdatech.basic.util.CollUtils;
import com.ningdatech.basic.util.NdDateUtils; 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.BizConst;
import com.ningdatech.pmapi.common.constant.RegionConst; import com.ningdatech.pmapi.common.constant.RegionConst;
import com.ningdatech.pmapi.common.enumeration.CommonEnum; import com.ningdatech.pmapi.common.enumeration.CommonEnum;
@@ -448,7 +449,7 @@ public class DeclaredProjectManage {
* @param businessName * @param businessName
* @return * @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(); JSONObject jsonObject = new JSONObject();
UserInfoDetails user = LoginUserUtil.loginUserDetail(); UserInfoDetails user = LoginUserUtil.loginUserDetail();
if(BizConst.DEV.equals(active)){ if(BizConst.DEV.equals(active)){
@@ -457,7 +458,7 @@ public class DeclaredProjectManage {
return jsonObject; return jsonObject;
} }
if(StringUtils.isNotBlank(businessName)){ if(StringUtils.isNotBlank(businessName)){
JSONArray dataArray = JSONArray.parseArray(jsonObject.getString("data"));
JSONArray dataArray = jsonObject.getJSONArray(BizConst.RESPONSE_KEY_DATA);
if(CollUtil.isEmpty(dataArray)){ if(CollUtil.isEmpty(dataArray)){
return new JSONObject(); return new JSONObject();
} }
@@ -475,24 +476,22 @@ public class DeclaredProjectManage {
} }
}else if(BizConst.PRE.equals(active) || }else if(BizConst.PRE.equals(active) ||
BizConst.PROD.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; return jsonObject;


Loading…
Cancel
Save