|
|
@@ -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; |
|
|
|