소스 검색

修改项目库列表查询

tags/24080901
WendyYang 8 달 전
부모
커밋
87c4e538c0
18개의 변경된 파일214개의 추가작업 그리고 167개의 파일을 삭제
  1. +21
    -1
      hz-pm-api/src/main/java/com/hz/pm/api/common/handler/CpuLoadTask.java
  2. +23
    -0
      hz-pm-api/src/main/java/com/hz/pm/api/common/model/constant/TypeReferenceConst.java
  3. +3
    -3
      hz-pm-api/src/main/java/com/hz/pm/api/external/sms/SmsServiceClient.java
  4. +1
    -1
      hz-pm-api/src/main/java/com/hz/pm/api/external/sms/dto/SmsDTO.java
  5. +5
    -5
      hz-pm-api/src/main/java/com/hz/pm/api/external/todo/TodoServiceClient.java
  6. +1
    -3
      hz-pm-api/src/main/java/com/hz/pm/api/external/todo/dto/TodoDTO.java
  7. +6
    -3
      hz-pm-api/src/main/java/com/hz/pm/api/filemanage/manage/ProjectFileManage.java
  8. +2
    -2
      hz-pm-api/src/main/java/com/hz/pm/api/meeting/controller/ExpertDashboardController.java
  9. +2
    -2
      hz-pm-api/src/main/java/com/hz/pm/api/meeting/helper/SmsOrCallClient.java
  10. +2
    -2
      hz-pm-api/src/main/java/com/hz/pm/api/meeting/task/ExpertCallResultRewriteTask.java
  11. +5
    -5
      hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/ConstructionPlanManage.java
  12. +14
    -17
      hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/DefaultDeclaredProjectManage.java
  13. +4
    -6
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/DeclaredRecordManage.java
  14. +13
    -5
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/ProjectLibManage.java
  15. +3
    -3
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/mapper/ProjectMapper.xml
  16. +93
    -94
      hz-pm-api/src/main/java/com/hz/pm/api/scheduler/task/SynProjectCollectionTask.java
  17. +16
    -12
      hz-pm-api/src/main/java/com/hz/pm/api/todocenter/manage/HandlerManage.java
  18. +0
    -3
      hz-pm-api/src/main/java/com/hz/pm/api/user/manage/MhUnitManage.java

+ 21
- 1
hz-pm-api/src/main/java/com/hz/pm/api/common/handler/CpuLoadTask.java 파일 보기

@@ -6,10 +6,12 @@ import cn.hutool.system.oshi.OshiUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
import org.springframework.lang.NonNull;
import org.springframework.scheduling.annotation.Scheduled;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Stream;
@@ -34,10 +36,28 @@ public class CpuLoadTask {

private static final ExecutorService FIXED_THREAD_POOL;

private static class CpuLoadThreadFactory implements ThreadFactory {

private final int priority;

public CpuLoadThreadFactory(int priority) {
this.priority = priority;
}

@Override
public Thread newThread(@NonNull Runnable r) {
Thread thread = new Thread(r);
thread.setPriority(priority);
return thread;
}

}

static {
int logicalProcessorCount = OshiUtil.getProcessor().getLogicalProcessorCount();
int max = Math.max(logicalProcessorCount * CPU_LIMIT / 100, 1);
FIXED_THREAD_POOL = Executors.newFixedThreadPool(max);
CpuLoadThreadFactory threadFactory = new CpuLoadThreadFactory(Thread.MIN_PRIORITY);
FIXED_THREAD_POOL = Executors.newFixedThreadPool(max, threadFactory);
}




+ 23
- 0
hz-pm-api/src/main/java/com/hz/pm/api/common/model/constant/TypeReferenceConst.java 파일 보기

@@ -0,0 +1,23 @@
package com.hz.pm.api.common.model.constant;

import com.alibaba.fastjson.TypeReference;

import java.util.Map;

/**
* <p>
* TypeRefConst
* </p>
*
* @author WendyYang
* @since 15:03 2024/3/6
*/
public class TypeReferenceConst {

private TypeReferenceConst() {
}

public static final TypeReference<Map<String, Object>> STR_OBJ_MAP = new TypeReference<Map<String, Object>>() {
};

}

+ 3
- 3
hz-pm-api/src/main/java/com/hz/pm/api/external/sms/SmsServiceClient.java 파일 보기

@@ -5,7 +5,7 @@ import cn.hutool.http.HttpUtil;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.hz.pm.api.external.sms.dto.SmsDto;
import com.hz.pm.api.external.sms.dto.SmsDTO;
import com.hz.pm.api.external.sms.vo.SmsReceipt;
import com.hz.pm.api.external.sms.vo.SmsReplyResponse;
import com.hz.pm.api.external.sms.vo.SmsSendResponse;
@@ -52,14 +52,14 @@ public class SmsServiceClient {
* 短信发送
* @return
*/
public SmsDto<SmsSendResponse> smsSend(String content, List<String> phones) {
public SmsDTO<SmsSendResponse> smsSend(String content, List<String> phones) {
String phonesSplit = String.join(",", phones);
String refreshUrl = smsUrl + SMS_SEND;
Map<String,Object> map = new HashMap<>();
map.put("content",content);
map.put("phones",phonesSplit);
String responseResult = HttpUtil.post(refreshUrl, JSON.toJSONString(map));
return JSONUtil.toBean(responseResult, new TypeReference<SmsDto<SmsSendResponse>>() {
return JSONUtil.toBean(responseResult, new TypeReference<SmsDTO<SmsSendResponse>>() {
}, false);
}



hz-pm-api/src/main/java/com/hz/pm/api/external/sms/dto/SmsDto.java → hz-pm-api/src/main/java/com/hz/pm/api/external/sms/dto/SmsDTO.java 파일 보기

@@ -3,7 +3,7 @@ package com.hz.pm.api.external.sms.dto;
import lombok.Data;

@Data
public class SmsDto<T> {
public class SmsDTO<T> {

/**
* 成功状态码

+ 5
- 5
hz-pm-api/src/main/java/com/hz/pm/api/external/todo/TodoServiceClient.java 파일 보기

@@ -8,7 +8,7 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import com.hz.pm.api.external.todo.dto.AddSingleWkHandleDTO;
import com.hz.pm.api.external.todo.dto.TodoDto;
import com.hz.pm.api.external.todo.dto.TodoDTO;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
@@ -44,7 +44,7 @@ public class TodoServiceClient {
* @param addSingleWkHandleDTO
* @return 接口返回待办ID
*/
public TodoDto addTodo(AddSingleWkHandleDTO addSingleWkHandleDTO) {
public TodoDTO addTodo(AddSingleWkHandleDTO addSingleWkHandleDTO) {
String url = todoUrl + TODO_ADD;
Map<String,Object> map = new HashMap<>();
JSONObject json = (JSONObject) JSONObject.toJSON(addSingleWkHandleDTO.getParams());
@@ -54,7 +54,7 @@ public class TodoServiceClient {
map.put("wkType",addSingleWkHandleDTO.getWkType());
map.put("wkUser",addSingleWkHandleDTO.getWkUser());
String responseResult = HttpUtil.post(url, JSON.toJSONString(map));
return JSON.parseObject(responseResult, new TypeReference<TodoDto>() {
return JSON.parseObject(responseResult, new TypeReference<TodoDTO>() {
});
}

@@ -62,7 +62,7 @@ public class TodoServiceClient {
* 完成待办
* @param wkhandleId 待办ID
*/
public TodoDto completeTodo(String wkhandleId){
public TodoDTO completeTodo(String wkhandleId){
String url = todoUrl + TODO_COMPLETE;
HashMap<String,Object> map = new HashMap<>();
map.put("wkhandleId",wkhandleId);
@@ -71,7 +71,7 @@ public class TodoServiceClient {
.form("wkhandleId",wkhandleId);
HttpResponse response = request.execute();
String responseBody = response.body();
return JSON.parseObject(responseBody, new TypeReference<TodoDto>() {
return JSON.parseObject(responseBody, new TypeReference<TodoDTO>() {
});
}



hz-pm-api/src/main/java/com/hz/pm/api/external/todo/dto/TodoDto.java → hz-pm-api/src/main/java/com/hz/pm/api/external/todo/dto/TodoDTO.java 파일 보기

@@ -11,9 +11,7 @@ import java.io.Serializable;
*/
@AllArgsConstructor
@Data
public class TodoDto implements Serializable {

private static final long serialVersionUID = 241303725133613373L;
public class TodoDTO {

private Integer code;


+ 6
- 3
hz-pm-api/src/main/java/com/hz/pm/api/filemanage/manage/ProjectFileManage.java 파일 보기

@@ -8,6 +8,7 @@ import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Assert;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.google.common.collect.Lists;
@@ -249,13 +250,15 @@ public class ProjectFileManage {

@Transactional(rollbackFor = Exception.class)
public synchronized String startApplyBorrowProcess(Long projectId) {
UserInfoDetails user =LoginUserUtil.loginUserDetail();
Project project = projectService.getNewProject(projectId);
VUtils.isTrue(Objects.isNull(project)).throwMessage("提交失败 此项目不存在!");
Assert.notNull(project, "提交失败 此项目不存在!");

// 首先要判断 项目当前状态 是不是 已归档
VUtils.isTrue(!ProjectStatusEnum.ACCEPTED.getCode().equals(project.getStatus())).throwMessage("提交失败 该项目不是 已归档");
if (!ProjectStatusEnum.ACCEPTED.eq(project.getStatus())) {
throw BizException.wrap("提交失败 该项目不是 已归档");
}

UserInfoDetails user = LoginUserUtil.loginUserDetail();
WflowModels model = processModelManage.getWflowModels(ProjectProcessStageEnum.APPLY_BORROW,
user.getMhUnitId());



+ 2
- 2
hz-pm-api/src/main/java/com/hz/pm/api/meeting/controller/ExpertDashboardController.java 파일 보기

@@ -1,7 +1,7 @@
package com.hz.pm.api.meeting.controller;

import com.hz.pm.api.external.sms.SmsServiceClient;
import com.hz.pm.api.external.sms.dto.SmsDto;
import com.hz.pm.api.external.sms.dto.SmsDTO;
import com.hz.pm.api.external.sms.vo.SmsReceipt;
import com.hz.pm.api.external.sms.vo.SmsReplyResponse;
import com.hz.pm.api.external.sms.vo.SmsSendResponse;
@@ -43,7 +43,7 @@ public class ExpertDashboardController {

@ApiOperation("短信发送")
@GetMapping("/sendSms")
public SmsDto<SmsSendResponse> test(String phone) {
public SmsDTO<SmsSendResponse> test(String phone) {
return smsServiceClient.smsSend(VoiceSmsTemplateConst.EXPERT_INVITE, Collections.singletonList(phone));
}



+ 2
- 2
hz-pm-api/src/main/java/com/hz/pm/api/meeting/helper/SmsOrCallClient.java 파일 보기

@@ -2,7 +2,7 @@ package com.hz.pm.api.meeting.helper;

import com.alibaba.fastjson.JSONObject;
import com.hz.pm.api.external.sms.SmsServiceClient;
import com.hz.pm.api.external.sms.dto.SmsDto;
import com.hz.pm.api.external.sms.dto.SmsDTO;
import com.hz.pm.api.external.sms.vo.SmsSendResponse;
import com.hz.pm.api.meeting.entity.domain.MeetingExpertSms;
import com.hz.pm.api.meeting.mapper.MeetingExpertSmsMapper;
@@ -37,7 +37,7 @@ public class SmsOrCallClient implements com.ningdatech.yxt.client.YxtClient {
@Override
public SendSmsResponse submitSmsTask(SendSmsCmd sendSmsCmd) {
sendSmsCmd.getContextList().forEach(sms ->{
SmsDto<SmsSendResponse> smsSendResponseSmsDto = smsServiceClient.smsSend(sms.getContent(), Arrays.asList(sms.getReceiveNumber()));
SmsDTO<SmsSendResponse> smsSendResponseSmsDto = smsServiceClient.smsSend(sms.getContent(), Arrays.asList(sms.getReceiveNumber()));
String resultUuid = smsSendResponseSmsDto.getData().getResult();
// 保存短信发送记录
MeetingExpertSms meetingExpertSms = MeetingExpertSms.builder()


+ 2
- 2
hz-pm-api/src/main/java/com/hz/pm/api/meeting/task/ExpertCallResultRewriteTask.java 파일 보기

@@ -6,7 +6,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.hz.pm.api.common.util.StrUtils;
import com.hz.pm.api.external.sms.SmsServiceClient;
import com.hz.pm.api.external.sms.dto.SmsDto;
import com.hz.pm.api.external.sms.dto.SmsDTO;
import com.hz.pm.api.external.sms.vo.SmsReply;
import com.hz.pm.api.external.sms.vo.SmsReplyResponse;
import com.hz.pm.api.external.sms.vo.SmsSendResponse;
@@ -314,7 +314,7 @@ public class ExpertCallResultRewriteTask {
meeting.getCreator(), meeting.getName(), meeting.getStartTime().format(formatter) + "至" + meeting.getEndTime().format(formatter), meeting.getMeetingAddress());

List<String> phones = expertMeetings.stream().map(obj -> obj.getMobile()).collect(Collectors.toList());
SmsDto<SmsSendResponse> smsSendResponseSmsDto = smsServiceClient.smsSend(replacedContent, phones);
SmsDTO<SmsSendResponse> smsSendResponseSmsDto = smsServiceClient.smsSend(replacedContent, phones);
// 短信发送成功返回的UUID
String resultUuid = smsSendResponseSmsDto.getData().getResult();
// 保存短信发送记录


+ 5
- 5
hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/ConstructionPlanManage.java 파일 보기

@@ -88,14 +88,14 @@ public class ConstructionPlanManage {
/**
* 建设方案
*
* @param dto \
* @param req \
* @return \
*/
@Transactional(rollbackFor = Exception.class)
public synchronized String startTheProcess(DefaultDeclaredDTO dto) {
public synchronized String startTheProcess(DefaultDeclaredDTO req) {
UserInfoDetails user = LoginUserUtil.loginUserDetail();
Long userId = user.getUserId();
ProjectDTO projectInfo = dto.getProjectInfo();
ProjectDTO projectInfo = req.getProjectInfo();
Long projectInfoId = projectInfo.getId();
VUtils.isTrue(Objects.isNull(projectInfoId)).throwMessage("提交失败,缺少项目ID!");
Project oldProject = projectService.getById(projectInfoId);
@@ -148,7 +148,7 @@ public class ConstructionPlanManage {
params.setProcessUsers(Collections.emptyMap());
//放入条件判断的项目字段
//把条件值给放入工作流
defaultDeclaredProjectManage.buildCondition(params, oldProject, dto);
defaultDeclaredProjectManage.buildCondition(params, oldProject, req);
// 获取发起单位、发起单位主管单位、发起单位上级条线主管单位信息
Map<String, OrgInfoDTO> orgModelMap = defaultDeclaredProjectManage.buildOrgModelMap(userId, constructProject);
String instanceId = processService.startProcessLs(wflowModels, params, orgModelMap);
@@ -156,7 +156,7 @@ public class ConstructionPlanManage {

// 保存建设项目相关
Project buildProject;
if (Boolean.TRUE.equals(dto.getRestart())) {
if (Boolean.TRUE.equals(req.getRestart())) {
//如果是重新提交 不用生成新版本 前面已经生成过了
buildProject = contructionPlanModifyProject(oldProject, instanceId);
} else {


+ 14
- 17
hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/DefaultDeclaredProjectManage.java 파일 보기

@@ -10,6 +10,7 @@ import com.hz.pm.api.common.enumeration.CommonEnum;
import com.hz.pm.api.common.helper.UserInfoHelper;
import com.hz.pm.api.common.model.constant.BizConst;
import com.hz.pm.api.common.model.constant.RegionConst;
import com.hz.pm.api.common.model.constant.TypeReferenceConst;
import com.hz.pm.api.projectdeclared.model.dto.DefaultDeclaredDTO;
import com.hz.pm.api.projectdeclared.model.dto.ProjectConditionDTO;
import com.hz.pm.api.projectdeclared.model.po.DeclaredProjectStatisticsPO;
@@ -79,10 +80,7 @@ public class DefaultDeclaredProjectManage {
ProjectConditionDTO conditionDto = new ProjectConditionDTO();
BeanUtils.copyProperties(projectDTO, conditionDto);
Map<String, Object> formData = Maps.newHashMap();
formData.putAll(
JSON.parseObject(JSON.toJSONString(conditionDto), new TypeReference<Map<String, Object>>() {
})
);
formData.putAll(JSON.parseObject(JSON.toJSONString(conditionDto), TypeReferenceConst.STR_OBJ_MAP));
params.setFormData(formData);

}
@@ -346,18 +344,17 @@ public class DefaultDeclaredProjectManage {

public void buildCondition(ProcessStartParamsVo params, Project projectInfo, DefaultDeclaredDTO dto) {
//放入条件判断的项目字段 优先取dto的 再取项目的
ProjectDTO pdto = dto.getProjectInfo();
ProjectConditionDTO conditionDto = new ProjectConditionDTO();
conditionDto.setProjectId(projectInfo.getId());
conditionDto.setDeclareAmount(Objects.nonNull(pdto) && Objects.nonNull(pdto.getDeclareAmount())
? pdto.getDeclareAmount() : projectInfo.getDeclareAmount());
conditionDto.setIsDigitalReform(Objects.nonNull(pdto) && Objects.nonNull(pdto.getIsDigitalReform())
? pdto.getIsDigitalReform() : projectInfo.getIsDigitalReform());
conditionDto.setIsTemporaryAugment(Objects.nonNull(pdto) && Objects.nonNull(pdto.getIsTemporaryAugment())
? pdto.getIsTemporaryAugment() : projectInfo.getIsTemporaryAugment());
conditionDto.setBizDomain(Objects.nonNull(pdto) && Objects.nonNull(pdto.getBizDomain())
? pdto.getBizDomain() : projectInfo.getBizDomain());
params.setFormData(JSON.parseObject(JSON.toJSONString(conditionDto), new TypeReference<Map<String, Object>>() {
}));
ProjectDTO projInfo = dto.getProjectInfo();
ProjectConditionDTO condition = new ProjectConditionDTO();
condition.setProjectId(projectInfo.getId());
condition.setDeclareAmount(Objects.nonNull(projInfo.getDeclareAmount())
? projInfo.getDeclareAmount() : projectInfo.getDeclareAmount());
condition.setIsDigitalReform(Objects.nonNull(projInfo.getIsDigitalReform())
? projInfo.getIsDigitalReform() : projectInfo.getIsDigitalReform());
condition.setIsTemporaryAugment(Objects.nonNull(projInfo.getIsTemporaryAugment())
? projInfo.getIsTemporaryAugment() : projectInfo.getIsTemporaryAugment());
condition.setBizDomain(Objects.nonNull(projInfo.getBizDomain())
? projInfo.getBizDomain() : projectInfo.getBizDomain());
params.setFormData(JSON.parseObject(JSON.toJSONString(condition), TypeReferenceConst.STR_OBJ_MAP));
}
}

+ 4
- 6
hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/DeclaredRecordManage.java 파일 보기

@@ -14,6 +14,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hz.pm.api.common.enumeration.CommonEnum;
import com.hz.pm.api.common.enumeration.ProjectProcessStageEnum;
import com.hz.pm.api.common.model.constant.TypeReferenceConst;
import com.hz.pm.api.common.statemachine.event.ProjectStatusChangeEvent;
import com.hz.pm.api.common.util.BizUtils;
import com.hz.pm.api.external.model.enumeration.MhUnitStripEnum;
@@ -224,12 +225,9 @@ public class DeclaredRecordManage {
params.setUser(defaultDeclaredProjectManage.buildUser(user));
params.setProcessUsers(Collections.emptyMap());
//放入条件判断的项目字段
ProjectConditionDTO conditionDto = new ProjectConditionDTO();
BeanUtils.copyProperties(req.getProjectInfo(), conditionDto);
req.getFormData().putAll(
JSON.parseObject(JSON.toJSONString(conditionDto), new TypeReference<Map<String, Object>>() {
})
);
ProjectConditionDTO condition = new ProjectConditionDTO();
BeanUtils.copyProperties(req.getProjectInfo(), condition);
req.getFormData().putAll(JSON.parseObject(JSON.toJSONString(condition), TypeReferenceConst.STR_OBJ_MAP));
params.setFormData(req.getFormData());
//开始申报
// 获取发起单位、发起单位主管单位、发起单位上级主管条线单位信息


+ 13
- 5
hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/ProjectLibManage.java 파일 보기

@@ -80,6 +80,7 @@ import com.hz.pm.api.safety.service.IPersonSafetyInfoService;
import com.hz.pm.api.safety.service.ISupplierSafetyQualificationService;
import com.hz.pm.api.todocenter.model.req.ProcessDetailReq;
import com.hz.pm.api.todocenter.service.ITodoService;
import com.hz.pm.api.user.helper.MhUnitCache;
import com.hz.pm.api.user.security.model.UserFullInfoDTO;
import com.hz.pm.api.user.security.model.UserInfoDetails;
import com.hz.pm.api.user.util.LoginUserUtil;
@@ -147,6 +148,7 @@ public class ProjectLibManage {
private final IExpertReviewService expertReviewService;
private final ConstructionManage constructionManage;
private final IProjectGovSystemReplaceInfosService projectGovSystemReplaceInfosService;
private final MhUnitCache mhUnitCache;

public PageVo<ProjectLibListItemVO> projectLibList(ProjectListReq req) {
LambdaQueryWrapper<Project> query = ProjectHelper.projectQuery(req);
@@ -1314,14 +1316,17 @@ public class ProjectLibManage {
switch (currentUserDataScope.get().getRole()) {
case NORMAL_MEMBER:
//普通用户 只能看到自己单位去申报的
query.eq(Project::getBuildOrgCode, user.getMhUnitId());
query.eq(Project::getBuildOrgCode, user.getMhUnitIdStr());
break;
case COMPANY_MANAGER:
List<Long> childUnitIds = mhUnitCache.getChildrenIdsRecursion(user.getMhUnitId());
childUnitIds.add(user.getMhUnitId());
List<String> viewUnitIdList = CollUtils.convert(childUnitIds, String::valueOf);
//单位管理员 看到自己单位去申报的 + 待预审的主管单位是自己单位的项目
query.and(q1 -> q1.eq(Project::getBuildOrgCode, user.getMhUnitId()).or(q2 ->
q2.eq(Project::getStage, ProjectStatusEnum.NOT_APPROVED.getCode())
query.and(q1 -> q1.in(Project::getBuildOrgCode, viewUnitIdList)
.or(q2 -> q2.eq(Project::getStage, ProjectStatusEnum.NOT_APPROVED.getCode())
.eq(Project::getStatus, ProjectStatusEnum.PENDING_PREQUALIFICATION.getCode())
.eq(Project::getSuperOrgCode, user.getMhUnitId())));
.in(Project::getSuperOrgCode, viewUnitIdList)));
break;
case SUPER_ADMIN:
//超级管理员 看到丽水全市的 并且也要判断他 同时是不是单位管理员
@@ -1354,8 +1359,11 @@ public class ProjectLibManage {
break;
case COMPANY_MANAGER:
//单位管理员 看到自己单位去申报的 + 待预审的主管单位是自己单位的项目
List<Long> childUnitIds = mhUnitCache.getChildrenIdsRecursion(user.getMhUnitId());
childUnitIds.add(user.getMhUnitId());
String viewUnitIdStr = CollUtils.joinByComma(childUnitIds, w -> "'" + w + "'");
req.setUserType("org");
req.setUserValue(user.getMhUnitIdStr());
req.setUserValue(viewUnitIdStr);
break;
case SUPER_ADMIN:
//超级管理员 看到丽水全市的 并且也要判断他 同时是不是单位管理员


+ 3
- 3
hz-pm-api/src/main/java/com/hz/pm/api/projectlib/mapper/ProjectMapper.xml 파일 보기

@@ -384,8 +384,8 @@
and p.build_org_code = #{req.userValue}
</if>
<if test="req.userType != null and req.userType == 'org'">
and (p.build_org_code = #{req.userValue} or
(p.stage = 10000 and p.status = 10003 and p.super_org_code = #{req.userValue}))
and (p.build_org_code in (${req.userValue}) or
(p.stage = 10000 and p.status = 10003 and p.super_org_code in (${req.userValue})))
</if>
UNION ALL
(
@@ -460,7 +460,7 @@
and b.base_build_deprt_ding = #{req.userValue}
</if>
<if test="req.userType != null and req.userType == 'org'">
and b.base_build_deprt_ding = #{req.userValue}
and b.base_build_deprt_ding in (${req.userValue})
</if>)
) ORDER BY topped desc, update_on DESC
</select>


+ 93
- 94
hz-pm-api/src/main/java/com/hz/pm/api/scheduler/task/SynProjectCollectionTask.java 파일 보기

@@ -27,6 +27,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.List;
@@ -49,7 +50,6 @@ public class SynProjectCollectionTask {
public String active;



private final GovProjectCollectionManage collectionManage;
private final IGovBizProjectBaseinfoService baseinfoService;
private final IGovBizProjectApplyService applyService;
@@ -67,16 +67,15 @@ public class SynProjectCollectionTask {
/**
* 前置机每天晚上10点自动清空,第二天早上6点获取数据
* 定时同步前置机数据 每天1点开始执行一次
*
*/
@Scheduled(cron = "0 0 1 * * ?")
public void doTask() throws UnknownHostException {
if (!HOST.equals(InetAddress.getLocalHost().getHostName())) {
log.info("定时器没开启或者host不对! {}:{}",
HOST,InetAddress.getLocalHost().getHostName());
HOST, InetAddress.getLocalHost().getHostName());
return;
}
if(BizConst.PRE.equals(active)){
if (BizConst.PRE.equals(active)) {
log.info("预发环境不用同步!");
return;
}
@@ -90,7 +89,7 @@ public class SynProjectCollectionTask {
//全量项目归集
ProjectListReq req = new ProjectListReq();
Long count = collectionManage.count(req) + collectionManage.operationCount(req);
if(count == 0L){
if (count == 0L) {
log.info("本次同步无数据");
return;
}
@@ -98,21 +97,21 @@ public class SynProjectCollectionTask {
req.setPageSize(count.intValue());
PageVo<GovBizProjectListVO> projectCollectionPage = collectionManage.list(req);

log.info("projectCollections size :{}",projectCollectionPage.getTotal());
log.info("projectCollections size :{}", projectCollectionPage.getTotal());

for(GovBizProjectListVO vo : projectCollectionPage.getRecords()){
for (GovBizProjectListVO vo : projectCollectionPage.getRecords()) {
GovBizProjectDetailVO projectDetail = collectionManage.detail(vo.getBaseProjId());
collectionManage.pushProjectVo(projectDetail);
}

//2.运维备案项目
PageVo<GovBizProjectListVO> operationList = collectionManage.operationList(req);
log.info("operation list size :{}",operationList.getTotal());
for(GovBizProjectListVO vo : operationList.getRecords()){
log.info("operation list size :{}", operationList.getTotal());
for (GovBizProjectListVO vo : operationList.getRecords()) {
GovOperationProjectDetailVO operationDetail = collectionManage.operationDetail(vo.getBaseProjId());
GovOperationProjectBaseinfoVO baseinfo = operationDetail.getBaseinfo();
if(Objects.isNull(baseinfo) || Objects.isNull(baseinfo.getPush()) ||
Boolean.FALSE.equals(baseinfo.getPush())){
if (Objects.isNull(baseinfo) || Objects.isNull(baseinfo.getPush()) ||
Boolean.FALSE.equals(baseinfo.getPush())) {
log.info("此运维项目不用推送:" + vo.getBaseProjId());
}
collectionManage.pushProjectVo(operationDetail);
@@ -120,19 +119,19 @@ public class SynProjectCollectionTask {

//3.申报项目 需要推送的项目
List<Project> projects = projectService.list(Wrappers.lambdaQuery(Project.class)
.eq(Project::getNewest,Boolean.TRUE)
.eq(Project::getPush,Boolean.TRUE));
log.info("projects need push size :{}",projects.size());
for(Project project : projects){
.eq(Project::getNewest, Boolean.TRUE)
.eq(Project::getPush, Boolean.TRUE));
log.info("projects need push size :{}", projects.size());
for (Project project : projects) {
ProjectDetailVO projectDetailVO = projectLibManage.detailProjectCode(project.getProjectCode());
GovBizProjectDetailVO vo = ProjectConvertUtil.declaredToCollection(projectDetailVO,fileService);
if(Objects.nonNull(vo)){
GovBizProjectDetailVO vo = ProjectConvertUtil.declaredToCollection(projectDetailVO, fileService);
if (Objects.nonNull(vo)) {
collectionManage.pushProjectVo(vo);
}
}

stopWatch.stop();
log.info("数据同步任务结束====={}s",stopWatch.getTotalTimeSeconds());
log.info("数据同步任务结束====={}s", stopWatch.getTotalTimeSeconds());
}

/**
@@ -145,13 +144,13 @@ public class SynProjectCollectionTask {

GovBizProjectBaseinfo base = baseinfoService.getOne(Wrappers.lambdaQuery(GovBizProjectBaseinfo.class)
.eq(GovBizProjectBaseinfo::getBaseProjId, projId));
if(Objects.nonNull(base)){
if (Objects.nonNull(base)) {
//开始转换PDF
convertPdfVo(projId);
}

stopWatch.stop();
log.info("项目归集库存转换PDF任务结束====={}s",stopWatch.getTotalTimeSeconds());
log.info("项目归集库存转换PDF任务结束====={}s", stopWatch.getTotalTimeSeconds());
}

public void stagingConvertPdf2(String projId) {
@@ -162,33 +161,33 @@ public class SynProjectCollectionTask {
req.setPageNumber(1);
req.setPageSize(BizConst.MAX_EXPORT_COUNT);
List<GovBizProjectApprove> projects = approveService.list(Wrappers.lambdaQuery(GovBizProjectApprove.class)
.eq(GovBizProjectApprove::getDeleted,Boolean.FALSE)
.eq(StringUtils.isNotBlank(projId),GovBizProjectApprove::getBaseProjId,projId)
.eq(GovBizProjectApprove::getDeleted, Boolean.FALSE)
.eq(StringUtils.isNotBlank(projId), GovBizProjectApprove::getBaseProjId, projId)
.isNotNull(GovBizProjectApprove::getApprovalFile)
.isNull(GovBizProjectApprove::getApprovalFilePdf));

if(CollUtil.isEmpty(projects)){
if (CollUtil.isEmpty(projects)) {
log.info("没有项目归集 任务终止");
return;
}

for(GovBizProjectApprove project : projects){
for (GovBizProjectApprove project : projects) {
String baseProjId = project.getBaseProjId();
//开始转换PDF
GovBizProjectApprove approve = approveService.getOne(Wrappers.lambdaQuery(GovBizProjectApprove.class)
.eq(GovBizProjectApprove::getBaseProjId,baseProjId)
.eq(GovBizProjectApprove::getBaseProjId, baseProjId)
.last(BizConst.LIMIT_1));
if(Objects.isNull(approve)){
if (Objects.isNull(approve)) {
return;
}
if(StringUtils.isBlank(approve.getApprovalFilePdf()) && StringUtils.isNotBlank(approve.getApprovalFile())){
if (StringUtils.isBlank(approve.getApprovalFilePdf()) && StringUtils.isNotBlank(approve.getApprovalFile())) {
StringJoiner sj = collectionManage.convertAndUpload(approve.getApprovalFile());
approve.setApprovalFilePdf(sj.toString());
}
}

stopWatch.stop();
log.info("项目归集库存转换PDF任务2结束====={}s",stopWatch.getTotalTimeSeconds());
log.info("项目归集库存转换PDF任务2结束====={}s", stopWatch.getTotalTimeSeconds());
}

public void stagingConvertPdf3(String projId) {
@@ -200,23 +199,23 @@ public class SynProjectCollectionTask {
req.setPageNumber(1);
req.setPageSize(BizConst.MAX_EXPORT_COUNT);
List<GovBizProjectApprove> approves = approveService.list(Wrappers.lambdaQuery(GovBizProjectApprove.class)
.eq(GovBizProjectApprove::getDeleted,Boolean.FALSE)
.eq(StringUtils.isNotBlank(projId),GovBizProjectApprove::getBaseProjId,projId)
.eq(GovBizProjectApprove::getDeleted, Boolean.FALSE)
.eq(StringUtils.isNotBlank(projId), GovBizProjectApprove::getBaseProjId, projId)
.isNotNull(GovBizProjectApprove::getApprovalFile)
.isNull(GovBizProjectApprove::getApprovalFilePdf));

if(CollUtil.isEmpty(approves)){
if (CollUtil.isEmpty(approves)) {
log.info("没有项目归集 审批信息 立项文件 任务终止");
return;
}

for(GovBizProjectApprove approve : approves){
for (GovBizProjectApprove approve : approves) {
//开始转换PDF
convertPdfVo(approve.getBaseProjId());
}

stopWatch.stop();
log.info("项目归集库存转换PDF任务3结束====={}s",stopWatch.getTotalTimeSeconds());
log.info("项目归集库存转换PDF任务3结束====={}s", stopWatch.getTotalTimeSeconds());
}

//开始转换PDF
@@ -230,28 +229,28 @@ public class SynProjectCollectionTask {

private void convertPdfApply(String baseProjId) {
GovBizProjectApply apply = applyService.getOne(Wrappers.lambdaQuery(GovBizProjectApply.class)
.eq(GovBizProjectApply::getBaseProjId,baseProjId)
.eq(GovBizProjectApply::getBaseProjId, baseProjId)
.last(BizConst.LIMIT_1));
if(Objects.isNull(apply)){
if (Objects.isNull(apply)) {
return;
}
if(StringUtils.isBlank(apply.getBaseProjApplyFilePdf()) && StringUtils.isNotBlank(apply.getBaseProjApplyFile())){
if (StringUtils.isBlank(apply.getBaseProjApplyFilePdf()) && StringUtils.isNotBlank(apply.getBaseProjApplyFile())) {
StringJoiner sj = collectionManage.convertAndUpload(apply.getBaseProjApplyFile());
apply.setBaseProjApplyFilePdf(sj.toString());
}
if(StringUtils.isBlank(apply.getBaseProjBasisFilePdf()) && StringUtils.isNotBlank(apply.getBaseProjBasisFile())){
if (StringUtils.isBlank(apply.getBaseProjBasisFilePdf()) && StringUtils.isNotBlank(apply.getBaseProjBasisFile())) {
StringJoiner sj = collectionManage.convertAndUpload(apply.getBaseProjBasisFile());
apply.setBaseProjBasisFilePdf(sj.toString());
}
if(StringUtils.isBlank(apply.getBaseProjOtherFilePdf()) && StringUtils.isNotBlank(apply.getBaseProjOtherFile())){
if (StringUtils.isBlank(apply.getBaseProjOtherFilePdf()) && StringUtils.isNotBlank(apply.getBaseProjOtherFile())) {
StringJoiner sj = collectionManage.convertAndUpload(apply.getBaseProjOtherFile());
apply.setBaseProjOtherFilePdf(sj.toString());
}
if(StringUtils.isBlank(apply.getBaseResearchReportFilePdf()) && StringUtils.isNotBlank(apply.getBaseResearchReportFile())){
if (StringUtils.isBlank(apply.getBaseResearchReportFilePdf()) && StringUtils.isNotBlank(apply.getBaseResearchReportFile())) {
StringJoiner sj = collectionManage.convertAndUpload(apply.getBaseResearchReportFile());
apply.setBaseResearchReportFilePdf(sj.toString());
}
if(StringUtils.isBlank(apply.getBaseOperatMaintenFilePdf()) && StringUtils.isNotBlank(apply.getBaseOperatMaintenFile())){
if (StringUtils.isBlank(apply.getBaseOperatMaintenFilePdf()) && StringUtils.isNotBlank(apply.getBaseOperatMaintenFile())) {
StringJoiner sj = collectionManage.convertAndUpload(apply.getBaseOperatMaintenFile());
apply.setBaseOperatMaintenFilePdf(sj.toString());
}
@@ -260,20 +259,20 @@ public class SynProjectCollectionTask {

private void convertPdfApprove(String baseProjId) {
GovBizProjectApprove approve = approveService.getOne(Wrappers.lambdaQuery(GovBizProjectApprove.class)
.eq(GovBizProjectApprove::getBaseProjId,baseProjId)
.eq(GovBizProjectApprove::getBaseProjId, baseProjId)
.last(BizConst.LIMIT_1));
if(Objects.isNull(approve)){
if (Objects.isNull(approve)) {
return;
}
if(StringUtils.isBlank(approve.getApprovalFilePdf()) && StringUtils.isNotBlank(approve.getApprovalFile())){
if (StringUtils.isBlank(approve.getApprovalFilePdf()) && StringUtils.isNotBlank(approve.getApprovalFile())) {
StringJoiner sj = collectionManage.convertAndUpload(approve.getApprovalFile());
approve.setApprovalFilePdf(sj.toString());
}
if(StringUtils.isBlank(approve.getPreliminaryDesignFilePdf()) && StringUtils.isNotBlank(approve.getPreliminaryDesignFile())){
if (StringUtils.isBlank(approve.getPreliminaryDesignFilePdf()) && StringUtils.isNotBlank(approve.getPreliminaryDesignFile())) {
StringJoiner sj = collectionManage.convertAndUpload(approve.getPreliminaryDesignFile());
approve.setPreliminaryDesignFilePdf(sj.toString());
}
if(StringUtils.isBlank(approve.getBaseReviewCommentsFilePdf()) && StringUtils.isNotBlank(approve.getBaseReviewCommentsFile())){
if (StringUtils.isBlank(approve.getBaseReviewCommentsFilePdf()) && StringUtils.isNotBlank(approve.getBaseReviewCommentsFile())) {
StringJoiner sj = collectionManage.convertAndUpload(approve.getBaseReviewCommentsFile());
approve.setBaseReviewCommentsFilePdf(sj.toString());
}
@@ -282,68 +281,68 @@ public class SynProjectCollectionTask {

private void convertPdfCimplement(String baseProjId) {
GovBizProjectCimplement cimplement = cimplementService.getOne(Wrappers.lambdaQuery(GovBizProjectCimplement.class)
.eq(GovBizProjectCimplement::getBaseProjId,baseProjId)
.eq(GovBizProjectCimplement::getBaseProjId, baseProjId)
.last(BizConst.LIMIT_1));
if(Objects.isNull(cimplement)){
if (Objects.isNull(cimplement)) {
return;
}
if(StringUtils.isBlank(cimplement.getBaseCheckFilePdf()) && StringUtils.isNotBlank(cimplement.getBaseCheckFile())){
if (StringUtils.isBlank(cimplement.getBaseCheckFilePdf()) && StringUtils.isNotBlank(cimplement.getBaseCheckFile())) {
StringJoiner sj = collectionManage.convertAndUpload(cimplement.getBaseCheckFile());
cimplement.setBaseCheckFilePdf(sj.toString());
}
if(StringUtils.isBlank(cimplement.getBaseChanFilePdf()) && StringUtils.isNotBlank(cimplement.getBaseChanFile())){
if (StringUtils.isBlank(cimplement.getBaseChanFilePdf()) && StringUtils.isNotBlank(cimplement.getBaseChanFile())) {
StringJoiner sj = collectionManage.convertAndUpload(cimplement.getBaseChanFile());
cimplement.setBaseChanFilePdf(sj.toString());
}
if(StringUtils.isBlank(cimplement.getBaseChangeFormFilePdf()) && StringUtils.isNotBlank(cimplement.getBaseChangeFormFile())){
if (StringUtils.isBlank(cimplement.getBaseChangeFormFilePdf()) && StringUtils.isNotBlank(cimplement.getBaseChangeFormFile())) {
StringJoiner sj = collectionManage.convertAndUpload(cimplement.getBaseChangeFormFile());
cimplement.setBaseChangeFormFilePdf(sj.toString());
}
if(StringUtils.isBlank(cimplement.getBaseUserConsFilePdf()) && StringUtils.isNotBlank(cimplement.getBaseUserConsFile())){
if (StringUtils.isBlank(cimplement.getBaseUserConsFilePdf()) && StringUtils.isNotBlank(cimplement.getBaseUserConsFile())) {
StringJoiner sj = collectionManage.convertAndUpload(cimplement.getBaseUserConsFile());
cimplement.setBaseUserConsFilePdf(sj.toString());
}
if(StringUtils.isBlank(cimplement.getBaseEstaSummFilePdf()) && StringUtils.isNotBlank(cimplement.getBaseEstaSummFile())){
if (StringUtils.isBlank(cimplement.getBaseEstaSummFilePdf()) && StringUtils.isNotBlank(cimplement.getBaseEstaSummFile())) {
StringJoiner sj = collectionManage.convertAndUpload(cimplement.getBaseEstaSummFile());
cimplement.setBaseEstaSummFilePdf(sj.toString());
}
if(StringUtils.isBlank(cimplement.getBaseEngineerPostpoFilePdf()) && StringUtils.isNotBlank(cimplement.getBaseEngineerPostpoFile())){
if (StringUtils.isBlank(cimplement.getBaseEngineerPostpoFilePdf()) && StringUtils.isNotBlank(cimplement.getBaseEngineerPostpoFile())) {
StringJoiner sj = collectionManage.convertAndUpload(cimplement.getBaseEngineerPostpoFile());
cimplement.setBaseEngineerPostpoFilePdf(sj.toString());
}
if(StringUtils.isBlank(cimplement.getBasePasswAssessFilePdf()) && StringUtils.isNotBlank(cimplement.getBasePasswAssessFile())){
if (StringUtils.isBlank(cimplement.getBasePasswAssessFilePdf()) && StringUtils.isNotBlank(cimplement.getBasePasswAssessFile())) {
StringJoiner sj = collectionManage.convertAndUpload(cimplement.getBasePasswAssessFile());
cimplement.setBasePasswAssessFilePdf(sj.toString());
}
if(StringUtils.isBlank(cimplement.getBaseThirdAcceptFilePdf()) && StringUtils.isNotBlank(cimplement.getBaseThirdAcceptFile())){
if (StringUtils.isBlank(cimplement.getBaseThirdAcceptFilePdf()) && StringUtils.isNotBlank(cimplement.getBaseThirdAcceptFile())) {
StringJoiner sj = collectionManage.convertAndUpload(cimplement.getBaseThirdAcceptFile());
cimplement.setBaseThirdAcceptFilePdf(sj.toString());
}
if(StringUtils.isBlank(cimplement.getBaseFinanlAuditFilePdf()) && StringUtils.isNotBlank(cimplement.getBaseFinanlAuditFile())){
if (StringUtils.isBlank(cimplement.getBaseFinanlAuditFilePdf()) && StringUtils.isNotBlank(cimplement.getBaseFinanlAuditFile())) {
StringJoiner sj = collectionManage.convertAndUpload(cimplement.getBaseFinanlAuditFile());
cimplement.setBaseFinanlAuditFilePdf(sj.toString());
}
if(StringUtils.isBlank(cimplement.getBaseInitialOpinionFilePdf()) && StringUtils.isNotBlank(cimplement.getBaseInitialOpinionFile())){
if (StringUtils.isBlank(cimplement.getBaseInitialOpinionFilePdf()) && StringUtils.isNotBlank(cimplement.getBaseInitialOpinionFile())) {
StringJoiner sj = collectionManage.convertAndUpload(cimplement.getBaseInitialOpinionFile());
cimplement.setBaseInitialOpinionFilePdf(sj.toString());
}
if(StringUtils.isBlank(cimplement.getBaseThirdAcceptFilePdf()) && StringUtils.isNotBlank(cimplement.getBaseThirdAcceptFile())){
if (StringUtils.isBlank(cimplement.getBaseThirdAcceptFilePdf()) && StringUtils.isNotBlank(cimplement.getBaseThirdAcceptFile())) {
StringJoiner sj = collectionManage.convertAndUpload(cimplement.getBaseThirdAcceptFile());
cimplement.setBaseThirdAcceptFilePdf(sj.toString());
}
if(StringUtils.isBlank(cimplement.getBaseSummReportFilePdf()) && StringUtils.isNotBlank(cimplement.getBaseSummReportFile())){
if (StringUtils.isBlank(cimplement.getBaseSummReportFilePdf()) && StringUtils.isNotBlank(cimplement.getBaseSummReportFile())) {
StringJoiner sj = collectionManage.convertAndUpload(cimplement.getBaseSummReportFile());
cimplement.setBaseSummReportFilePdf(sj.toString());
}
if(StringUtils.isBlank(cimplement.getBaseFinalExpertOpinionFilePdf()) && StringUtils.isNotBlank(cimplement.getBaseFinalExpertOpinionFile())){
if (StringUtils.isBlank(cimplement.getBaseFinalExpertOpinionFilePdf()) && StringUtils.isNotBlank(cimplement.getBaseFinalExpertOpinionFile())) {
StringJoiner sj = collectionManage.convertAndUpload(cimplement.getBaseFinalExpertOpinionFile());
cimplement.setBaseFinalExpertOpinionFilePdf(sj.toString());
}
if(StringUtils.isBlank(cimplement.getBaseIrsTestRunFilePdf()) && StringUtils.isNotBlank(cimplement.getBaseIrsTestRunFile())){
if (StringUtils.isBlank(cimplement.getBaseIrsTestRunFilePdf()) && StringUtils.isNotBlank(cimplement.getBaseIrsTestRunFile())) {
StringJoiner sj = collectionManage.convertAndUpload(cimplement.getBaseIrsTestRunFile());
cimplement.setBaseIrsTestRunFilePdf(sj.toString());
}
if(StringUtils.isBlank(cimplement.getBaseInforLevelFilePdf()) && StringUtils.isNotBlank(cimplement.getBaseInforLevelFile())){
if (StringUtils.isBlank(cimplement.getBaseInforLevelFilePdf()) && StringUtils.isNotBlank(cimplement.getBaseInforLevelFile())) {
StringJoiner sj = collectionManage.convertAndUpload(cimplement.getBaseInforLevelFile());
cimplement.setBaseInforLevelFilePdf(sj.toString());
}
@@ -352,48 +351,48 @@ public class SynProjectCollectionTask {

private void convertPdfMimplement(String baseProjId) {
GovBizProjectMimplement mimplement = mimplementService.getOne(Wrappers.lambdaQuery(GovBizProjectMimplement.class)
.eq(GovBizProjectMimplement::getBaseProjId,baseProjId)
.eq(GovBizProjectMimplement::getBaseProjId, baseProjId)
.last(BizConst.LIMIT_1));
if(Objects.isNull(mimplement)){
if (Objects.isNull(mimplement)) {
return;
}
if(StringUtils.isBlank(mimplement.getBaseChanFilePdf()) && StringUtils.isNotBlank(mimplement.getBaseChanFile())){
if (StringUtils.isBlank(mimplement.getBaseChanFilePdf()) && StringUtils.isNotBlank(mimplement.getBaseChanFile())) {
StringJoiner sj = collectionManage.convertAndUpload(mimplement.getBaseChanFile());
mimplement.setBaseChanFilePdf(sj.toString());
}
if(StringUtils.isBlank(mimplement.getBaseUserConsFilePdf()) && StringUtils.isNotBlank(mimplement.getBaseUserConsFile())){
if (StringUtils.isBlank(mimplement.getBaseUserConsFilePdf()) && StringUtils.isNotBlank(mimplement.getBaseUserConsFile())) {
StringJoiner sj = collectionManage.convertAndUpload(mimplement.getBaseUserConsFile());
mimplement.setBaseUserConsFilePdf(sj.toString());
}
if(StringUtils.isBlank(mimplement.getBaseEstaSummFilePdf()) && StringUtils.isNotBlank(mimplement.getBaseEstaSummFile())){
if (StringUtils.isBlank(mimplement.getBaseEstaSummFilePdf()) && StringUtils.isNotBlank(mimplement.getBaseEstaSummFile())) {
StringJoiner sj = collectionManage.convertAndUpload(mimplement.getBaseEstaSummFile());
mimplement.setBaseEstaSummFilePdf(sj.toString());
}
if(StringUtils.isBlank(mimplement.getBaseEngineerPostpoFilePdf()) && StringUtils.isNotBlank(mimplement.getBaseEngineerPostpoFile())){
if (StringUtils.isBlank(mimplement.getBaseEngineerPostpoFilePdf()) && StringUtils.isNotBlank(mimplement.getBaseEngineerPostpoFile())) {
StringJoiner sj = collectionManage.convertAndUpload(mimplement.getBaseEngineerPostpoFile());
mimplement.setBaseEngineerPostpoFilePdf(sj.toString());
}
if(StringUtils.isBlank(mimplement.getBasePasswAssessFilePdf()) && StringUtils.isNotBlank(mimplement.getBasePasswAssessFile())){
if (StringUtils.isBlank(mimplement.getBasePasswAssessFilePdf()) && StringUtils.isNotBlank(mimplement.getBasePasswAssessFile())) {
StringJoiner sj = collectionManage.convertAndUpload(mimplement.getBasePasswAssessFile());
mimplement.setBasePasswAssessFilePdf(sj.toString());
}
if(StringUtils.isBlank(mimplement.getBaseThirdAcceptFilePdf()) && StringUtils.isNotBlank(mimplement.getBaseThirdAcceptFile())){
if (StringUtils.isBlank(mimplement.getBaseThirdAcceptFilePdf()) && StringUtils.isNotBlank(mimplement.getBaseThirdAcceptFile())) {
StringJoiner sj = collectionManage.convertAndUpload(mimplement.getBaseThirdAcceptFile());
mimplement.setBaseThirdAcceptFilePdf(sj.toString());
}
if(StringUtils.isBlank(mimplement.getBaseThirdAcceptFilePdf()) && StringUtils.isNotBlank(mimplement.getBaseThirdAcceptFile())){
if (StringUtils.isBlank(mimplement.getBaseThirdAcceptFilePdf()) && StringUtils.isNotBlank(mimplement.getBaseThirdAcceptFile())) {
StringJoiner sj = collectionManage.convertAndUpload(mimplement.getBaseThirdAcceptFile());
mimplement.setBaseThirdAcceptFilePdf(sj.toString());
}
if(StringUtils.isBlank(mimplement.getBaseFinalExpertOpinionFilePdf()) && StringUtils.isNotBlank(mimplement.getBaseFinalExpertOpinionFile())){
if (StringUtils.isBlank(mimplement.getBaseFinalExpertOpinionFilePdf()) && StringUtils.isNotBlank(mimplement.getBaseFinalExpertOpinionFile())) {
StringJoiner sj = collectionManage.convertAndUpload(mimplement.getBaseFinalExpertOpinionFile());
mimplement.setBaseFinalExpertOpinionFilePdf(sj.toString());
}
if(StringUtils.isBlank(mimplement.getBaseEngineerAlterFilePdf()) && StringUtils.isNotBlank(mimplement.getBaseEngineerAlterFile())){
if (StringUtils.isBlank(mimplement.getBaseEngineerAlterFilePdf()) && StringUtils.isNotBlank(mimplement.getBaseEngineerAlterFile())) {
StringJoiner sj = collectionManage.convertAndUpload(mimplement.getBaseEngineerAlterFile());
mimplement.setBaseEngineerAlterFilePdf(sj.toString());
}
if(StringUtils.isBlank(mimplement.getBaseOperatMaintenSummFilePdf()) && StringUtils.isNotBlank(mimplement.getBaseOperatMaintenSummFile())){
if (StringUtils.isBlank(mimplement.getBaseOperatMaintenSummFilePdf()) && StringUtils.isNotBlank(mimplement.getBaseOperatMaintenSummFile())) {
StringJoiner sj = collectionManage.convertAndUpload(mimplement.getBaseOperatMaintenSummFile());
mimplement.setBaseOperatMaintenSummFilePdf(sj.toString());
}
@@ -403,16 +402,16 @@ public class SynProjectCollectionTask {
private void convertPdfAProcure(String baseProjId) {
List<GovBizProjectProcure> procures = procureService.list(Wrappers.lambdaQuery(GovBizProjectProcure.class)
.eq(GovBizProjectProcure::getBaseProjId, baseProjId));
for(GovBizProjectProcure procure : procures){
if(StringUtils.isBlank(procure.getPurchaseContractPdf()) && StringUtils.isNotBlank(procure.getPurchaseContract())){
for (GovBizProjectProcure procure : procures) {
if (StringUtils.isBlank(procure.getPurchaseContractPdf()) && StringUtils.isNotBlank(procure.getPurchaseContract())) {
StringJoiner sj = collectionManage.convertAndUpload(procure.getPurchaseContract());
procure.setPurchaseContractPdf(sj.toString());
}
if(StringUtils.isBlank(procure.getPurchaseFilePdf()) && StringUtils.isNotBlank(procure.getPurchaseFile())){
if (StringUtils.isBlank(procure.getPurchaseFilePdf()) && StringUtils.isNotBlank(procure.getPurchaseFile())) {
StringJoiner sj = collectionManage.convertAndUpload(procure.getPurchaseFile());
procure.setPurchaseFilePdf(sj.toString());
}
if(StringUtils.isBlank(procure.getBiddingFilePdf()) && StringUtils.isNotBlank(procure.getBiddingFile())){
if (StringUtils.isBlank(procure.getBiddingFilePdf()) && StringUtils.isNotBlank(procure.getBiddingFile())) {
StringJoiner sj = collectionManage.convertAndUpload(procure.getBiddingFile());
procure.setBiddingFilePdf(sj.toString());
}
@@ -424,9 +423,9 @@ public class SynProjectCollectionTask {
StopWatch stopWatch = new StopWatch();
stopWatch.start();

log.info("数据同步任务 指定项目编号 :{}",projectCodes);
log.info("数据同步任务 指定项目编号 :{}", projectCodes);

if(CollUtil.isEmpty(projectCodes)){
if (CollUtil.isEmpty(projectCodes)) {
throw new BizException("不能为空!");
}

@@ -436,21 +435,21 @@ public class SynProjectCollectionTask {
req.setPageSize(1000);
PageVo<GovBizProjectListVO> projectCollectionPage = collectionManage.list(req);

log.info("projectCollections size :{}",projectCollectionPage.getTotal());
log.info("projectCollections size :{}", projectCollectionPage.getTotal());

for(GovBizProjectListVO vo : projectCollectionPage.getRecords()){
for (GovBizProjectListVO vo : projectCollectionPage.getRecords()) {
GovBizProjectDetailVO projectDetail = collectionManage.detail(vo.getBaseProjId());
collectionManage.pushProjectVo(projectDetail);
}

//2.运维备案项目
PageVo<GovBizProjectListVO> operationList = collectionManage.operationList(req);
log.info("operation list size :{}",operationList.getTotal());
for(GovBizProjectListVO vo : operationList.getRecords()){
log.info("operation list size :{}", operationList.getTotal());
for (GovBizProjectListVO vo : operationList.getRecords()) {
GovOperationProjectDetailVO operationDetail = collectionManage.operationDetail(vo.getBaseProjId());
GovOperationProjectBaseinfoVO baseinfo = operationDetail.getBaseinfo();
if(Objects.isNull(baseinfo) || Objects.isNull(baseinfo.getPush()) ||
Boolean.FALSE.equals(baseinfo.getPush())){
if (Objects.isNull(baseinfo) || Objects.isNull(baseinfo.getPush()) ||
Boolean.FALSE.equals(baseinfo.getPush())) {
log.info("此运维项目不用推送:" + vo.getBaseProjId());
}
collectionManage.pushProjectVo(operationDetail);
@@ -458,19 +457,19 @@ public class SynProjectCollectionTask {

//3.申报项目 需要推送的项目
List<Project> projects = projectService.list(Wrappers.lambdaQuery(Project.class)
.eq(Project::getNewest,Boolean.TRUE)
.eq(Project::getPush,Boolean.TRUE)
.in(Project::getProjectCode,projectCodes));
log.info("projects need push size :{}",projects.size());
for(Project project : projects){
.eq(Project::getNewest, Boolean.TRUE)
.eq(Project::getPush, Boolean.TRUE)
.in(Project::getProjectCode, projectCodes));
log.info("projects need push size :{}", projects.size());
for (Project project : projects) {
ProjectDetailVO projectDetailVO = projectLibManage.detailProjectCode(project.getProjectCode());
GovBizProjectDetailVO vo = ProjectConvertUtil.declaredToCollection(projectDetailVO,fileService);
if(Objects.nonNull(vo)){
GovBizProjectDetailVO vo = ProjectConvertUtil.declaredToCollection(projectDetailVO, fileService);
if (Objects.nonNull(vo)) {
collectionManage.pushProjectVo(vo);
}
}

stopWatch.stop();
log.info("数据同步任务 指定项目编号 结束====={}s",stopWatch.getTotalTimeSeconds());
log.info("数据同步任务 指定项目编号 结束====={}s", stopWatch.getTotalTimeSeconds());
}
}

+ 16
- 12
hz-pm-api/src/main/java/com/hz/pm/api/todocenter/manage/HandlerManage.java 파일 보기

@@ -12,6 +12,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.google.common.collect.Sets;
import com.hz.pm.api.common.enumeration.ProjectProcessStageEnum;
import com.hz.pm.api.common.model.constant.BizConst;
import com.hz.pm.api.common.model.constant.TypeReferenceConst;
import com.hz.pm.api.common.statemachine.util.StateMachineUtil;
import com.hz.pm.api.common.statemachine.util.TenderStateMachineUtil;
import com.hz.pm.api.common.util.BizUtils;
@@ -141,11 +142,17 @@ public class HandlerManage {
// 获取子流程当前审核人节点
ProgressNode subCurrNode = CollUtil.isEmpty(children) ? new ProgressNode() : children.get(children.size() - 1);
// 获取节点ID相同地审核节点
children.stream().filter(c -> subCurrNode.getNodeId().equals(c.getNodeId()))
.forEach(c -> currUserIdList.add(c.getUserId()));
children.forEach(c -> {
if (subCurrNode.getNodeId().equals(c.getNodeId())) {
currUserIdList.add(c.getUserId());
}
});
} else {
newProgressInfo.stream().filter(c -> currNode.getNodeId().equals(c.getNodeId()))
.forEach(w -> currUserIdList.add(w.getUserId()));
newProgressInfo.forEach(w -> {
if (currNode.getNodeId().equals(w.getNodeId())) {
currUserIdList.add(w.getUserId());
}
});
}

// 流程通过后,判断当前登录用户是不是最后一个审核人
@@ -164,7 +171,7 @@ public class HandlerManage {
updateProjectApplyBorrowInfo(project, instanceId);
break;
default:
throw new BizException("传入实例类型错误: " + instTypeEnum);
throw BizException.wrap("传入实例类型错误: %s", instTypeEnum);
}
} else {
switch (Objects.requireNonNull(ProjectStatusEnum.match(project.getStatus()))) {
@@ -200,7 +207,7 @@ public class HandlerManage {
purchasePassedCallback(project, instanceId, processStage);
break;
default:
throw new BizException("传入项目状态错误: " + project.getStatus());
throw BizException.wrap("传入项目状态错误: %s", project.getStatus());
}
}
//发送消息
@@ -428,9 +435,7 @@ public class HandlerManage {
return applicationDTO;
}).collect(Collectors.toList());
projectInfo.setApplicationList(applicationDTOList);
Map<String, Object> dynamicMap = JSON.parseObject(req.getDynamicForm(),
new TypeReference<Map<String, Object>>() {
});
Map<String, Object> dynamicMap = JSON.parseObject(req.getDynamicForm(), TypeReferenceConst.STR_OBJ_MAP);
projectInfo.setDynamicForm(dynamicMap);
projectDraft.setProjectInfo(projectInfo);
declaredProjectManage.saveToDraft(projectDraft, ProjectDraftTypeEnum.PROJECT_DECLARED);
@@ -536,9 +541,8 @@ public class HandlerManage {
/**
* 当为撤回操作时,更新项目表中的项目状态为前一个状态
*
* @param userId
* @param project
* @return void
* @param userId \
* @param project \
* @author CMM
* @since 2023/02/08
*/


+ 0
- 3
hz-pm-api/src/main/java/com/hz/pm/api/user/manage/MhUnitManage.java 파일 보기

@@ -69,9 +69,6 @@ public class MhUnitManage {
Function<MhUnitTreeDTO, Integer> function = w -> w.getType().getStrip().getCode();
nodes.sort(Comparator.comparing(MhUnitTreeDTO::getName)
.thenComparing(function, Comparator.reverseOrder()));
for (MhUnitTreeDTO node : nodes) {
System.out.println(node.getName());
}
return nodes;
}



불러오는 중...
취소
저장