diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/irs/manage/ProjectIrsManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/irs/manage/ProjectIrsManage.java index ee34253..43e3f3d 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/irs/manage/ProjectIrsManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/irs/manage/ProjectIrsManage.java @@ -7,6 +7,7 @@ import com.ningdatech.pmapi.common.util.CryptUtils; import com.ningdatech.pmapi.common.util.HttpUtil; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Value; import org.springframework.http.HttpMethod; import org.springframework.http.ResponseEntity; @@ -54,7 +55,7 @@ public class ProjectIrsManage { * @return * @throws NoSuchAlgorithmException */ - public JSONObject searchCoreBiz(String businessName,String orgCode) { + public JSONObject searchCoreBiz(String businessName,String orgCode,Integer limit,Integer page) { long timestamp = System.currentTimeMillis(); String secret = refreshTokenService.refreshToken(appKey, appSecret, govRequestTokenUrl, govRefreshTokenUrl, interfaceName, HttpMethod.POST.name()); @@ -73,7 +74,8 @@ public class ProjectIrsManage { } String url = coreBizUrl + "?" + - "dingCode=&matterName=" + businessName + "&oid=&useState=1&limit=10&page=1" + + "dingCode=" + orgCode + "&matterName=" + (StringUtils.isNotBlank(businessName)?businessName:StringUtils.EMPTY) + "&oid=&useState=1&" + + "limit=" + (Objects.isNull(limit) ? "10" : limit) + "&page=" + (Objects.isNull(page) ? "1" : page) + "&appKey=" + appKey + "&sign=" + sign + "&requestTime=" + timestamp; ResponseEntity forEntity = restTemplate.getForEntity(url, JSONObject.class); 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 ee5eccf..5a7d991 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 @@ -47,8 +47,10 @@ public class DeclaredProjectController { @ApiOperation(value = "核心业务列表", notes = "核心业务列表") @GetMapping("/core-biz") - public JSONObject bizList(@RequestParam(required = false) String businessName) { - return declaredProjectManage.bizList(businessName); + public JSONObject bizList(@RequestParam(required = false) String businessName, + @RequestParam(required = false) Integer pageSize, + @RequestParam(required = false) Integer pageNumber) { + return declaredProjectManage.bizList(businessName,pageSize,pageNumber); } @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 cfda31a..587856a 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 @@ -49,6 +49,7 @@ import com.wflow.workflow.bean.dto.OrgInfoDTO; import com.wflow.workflow.bean.vo.ProcessStartParamsVo; import com.wflow.workflow.service.ProcessInstanceService; import com.wflow.workflow.service.ProcessModelService; +import io.swagger.models.auth.In; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; @@ -431,11 +432,14 @@ public class DeclaredProjectManage { * @param businessName * @return */ - public JSONObject bizList(String businessName) { + public JSONObject bizList(String businessName,Integer limit, Integer page) { JSONObject jsonObject = new JSONObject(); UserInfoDetails user = LoginUserUtil.loginUserDetail(); if(BizConst.DEV.equals(active)){ jsonObject = JSONObject.parseObject(DeclaredProjectContant.Biz.CORE_BIZ); + if(CollUtil.isEmpty(jsonObject)){ + return jsonObject; + } if(StringUtils.isNotBlank(businessName)){ JSONArray dataArray = JSONArray.parseArray(jsonObject.getString("data")); if(CollUtil.isEmpty(dataArray)){ @@ -451,15 +455,12 @@ public class DeclaredProjectManage { } } jsonObject.put("data",dataArrayRes); + jsonObject.put("total",dataArrayRes.size()); } }else if(BizConst.PRE.equals(active) || BizConst.PROD.equals(active)){ - jsonObject = projectIrsManage.searchCoreBiz(businessName,user.getEmpPosUnitCode()); - } - if(CollUtil.isEmpty(jsonObject)){ - return jsonObject; + jsonObject = projectIrsManage.searchCoreBiz(businessName,user.getEmpPosUnitCode(),limit,page); } - return jsonObject; } } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/scheduler/listener/EarlyWarningListener.java b/pmapi/src/main/java/com/ningdatech/pmapi/scheduler/listener/EarlyWarningListener.java index 98ca63f..7d79ccd 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/scheduler/listener/EarlyWarningListener.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/scheduler/listener/EarlyWarningListener.java @@ -5,24 +5,11 @@ import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.ningdatech.pmapi.common.constant.BizConst; import com.ningdatech.pmapi.common.enumeration.CommonEnum; -import com.ningdatech.pmapi.common.helper.UserInfoHelper; -import com.ningdatech.pmapi.meeting.helper.YxtCallOrSmsHelper; -import com.ningdatech.pmapi.projectlib.enumeration.InstTypeEnum; import com.ningdatech.pmapi.projectlib.model.entity.Project; import com.ningdatech.pmapi.projectlib.model.entity.ProjectInst; import com.ningdatech.pmapi.projectlib.service.IProjectInstService; import com.ningdatech.pmapi.projectlib.service.IProjectService; -import com.ningdatech.pmapi.staging.enums.MsgTypeEnum; -import com.ningdatech.pmapi.staging.service.INdWorkNoticeStagingService; import com.ningdatech.pmapi.sys.manage.EarlyWarningManage; -import com.ningdatech.pmapi.sys.manage.NoticeManage; -import com.ningdatech.pmapi.sys.model.entity.Notify; -import com.ningdatech.pmapi.sys.model.entity.WflowEarlyWarningRecords; -import com.ningdatech.pmapi.sys.service.IEarlyWarningRecordsService; -import com.ningdatech.pmapi.sys.service.INotifyService; -import com.ningdatech.pmapi.todocenter.bean.entity.WorkNoticeInfo; -import com.ningdatech.pmapi.user.security.auth.model.UserFullInfoDTO; -import com.ningdatech.yxt.model.cmd.SendSmsCmd; import com.wflow.enums.WarningRuleTypeEnum; import com.wflow.workflow.notify.event.EarlyWarningEvent; import lombok.RequiredArgsConstructor; @@ -34,7 +21,6 @@ import org.flowable.engine.history.HistoricProcessInstance; import org.springframework.context.event.EventListener; import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Component; -import java.time.LocalDateTime; import java.time.ZoneId; import java.util.List; import java.util.Objects;