浏览代码

核心业务接口 改造

tags/24080901
PoffyZhang 1年前
父节点
当前提交
9b7952df42
共有 2 个文件被更改,包括 19 次插入19 次删除
  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 查看文件

@@ -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 = "申报项目草稿箱列表")


+ 16
- 17
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;


正在加载...
取消
保存