@@ -4,8 +4,10 @@ import cn.hutool.extra.spring.SpringUtil; | |||
import com.hz.pm.api.common.config.ThreadPoolUtilProperties; | |||
import com.hz.pm.api.common.config.ThreadPoolUtilProperties.ThreadPoolProperties; | |||
import lombok.extern.slf4j.Slf4j; | |||
import org.springframework.core.task.TaskExecutor; | |||
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; | |||
import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler; | |||
import org.springframework.security.task.DelegatingSecurityContextTaskExecutor; | |||
import java.util.concurrent.ThreadPoolExecutor; | |||
@@ -23,23 +25,24 @@ public class ThreadPoolUtil { | |||
private ThreadPoolUtil() { | |||
} | |||
public static final ThreadPoolTaskExecutor REQUEST; | |||
public static final TaskExecutor REQUEST; | |||
public static final ThreadPoolTaskScheduler SCHEDULER; | |||
static { | |||
ThreadPoolUtilProperties properties = SpringUtil.getBean(ThreadPoolUtilProperties.class); | |||
ThreadPoolProperties requestProps = properties.getRequest(); | |||
REQUEST = new MDCThreadPoolTaskExecutor(); | |||
REQUEST.setCorePoolSize(requestProps.getCorePoolSize()); | |||
REQUEST.setMaxPoolSize(requestProps.getMaxPoolSize()); | |||
REQUEST.setQueueCapacity(requestProps.getQueueCapacity()); | |||
REQUEST.setThreadPriority(Thread.NORM_PRIORITY); | |||
REQUEST.setAllowCoreThreadTimeOut(requestProps.getAllowCoreThreadTimeOut()); | |||
REQUEST.setWaitForTasksToCompleteOnShutdown(requestProps.getWaitForTasksToCompleteOnShutdown()); | |||
REQUEST.setKeepAliveSeconds(requestProps.getKeepAliveSeconds()); | |||
REQUEST.setThreadNamePrefix(requestProps.getThreadNamePrefix()); | |||
REQUEST.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy()); | |||
REQUEST.initialize(); | |||
ThreadPoolTaskExecutor requestExecutor = new MDCThreadPoolTaskExecutor(); | |||
requestExecutor.setCorePoolSize(requestProps.getCorePoolSize()); | |||
requestExecutor.setMaxPoolSize(requestProps.getMaxPoolSize()); | |||
requestExecutor.setQueueCapacity(requestProps.getQueueCapacity()); | |||
requestExecutor.setThreadPriority(Thread.NORM_PRIORITY); | |||
requestExecutor.setAllowCoreThreadTimeOut(requestProps.getAllowCoreThreadTimeOut()); | |||
requestExecutor.setWaitForTasksToCompleteOnShutdown(requestProps.getWaitForTasksToCompleteOnShutdown()); | |||
requestExecutor.setKeepAliveSeconds(requestProps.getKeepAliveSeconds()); | |||
requestExecutor.setThreadNamePrefix(requestProps.getThreadNamePrefix()); | |||
requestExecutor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy()); | |||
requestExecutor.initialize(); | |||
REQUEST = new DelegatingSecurityContextTaskExecutor(requestExecutor); | |||
ThreadPoolProperties schedulerProps = properties.getScheduler(); | |||
SCHEDULER = new MDCThreadPoolTaskScheduler(); | |||
SCHEDULER.setThreadNamePrefix(schedulerProps.getThreadNamePrefix()); | |||
@@ -29,7 +29,7 @@ public class ExpertAdminDataScopeProviderImpl implements DataScopeProvider { | |||
@Override | |||
public Optional<DataScopeDTO> findDataFieldProperty() { | |||
UserInfoDetails user = LoginUserUtil.loginUserDetail(); | |||
UserInfoDetails user = LoginUserUtil.userDetail(); | |||
DataScopeDTO ds = new DataScopeDTO(); | |||
ds.setRole(RoleEnum.EXPERT_ADMIN); | |||
ds.setUserId(user.getUserId()); | |||
@@ -39,7 +39,7 @@ public class ExpertAdminDataScopeProviderImpl implements DataScopeProvider { | |||
@Override | |||
public Optional<DataScopeDTO> findDataFieldProperty(Long userId) { | |||
UserInfoDetails user = LoginUserUtil.loginUserDetail(); | |||
UserInfoDetails user = LoginUserUtil.userDetail(); | |||
DataScopeDTO ds = new DataScopeDTO(); | |||
ds.setRole(RoleEnum.EXPERT_ADMIN); | |||
ds.setUserId(user.getUserId()); | |||
@@ -31,7 +31,7 @@ public class OrgAdminDataScopeProviderImpl implements DataScopeProvider { | |||
@Override | |||
public Optional<DataScopeDTO> findDataFieldProperty() { | |||
UserInfoDetails user = LoginUserUtil.loginUserDetail(); | |||
UserInfoDetails user = LoginUserUtil.userDetail(); | |||
DataScopeDTO ds = new DataScopeDTO(); | |||
ds.setOrgCode(user.getMhUnitIdStr()); | |||
ds.setUserId(user.getUserId()); | |||
@@ -41,7 +41,7 @@ public class OrgAdminDataScopeProviderImpl implements DataScopeProvider { | |||
@Override | |||
public Optional<DataScopeDTO> findDataFieldProperty(Long userId) { | |||
UserInfoDetails user = LoginUserUtil.loginUserDetail(); | |||
UserInfoDetails user = LoginUserUtil.userDetail(); | |||
DataScopeDTO ds = new DataScopeDTO(); | |||
ds.setOrgCode(user.getMhUnitIdStr()); | |||
ds.setUserId(userId); | |||
@@ -35,7 +35,7 @@ public class DataScopeUtil { | |||
} | |||
public static Optional<DataScopeDTO> getCurrentUserDataScope() { | |||
UserInfoDetails loginUser = LoginUserUtil.loginUserDetail(); | |||
UserInfoDetails loginUser = LoginUserUtil.userDetail(); | |||
if (Objects.isNull(loginUser) || Objects.isNull(loginUser.maxAuthRole())) { | |||
return Optional.empty(); | |||
} | |||
@@ -16,7 +16,7 @@ import org.springframework.stereotype.Component; | |||
public class PermissionCheckHelper { | |||
public boolean isSuperAdmin() { | |||
UserInfoDetails details = LoginUserUtil.loginUserDetail(); | |||
UserInfoDetails details = LoginUserUtil.userDetail(); | |||
return details.getUserRoleList().stream().anyMatch(w -> w.getCode().equals(RoleEnum.SUPER_ADMIN.name())); | |||
} | |||
@@ -35,7 +35,7 @@ public class MhSyncController { | |||
@ApiOperation("获取当前用户的流程模型") | |||
public WflowModels syncWflow(@PathVariable Integer type) { | |||
return processModelManage.getWflowModelsNoNull(ProjectProcessType.getNoNull(type), | |||
LoginUserUtil.loginUserDetail().getMhUnitId()); | |||
LoginUserUtil.userDetail().getMhUnitId()); | |||
} | |||
@GetMapping("/users") | |||
@@ -86,7 +86,7 @@ public class DocumentationManage { | |||
* @return | |||
*/ | |||
public String addGroup(DocumentationGroupSaveDTO dto) { | |||
UserInfoDetails user = LoginUserUtil.loginUserDetail(); | |||
UserInfoDetails user = LoginUserUtil.userDetail(); | |||
if (documentationGroupService.count(Wrappers.lambdaQuery(DocumentationGroup.class) | |||
.eq(DocumentationGroup::getName, dto.getName())) > 0) { | |||
throw new BizException("此分组名 已经存在"); | |||
@@ -128,7 +128,7 @@ public class DocumentationManage { | |||
*/ | |||
@Transactional(rollbackFor = Exception.class) | |||
public String addDoc(DocumentationSaveDTO dto) { | |||
UserInfoDetails user = LoginUserUtil.loginUserDetail(); | |||
UserInfoDetails user = LoginUserUtil.userDetail(); | |||
Long fileId = dto.getFileId(); | |||
File file = fileService.getById(fileId); | |||
@@ -8,11 +8,9 @@ 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; | |||
import com.hz.pm.api.common.enumeration.ProjectProcessType; | |||
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.CommonConst; | |||
@@ -43,16 +41,13 @@ import com.hz.pm.api.projectlib.manage.ProjectLibManage; | |||
import com.hz.pm.api.projectlib.model.entity.Project; | |||
import com.hz.pm.api.projectlib.model.entity.ProjectApplication; | |||
import com.hz.pm.api.projectlib.model.entity.ProjectInst; | |||
import com.hz.pm.api.projectlib.model.enumeration.InstTypeEnum; | |||
import com.hz.pm.api.projectlib.model.enumeration.status.ProjectStatus; | |||
import com.hz.pm.api.projectlib.model.vo.ProjectDetailVO; | |||
import com.hz.pm.api.projectlib.service.IProjectApplicationService; | |||
import com.hz.pm.api.projectlib.service.IProjectInstService; | |||
import com.hz.pm.api.projectlib.service.IProjectService; | |||
import com.hz.pm.api.staging.enums.MsgTypeEnum; | |||
import com.hz.pm.api.sys.manage.NoticeManage; | |||
import com.hz.pm.api.sys.manage.ProcessModelManage; | |||
import com.hz.pm.api.todocenter.constant.WorkNoticeConst; | |||
import com.hz.pm.api.user.helper.MhUnitCache; | |||
import com.hz.pm.api.user.model.dto.UnitDTO; | |||
import com.hz.pm.api.user.security.model.UserFullInfoDTO; | |||
@@ -64,13 +59,9 @@ import com.ningdatech.basic.util.CollUtils; | |||
import com.ningdatech.file.entity.File; | |||
import com.ningdatech.file.service.FileService; | |||
import com.ningdatech.file.utils.StrPool; | |||
import com.wflow.bean.entity.WflowModels; | |||
import com.wflow.contants.HisProInsEndActId; | |||
import com.wflow.workflow.bean.dto.OrgInfoDTO; | |||
import com.wflow.workflow.bean.process.FileBasicInfo; | |||
import com.wflow.workflow.bean.process.ProcessComment; | |||
import com.wflow.workflow.bean.vo.ProcessDetailVO; | |||
import com.wflow.workflow.bean.vo.ProcessStartParamsVo; | |||
import com.wflow.workflow.service.ProcessInstanceService; | |||
import lombok.AllArgsConstructor; | |||
import lombok.extern.slf4j.Slf4j; | |||
@@ -80,7 +71,6 @@ import org.flowable.engine.TaskService; | |||
import org.flowable.engine.history.HistoricProcessInstance; | |||
import org.flowable.engine.task.Comment; | |||
import org.springframework.stereotype.Component; | |||
import org.springframework.transaction.annotation.Transactional; | |||
import javax.servlet.http.HttpServletResponse; | |||
import java.io.IOException; | |||
@@ -123,7 +113,7 @@ public class ProjectFileManage { | |||
private final MhUnitCache mhUnitCache; | |||
public PageVo<ProjectFileListVO> list(ProjectFileListParam req) { | |||
UserInfoDetails user = LoginUserUtil.loginUserDetail(); | |||
UserInfoDetails user = LoginUserUtil.userDetail(); | |||
LambdaQueryWrapper<Project> query = Wrappers.lambdaQuery(Project.class) | |||
.like(StrUtils.isNotBlank(req.getProjectName()), Project::getProjectName, req.getProjectName()) | |||
.like(StrUtils.isNotBlank(req.getBuildOrgName()), Project::getBuildOrgName, req.getBuildOrgName()) | |||
@@ -29,7 +29,7 @@ public class CompanyFiscalCodeManage { | |||
public void fiscalCodeConfigure(CompanyFiscalCodeAndSealSnReq req) { | |||
UserInfoDetails userDetail = LoginUserUtil.loginUserDetail(); | |||
UserInfoDetails userDetail = LoginUserUtil.userDetail(); | |||
String temOrgCode; | |||
if (StrUtils.isBlank(req.getOrganizationCode())) { | |||
temOrgCode = String.valueOf(userDetail.getMhUnitId()); | |||
@@ -67,7 +67,7 @@ public class CompanyFiscalCodeManage { | |||
} | |||
public CompanyFiscalCodeAndSealSnVO getFiscalCodeConfigure(ReqGetCompanyFiscalCodeAndSealSnPO request) { | |||
UserInfoDetails userDetail = LoginUserUtil.loginUserDetail(); | |||
UserInfoDetails userDetail = LoginUserUtil.userDetail(); | |||
String temOrgCode; | |||
if (StrUtils.isBlank(request.getOrganizationCode())) { | |||
temOrgCode = String.valueOf(userDetail.getMhUnitId()); | |||
@@ -283,7 +283,7 @@ public class GovProjectCollectionManage { | |||
* @return | |||
*/ | |||
public PageVo<GovBizProjectListVO> draftList(ProjectListReq req) { | |||
UserInfoDetails user = LoginUserUtil.loginUserDetail(); | |||
UserInfoDetails user = LoginUserUtil.userDetail(); | |||
Page<GovBizProjectDraft> page = req.page(); | |||
LambdaQueryWrapper<GovBizProjectDraft> wrapper = Wrappers.lambdaQuery(GovBizProjectDraft.class) | |||
.like(StringUtils.isNotBlank(req.getProjectName()), GovBizProjectDraft::getBaseProjName, req.getProjectName()) | |||
@@ -319,7 +319,7 @@ public class GovProjectCollectionManage { | |||
} | |||
public PageVo<GovBizProjectListVO> operationDraftList(ProjectListReq req) { | |||
UserInfoDetails user = LoginUserUtil.loginUserDetail(); | |||
UserInfoDetails user = LoginUserUtil.userDetail(); | |||
Page<GovOperationProjectDraft> page = req.page(); | |||
LambdaQueryWrapper<GovOperationProjectDraft> wrapper = Wrappers.lambdaQuery(GovOperationProjectDraft.class) | |||
.like(StrUtil.isNotBlank(req.getProjectName()), GovOperationProjectDraft::getBaseProjName, req.getProjectName()) | |||
@@ -640,7 +640,7 @@ public class GovProjectCollectionManage { | |||
@Transactional(rollbackFor = Exception.class) | |||
public String save(GovBizProjectSaveDTO req) { | |||
LocalDateTime now = LocalDateTime.now(); | |||
UserInfoDetails user = LoginUserUtil.loginUserDetail(); | |||
UserInfoDetails user = LoginUserUtil.userDetail(); | |||
GovBizProjectBaseinfoDTO base = req.getBaseinfo(); | |||
String baseProjId = req.getBaseProjId(); | |||
@@ -840,7 +840,7 @@ public class GovProjectCollectionManage { | |||
@Transactional(rollbackFor = Exception.class) | |||
public String operationSave(GovOperationProjectSaveDTO saveDTO, UserInfoDetails user) { | |||
if (Objects.isNull(user)) { | |||
user = LoginUserUtil.loginUserDetail(); | |||
user = LoginUserUtil.userDetail(); | |||
} | |||
GovOperationProjectBaseinfoDTO base = saveDTO.getBaseinfo(); | |||
@@ -1057,7 +1057,7 @@ public class GovProjectCollectionManage { | |||
*/ | |||
public String draft(GovBizProjectSaveDTO saveDTO, UserInfoDetails user) { | |||
if (Objects.isNull(user)) { | |||
user = LoginUserUtil.loginUserDetail(); | |||
user = LoginUserUtil.userDetail(); | |||
} | |||
GovBizProjectDraft draft = new GovBizProjectDraft(); | |||
@@ -1152,7 +1152,7 @@ public class GovProjectCollectionManage { | |||
public String operationDraft(GovOperationProjectSaveDTO saveDTO, UserInfoDetails user) { | |||
if (Objects.isNull(user)) { | |||
user = LoginUserUtil.loginUserDetail(); | |||
user = LoginUserUtil.userDetail(); | |||
} | |||
GovOperationProjectDraft draft = new GovOperationProjectDraft(); | |||
@@ -1252,7 +1252,7 @@ public class GovProjectCollectionManage { | |||
* @return | |||
*/ | |||
public String remove(String projId) { | |||
UserInfoDetails user = LoginUserUtil.loginUserDetail(); | |||
UserInfoDetails user = LoginUserUtil.userDetail(); | |||
String username = user.getUsername(); | |||
GovBizProjectBaseinfo baseinfo = baseinfoService.getOne(Wrappers.lambdaQuery(GovBizProjectBaseinfo.class) | |||
@@ -1295,7 +1295,7 @@ public class GovProjectCollectionManage { | |||
} | |||
public String operationRemove(String projId) { | |||
UserInfoDetails user = LoginUserUtil.loginUserDetail(); | |||
UserInfoDetails user = LoginUserUtil.userDetail(); | |||
String username = user.getUsername(); | |||
GovOperationProjectBaseinfo baseinfo = operationProjectBaseinfoService.getOne(Wrappers.lambdaQuery(GovOperationProjectBaseinfo.class) | |||
@@ -43,7 +43,7 @@ public class IrsProjectManage { | |||
*/ | |||
public PageVo<ProjectLibListItemVO> list(ProjectListReq req) { | |||
Page<Project> page = req.page(); | |||
UserInfoDetails user = LoginUserUtil.loginUserDetail(); | |||
UserInfoDetails user = LoginUserUtil.userDetail(); | |||
LambdaQueryWrapper<Project> wrapper = Wrappers.lambdaQuery(Project.class) | |||
.eq(StringUtils.isNotBlank(req.getProjectType()), Project::getProjectType, req.getProjectType()) | |||
.eq(Objects.nonNull(req.getStatus()), Project::getStatus, req.getStatus()) | |||
@@ -150,7 +150,7 @@ public class MeetingManage { | |||
throw ReturnException.wrap("会议正在创建中"); | |||
} | |||
try { | |||
UserInfoDetails userDetail = LoginUserUtil.loginUserDetail(); | |||
UserInfoDetails userDetail = LoginUserUtil.userDetail(); | |||
ExpertInviteReq inviteRule = req.getExpertInviteRule(); | |||
// 保存会议基本信息 | |||
Meeting meeting = BeanUtil.copyProperties(meetingBasic, Meeting.class); | |||
@@ -437,7 +437,7 @@ public class MeetingManage { | |||
.eq(req.getStatus() != null, Meeting::getStatus, req.getStatus()) | |||
.orderByDesc(Meeting::getCreateOn); | |||
meetingManageHelper.buildMeetingQuery(query, req); | |||
UserInfoDetails userDetail = LoginUserUtil.loginUserDetail(); | |||
UserInfoDetails userDetail = LoginUserUtil.userDetail(); | |||
RoleEnum maxRoleAuth = userDetail.maxAuthRole(); | |||
switch (maxRoleAuth) { | |||
case SUPER_ADMIN: | |||
@@ -1014,7 +1014,7 @@ public class MeetingManage { | |||
LambdaQueryWrapper<Project> query = Wrappers.lambdaQuery(Project.class) | |||
.eq(Project::getNewest, Boolean.TRUE) | |||
.notIn(Project::getStage, ProjectStatus.STOPPED.getCode(), ProjectStatus.CHANGE.getCode()); | |||
UserInfoDetails userDetail = LoginUserUtil.loginUserDetail(); | |||
UserInfoDetails userDetail = LoginUserUtil.userDetail(); | |||
switch (userDetail.maxAuthRole()) { | |||
case SUPER_ADMIN: | |||
break; | |||
@@ -54,7 +54,7 @@ public class ProcDefController { | |||
@WebLog("单位流程配置保存") | |||
public synchronized String save(@Validated @RequestBody WflowOrgProcdefDto req) { | |||
if (StrUtils.isBlank(req.getOrgCode())) { | |||
req.setOrgCode(LoginUserUtil.loginUserDetail().getMhUnitIdStr()); | |||
req.setOrgCode(LoginUserUtil.userDetail().getMhUnitIdStr()); | |||
} | |||
return orgProcessModelService.saveProcessLs(req); | |||
} | |||
@@ -69,7 +69,7 @@ public class AppAppraisalManage { | |||
* @return | |||
*/ | |||
public PageVo<PerformanceAppraisalVO> list(PerformanceAppraisalListReq req) { | |||
UserInfoDetails user = LoginUserUtil.loginUserDetail(); | |||
UserInfoDetails user = LoginUserUtil.userDetail(); | |||
// 获取当前登录用户的角色列表,只有绩效复评人员才能查看该列表 | |||
List<Long> roleIdList = user.getRoleIds(); | |||
if (roleIdList.isEmpty()) { | |||
@@ -103,7 +103,7 @@ public class AppAppraisalManage { | |||
public PageVo<PerformanceAppraisalAppVO> unEvaluateList(Long planId, PerformanceAppraisalListReq req) { | |||
UserInfoDetails user = LoginUserUtil.loginUserDetail(); | |||
UserInfoDetails user = LoginUserUtil.userDetail(); | |||
String userIdStr = user.getUserIdStr(); | |||
PerformanceAppraisal plan = performanceAppraisalService.getById(planId); | |||
@@ -161,7 +161,7 @@ public class AppAppraisalManage { | |||
public PageVo<PerformanceAppraisalAppVO> evaluatedList(Long planId, PerformanceAppraisalListReq req) { | |||
UserInfoDetails user = LoginUserUtil.loginUserDetail(); | |||
UserInfoDetails user = LoginUserUtil.userDetail(); | |||
String employeeCode = user.getUserIdStr(); | |||
PerformanceAppraisal plan = performanceAppraisalService.getById(planId); | |||
@@ -324,7 +324,7 @@ public class AppAppraisalManage { | |||
@Transactional(rollbackFor = Exception.class) | |||
public String saveAppraisal(ProjectAppraisalDTO param) { | |||
UserInfoDetails userDetail = LoginUserUtil.loginUserDetail(); | |||
UserInfoDetails userDetail = LoginUserUtil.userDetail(); | |||
String userIdStr = userDetail.getUserIdStr(); | |||
String username = userDetail.getUsername(); | |||
@@ -136,7 +136,7 @@ public class IndicatorConfigManage { | |||
*/ | |||
@Transactional(rollbackFor = Exception.class) | |||
public String projectTemplateSave(PerformanceIndicatorProjectTemplateSaveDTO dto) { | |||
UserInfoDetails user = LoginUserUtil.loginUserDetail(); | |||
UserInfoDetails user = LoginUserUtil.userDetail(); | |||
PerformanceIndicatorProjectTemplate template = BeanUtil.copyProperties(dto, PerformanceIndicatorProjectTemplate.class); | |||
List<Long> projectTagIds = dto.getProjectTagIds(); | |||
List<String> tagIdList = projectTagIds.stream().map(String::valueOf).collect(Collectors.toList()); | |||
@@ -223,7 +223,7 @@ public class IndicatorConfigManage { | |||
if (CollUtil.isEmpty(templateDetails)) { | |||
return; | |||
} | |||
UserInfoDetails user = LoginUserUtil.loginUserDetail(); | |||
UserInfoDetails user = LoginUserUtil.userDetail(); | |||
for (ProjectTemplateDetailDTO detail : templateDetails) { | |||
//计算阶段的 | |||
PerformanceIndicatorProjectTemplateDetail templateDetail = BeanUtil.copyProperties(detail, PerformanceIndicatorProjectTemplateDetail.class); | |||
@@ -249,7 +249,7 @@ public class IndicatorConfigManage { | |||
if (CollUtil.isEmpty(templateDetails)) { | |||
return; | |||
} | |||
UserInfoDetails user = LoginUserUtil.loginUserDetail(); | |||
UserInfoDetails user = LoginUserUtil.userDetail(); | |||
for (ProjectTemplateDetailDTO detail : templateDetails) { | |||
//计算阶段的 | |||
PerformanceIndicatorProjectTemplateDetail templateDetail = BeanUtil.copyProperties(detail, PerformanceIndicatorProjectTemplateDetail.class); | |||
@@ -317,7 +317,7 @@ public class IndicatorConfigManage { | |||
@Transactional(rollbackFor = Exception.class) | |||
public String projectTemplateCopy(Long templateId) { | |||
UserInfoDetails user = LoginUserUtil.loginUserDetail(); | |||
UserInfoDetails user = LoginUserUtil.userDetail(); | |||
PerformanceIndicatorProjectTemplate projectTemplate = indicatorProjectTemplateService.getById(templateId); | |||
PerformanceIndicatorProjectTemplate newTemplate = new PerformanceIndicatorProjectTemplate(); | |||
BeanUtils.copyProperties(projectTemplate, newTemplate); | |||
@@ -424,7 +424,7 @@ public class IndicatorConfigManage { | |||
} | |||
public String projectIndexSave(PerformanceIndicatorProjectIndexSaveDTO dto) { | |||
UserInfoDetails user = LoginUserUtil.loginUserDetail(); | |||
UserInfoDetails user = LoginUserUtil.userDetail(); | |||
PerformanceAppraisalProjectIndicator projectIndicator = BeanUtil.copyProperties(dto, PerformanceAppraisalProjectIndicator.class); | |||
if (Objects.nonNull(dto.getId())) { | |||
PerformanceAppraisalProjectIndicator old = projectIndicatorService.getById(dto.getId()); | |||
@@ -477,7 +477,7 @@ public class IndicatorConfigManage { | |||
} | |||
public String appIndexSave(PerformanceIndicatorAppIndexSaveDTO dto) { | |||
UserInfoDetails user = LoginUserUtil.loginUserDetail(); | |||
UserInfoDetails user = LoginUserUtil.userDetail(); | |||
PerformanceAppraisalAppIndicator appIndicator = BeanUtil.copyProperties(dto, PerformanceAppraisalAppIndicator.class); | |||
if (Objects.nonNull(dto.getId())) { | |||
PerformanceAppraisalAppIndicator old = appIndicatorService.getById(dto.getId()); | |||
@@ -86,7 +86,7 @@ public class OrgSelfAppraisalManage { | |||
* @return \ | |||
*/ | |||
public PageVo<PerformanceAppraisalVO> list(PerformanceAppraisalListReq req) { | |||
UserInfoDetails user = LoginUserUtil.loginUserDetail(); | |||
UserInfoDetails user = LoginUserUtil.userDetail(); | |||
//当前登录用户 单位code | |||
String mhUnitId = user.getMhUnitIdStr(); | |||
@@ -137,7 +137,7 @@ public class OrgSelfAppraisalManage { | |||
} | |||
public PageVo<PerformanceAppraisalProjectVO> pendingList(Long planId, PerformanceAppraisalListReq req) { | |||
UserInfoDetails user = LoginUserUtil.loginUserDetail(); | |||
UserInfoDetails user = LoginUserUtil.userDetail(); | |||
PerformanceAppraisal plan = performanceAppraisalService.getById(planId); | |||
VUtils.isTrue(Objects.isNull(plan)).throwMessage("该评价计划不存在!"); | |||
@@ -190,7 +190,7 @@ public class OrgSelfAppraisalManage { | |||
* @return | |||
*/ | |||
public PageVo<PerformanceAppraisalProjectVO> appraisaledList(Long planId, PerformanceAppraisalListReq req) { | |||
UserInfoDetails user = LoginUserUtil.loginUserDetail(); | |||
UserInfoDetails user = LoginUserUtil.userDetail(); | |||
PerformanceAppraisal plan = performanceAppraisalService.getById(planId); | |||
VUtils.isTrue(Objects.isNull(plan)).throwMessage("该评价计划不存在!"); | |||
@@ -313,7 +313,7 @@ public class OrgSelfAppraisalManage { | |||
@Transactional(rollbackFor = Exception.class) | |||
public String submitSelfAppraisal(ProjectAppraisalDTO param) { | |||
UserInfoDetails userDetail = LoginUserUtil.loginUserDetail(); | |||
UserInfoDetails userDetail = LoginUserUtil.userDetail(); | |||
Long appraisalId = param.getAppraisalId(); | |||
Long appraisalProjectId = param.getAppraisalProjectId(); | |||
String appraisalProjectCode = param.getAppraisalProjectCode(); | |||
@@ -245,7 +245,7 @@ public class PerformanceAppraisalPlanManage { | |||
*/ | |||
@Transactional | |||
public String create(PerformanceAppraisalCreateDTO createDTO) { | |||
UserInfoDetails user = LoginUserUtil.loginUserDetail(); | |||
UserInfoDetails user = LoginUserUtil.userDetail(); | |||
// 计划名称重复校验 | |||
deduplicationName(createDTO); | |||
PerformanceAppraisal pa = BeanUtil.copyProperties(createDTO, PerformanceAppraisal.class); | |||
@@ -281,7 +281,7 @@ public class PerformanceAppraisalPlanManage { | |||
*/ | |||
@Transactional | |||
public String edit(PerformanceAppraisalEditDTO editDTO) { | |||
UserInfoDetails user = LoginUserUtil.loginUserDetail(); | |||
UserInfoDetails user = LoginUserUtil.userDetail(); | |||
deduplicationName(editDTO); | |||
@@ -729,7 +729,7 @@ public class PerformanceAppraisalPlanManage { | |||
* @return | |||
*/ | |||
public String groupSave(PerformanceAppraisalProjectGroupSaveDTO dto) { | |||
UserInfoDetails user = LoginUserUtil.loginUserDetail(); | |||
UserInfoDetails user = LoginUserUtil.userDetail(); | |||
PerformanceAppraisalProjectGroup group = BeanUtil.copyProperties(dto, PerformanceAppraisalProjectGroup.class); | |||
// 获取当前评价计划内的分组信息 | |||
@@ -78,7 +78,7 @@ public class ReAppraisalManage { | |||
* @return | |||
*/ | |||
public PageVo<PerformanceAppraisalVO> list(PerformanceAppraisalListReq req) { | |||
UserInfoDetails user = LoginUserUtil.loginUserDetail(); | |||
UserInfoDetails user = LoginUserUtil.userDetail(); | |||
String employeeCode = user.getEmployeeCode(); | |||
// 获取当前登录用户的角色列表,只有绩效复评人员才能查看该列表 | |||
List<Role> userRoleList = user.getUserRoleList(); | |||
@@ -170,7 +170,7 @@ public class ReAppraisalManage { | |||
public PageVo<PerformanceAppraisalProjectVO> groupProjectList(Long groupId, PerformanceAppraisalListReq req) { | |||
UserInfoDetails userDetail = LoginUserUtil.loginUserDetail(); | |||
UserInfoDetails userDetail = LoginUserUtil.userDetail(); | |||
String employeeCode = userDetail.getEmployeeCode(); | |||
// 获取分组内的项目信息 | |||
@@ -227,7 +227,7 @@ public class ReAppraisalManage { | |||
@Transactional(rollbackFor = Exception.class) | |||
public String submitReAppraisal(ProjectAppraisalDTO param) { | |||
UserInfoDetails userDetail = LoginUserUtil.loginUserDetail(); | |||
UserInfoDetails userDetail = LoginUserUtil.userDetail(); | |||
String userIdStr = String.valueOf(userDetail.getMhUserId()); | |||
String username = userDetail.getUsername(); | |||
Long appraisalId = param.getAppraisalId(); | |||
@@ -68,7 +68,7 @@ public class RectifyAuditManage { | |||
* @return | |||
*/ | |||
public PageVo<PerformanceAppraisalVO> list(PerformanceAppraisalListReq req) { | |||
UserInfoDetails user = LoginUserUtil.loginUserDetail(); | |||
UserInfoDetails user = LoginUserUtil.userDetail(); | |||
// 当前登录用户 单位code | |||
String employeeCode = user.getEmployeeCode(); | |||
@@ -154,7 +154,7 @@ public class RectifyAuditManage { | |||
} | |||
public PageVo<PerformanceAppraisalProjectVO> unAuditList(Long planId, PerformanceAppraisalListReq req) { | |||
UserInfoDetails user = LoginUserUtil.loginUserDetail(); | |||
UserInfoDetails user = LoginUserUtil.userDetail(); | |||
String employeeCode = user.getEmployeeCode(); | |||
PerformanceAppraisal plan = performanceAppraisalService.getById(planId); | |||
@@ -222,7 +222,7 @@ public class RectifyAuditManage { | |||
} | |||
public PageVo<PerformanceAppraisalProjectVO> auditedList(Long planId, PerformanceAppraisalListReq req) { | |||
UserInfoDetails user = LoginUserUtil.loginUserDetail(); | |||
UserInfoDetails user = LoginUserUtil.userDetail(); | |||
String employeeCode = user.getEmployeeCode(); | |||
PerformanceAppraisal plan = performanceAppraisalService.getById(planId); | |||
@@ -294,7 +294,7 @@ public class RectifyAuditManage { | |||
@Transactional(rollbackFor = Exception.class) | |||
public String submit(ProjectAppraisalDTO param) { | |||
UserInfoDetails userDetail = LoginUserUtil.loginUserDetail(); | |||
UserInfoDetails userDetail = LoginUserUtil.userDetail(); | |||
String userIdStr = String.valueOf(userDetail.getUserId()); | |||
String username = userDetail.getUsername(); | |||
Long appraisalId = param.getAppraisalId(); | |||
@@ -70,7 +70,7 @@ public class RectifyManage { | |||
* @return | |||
*/ | |||
public PageVo<PerformanceAppraisalVO> list(PerformanceAppraisalListReq req) { | |||
UserInfoDetails user = LoginUserUtil.loginUserDetail(); | |||
UserInfoDetails user = LoginUserUtil.userDetail(); | |||
// 当前登录用户 单位code | |||
String mhUnitId = user.getMhUnitIdStr(); | |||
@@ -138,7 +138,7 @@ public class RectifyManage { | |||
} | |||
public PageVo<PerformanceAppraisalProjectVO> unRectifyList(Long planId, PerformanceAppraisalListReq req) { | |||
UserInfoDetails user = LoginUserUtil.loginUserDetail(); | |||
UserInfoDetails user = LoginUserUtil.userDetail(); | |||
PerformanceAppraisal plan = performanceAppraisalService.getById(planId); | |||
VUtils.isTrue(Objects.isNull(plan)).throwMessage("该评价计划不存在!"); | |||
@@ -189,7 +189,7 @@ public class RectifyManage { | |||
} | |||
public PageVo<PerformanceAppraisalProjectVO> rectifiedList(Long planId, PerformanceAppraisalListReq req) { | |||
UserInfoDetails user = LoginUserUtil.loginUserDetail(); | |||
UserInfoDetails user = LoginUserUtil.userDetail(); | |||
PerformanceAppraisal plan = performanceAppraisalService.getById(planId); | |||
Assert.notNull(plan, "该评价计划不存在!"); | |||
@@ -265,7 +265,7 @@ public class RectifyManage { | |||
@Transactional(rollbackFor = Exception.class) | |||
public String fillOutResult(ProjectAppraisalDTO param) { | |||
UserInfoDetails userDetail = LoginUserUtil.loginUserDetail(); | |||
UserInfoDetails userDetail = LoginUserUtil.userDetail(); | |||
String userIdStr = String.valueOf(userDetail.getUserId()); | |||
String username = userDetail.getUsername(); | |||
@@ -5,7 +5,6 @@ import cn.hutool.core.collection.CollUtil; | |||
import cn.hutool.core.lang.Assert; | |||
import cn.hutool.core.map.MapUtil; | |||
import cn.hutool.core.util.CharsetUtil; | |||
import cn.hutool.core.util.NumberUtil; | |||
import com.alibaba.excel.EasyExcel; | |||
import com.alibaba.excel.write.builder.ExcelWriterBuilder; | |||
import com.baomidou.mybatisplus.core.conditions.Wrapper; | |||
@@ -85,7 +84,7 @@ public class VerifyManage { | |||
* @return \ | |||
*/ | |||
public PageVo<PerformanceAppraisalVO> list(PerformanceAppraisalListReq req) { | |||
UserInfoDetails user = LoginUserUtil.loginUserDetail(); | |||
UserInfoDetails user = LoginUserUtil.userDetail(); | |||
String employeeCode = user.getEmployeeCode(); | |||
// 获取当前登录用户的角色列表,只有专家核查人员才能查看该列表 | |||
List<Role> userRoleList = user.getUserRoleList(); | |||
@@ -167,7 +166,7 @@ public class VerifyManage { | |||
public PageVo<PerformanceAppraisalProjectVO> groupProjectList(Long groupId, PerformanceAppraisalListReq req) { | |||
UserInfoDetails userDetail = LoginUserUtil.loginUserDetail(); | |||
UserInfoDetails userDetail = LoginUserUtil.userDetail(); | |||
String userIdStr = userDetail.getUserIdStr(); | |||
// 获取分组内的项目信息 | |||
@@ -224,7 +223,7 @@ public class VerifyManage { | |||
@Transactional(rollbackFor = Exception.class) | |||
public String submitVerify(ProjectAppraisalDTO param) { | |||
UserInfoDetails userDetail = LoginUserUtil.loginUserDetail(); | |||
UserInfoDetails userDetail = LoginUserUtil.userDetail(); | |||
String userIdStr = String.valueOf(userDetail.getUserId()); | |||
String username = userDetail.getUsername(); | |||
Long appraisalId = param.getAppraisalId(); | |||
@@ -69,7 +69,7 @@ public class TagManage { | |||
LambdaQueryWrapper<Tag> query = Wrappers.lambdaQuery(Tag.class) | |||
.like(StrUtils.isNotBlank(req.getName()), Tag::getName, req.getName()) | |||
.orderByDesc(Tag::getUpdateOn); | |||
checkAuth(query, LoginUserUtil.loginUserDetail()); | |||
checkAuth(query, LoginUserUtil.userDetail()); | |||
Page<Tag> page = tagService.page(req.page(), query); | |||
if (page.getTotal() == 0) { | |||
return PageVo.empty(); | |||
@@ -103,7 +103,7 @@ public class TagManage { | |||
*/ | |||
public String save(TagDTO dto) { | |||
deduplicationName(dto); | |||
UserInfoDetails user = LoginUserUtil.loginUserDetail(); | |||
UserInfoDetails user = LoginUserUtil.userDetail(); | |||
Tag entity = BeanUtil.copyProperties(dto, Tag.class); | |||
if (Objects.nonNull(dto.getId())) { | |||
Tag old = tagService.getById(dto.getId()); | |||
@@ -140,7 +140,7 @@ public class TagManage { | |||
if (CollUtil.isEmpty(dtos)) { | |||
return "参入的标签为空"; | |||
} | |||
UserInfoDetails user = LoginUserUtil.loginUserDetail(); | |||
UserInfoDetails user = LoginUserUtil.userDetail(); | |||
String projectCode = dtos.get(0).getProjectCode(); | |||
Project project = projectService.getProjectByCode(projectCode); | |||
GovBizProjectBaseinfo baseinfo = baseinfoService.getOne(Wrappers.lambdaQuery(GovBizProjectBaseinfo.class) | |||
@@ -120,7 +120,7 @@ public class ConstructionManage { | |||
* @return \ | |||
*/ | |||
public PageVo<ProjectLibListItemVO> projectLibList(ProjectListReq req) { | |||
UserInfoDetails user = LoginUserUtil.loginUserDetail(); | |||
UserInfoDetails user = LoginUserUtil.userDetail(); | |||
LambdaQueryWrapper<Project> query = ProjectManageUtil.projectQuery(req); | |||
//建设中状态 | |||
query.isNull(Project::getContractAmount); | |||
@@ -302,7 +302,7 @@ public class ConstructionManage { | |||
} | |||
public FirstAcceptProgressStatisticsVO firstAcceptProgressStatistics(ProjectListReq req) { | |||
UserInfoDetails user = LoginUserUtil.loginUserDetail(); | |||
UserInfoDetails user = LoginUserUtil.userDetail(); | |||
Long buildOrgCode = req.clearBuildOrgCode(); | |||
UnitQueryState queryState = mhUnitQueryAuthHelper.listCanViewUnitIds(buildOrgCode, user); | |||
if (!queryState.isState()) { | |||
@@ -359,7 +359,7 @@ public class ConstructionManage { | |||
* @return | |||
*/ | |||
public PageVo<ProjectLibListItemVO> preProjectList(ProjectListReq req) { | |||
UserInfoDetails user = LoginUserUtil.loginUserDetail(); | |||
UserInfoDetails user = LoginUserUtil.userDetail(); | |||
Long buildOrgCode = req.clearBuildOrgCode(); | |||
UnitQueryState queryState = mhUnitQueryAuthHelper.listCanViewUnitIds(buildOrgCode, user); | |||
if (!queryState.isState()) { | |||
@@ -558,7 +558,7 @@ public class ConstructionManage { | |||
@Transactional(rollbackFor = Exception.class) | |||
public synchronized void submitFirstInspectedFiles(PreInsSaveDTO req) { | |||
UserInfoDetails user = LoginUserUtil.loginUserDetail(); | |||
UserInfoDetails user = LoginUserUtil.userDetail(); | |||
Purchase purchase = purchaseService.getById(req.getBidId()); | |||
if (!TenderMainStatus.TO_BE_SUBMIT_FIRST_INSPECTED_INFO.eq(purchase.getStatus())) { | |||
throw BizException.wrap("该标段无法上传初验材料"); | |||
@@ -613,7 +613,7 @@ public class ConstructionManage { | |||
throw BizException.wrap("该标段不支持提交信创符合性申请"); | |||
} | |||
UserInfoDetails user = LoginUserUtil.loginUserDetail(); | |||
UserInfoDetails user = LoginUserUtil.userDetail(); | |||
WflowModels model = processModelManage.getWflowModelsNoNull(ProjectProcessType.XC_APPROVAL_PROCESS, | |||
user.getMhUnitId()); | |||
@@ -668,7 +668,7 @@ public class ConstructionManage { | |||
VUtils.isTrue(CollUtil.isNotEmpty(tasks)).throwMessage("此信创符合性已经发起过审核 并且还没审核完!"); | |||
} | |||
UserInfoDetails user = LoginUserUtil.loginUserDetail(); | |||
UserInfoDetails user = LoginUserUtil.userDetail(); | |||
WflowModels model = processModelManage.getWflowModelsNoNull(ProjectProcessType.XC_APPROVAL_PROCESS, | |||
user.getMhUnitId()); | |||
@@ -105,7 +105,7 @@ public class DeclaredProjectManage { | |||
*/ | |||
@Transactional(rollbackFor = Exception.class) | |||
public synchronized void store(DefaultDeclaredDTO req) { | |||
UserInfoDetails user = LoginUserUtil.loginUserDetail(); | |||
UserInfoDetails user = LoginUserUtil.userDetail(); | |||
ProjectDTO reqProj = req.getProjectInfo(); | |||
reqProj.setBuildOrgCode(user.getMhUnitIdStr()); | |||
reqProj.setBuildOrgName(user.getMhUnitName()); | |||
@@ -134,7 +134,7 @@ public class DeclaredProjectManage { | |||
*/ | |||
@Transactional(rollbackFor = Exception.class) | |||
public synchronized String startTheProcess(DefaultDeclaredDTO req) { | |||
UserInfoDetails user = LoginUserUtil.loginUserDetail(); | |||
UserInfoDetails user = LoginUserUtil.userDetail(); | |||
WflowModels model = processModelManage.getWflowModelsNoNull(ProjectProcessType.COMPLIANCE_REVIEW, | |||
user.getMhUnitId()); | |||
@@ -202,7 +202,7 @@ public class DeclaredProjectManage { | |||
public synchronized String reStartTheProcess(DefaultDeclaredDTO req) { | |||
ProjectDTO reqProj = req.getProjectInfo(); | |||
Assert.notNull(reqProj.getId(), "提交失败,缺少项目ID!"); | |||
UserInfoDetails user = LoginUserUtil.loginUserDetail(); | |||
UserInfoDetails user = LoginUserUtil.userDetail(); | |||
reqProj.setBuildOrgCode(user.getMhUnitIdStr()); | |||
reqProj.setBuildOrgName(user.getMhUnitName()); | |||
@@ -319,7 +319,7 @@ public class DeclaredProjectManage { | |||
* @return \ | |||
*/ | |||
public synchronized Long saveToDraft(ProjectDraftSaveDTO dto, ProjectDraftTypeEnum draftType) { | |||
UserInfoDetails user = LoginUserUtil.loginUserDetail(); | |||
UserInfoDetails user = LoginUserUtil.userDetail(); | |||
ProjectDTO projectInfo = dto.getProjectInfo(); | |||
ProjectDraft draft = new ProjectDraft(); | |||
@@ -4,24 +4,19 @@ import cn.hutool.core.bean.BeanUtil; | |||
import cn.hutool.core.collection.CollUtil; | |||
import com.alibaba.excel.EasyExcel; | |||
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; | |||
import com.hz.pm.api.common.enumeration.ProjectProcessType; | |||
import com.hz.pm.api.common.helper.UserInfoHelper; | |||
import com.hz.pm.api.common.model.constant.BizConst; | |||
import com.hz.pm.api.common.util.ExcelDownUtil; | |||
import com.hz.pm.api.common.util.ExcelExportStyle; | |||
import com.hz.pm.api.projectdeclared.model.dto.DeclaredProjectExportDTO; | |||
import com.hz.pm.api.projectdeclared.model.dto.DelayedApplyDTO; | |||
import com.hz.pm.api.projectdeclared.model.vo.DelayedApplyVO; | |||
import com.hz.pm.api.projectlib.helper.ProjectManageUtil; | |||
import com.hz.pm.api.projectlib.manage.ProjectLibManage; | |||
import com.hz.pm.api.projectlib.model.entity.Project; | |||
import com.hz.pm.api.projectlib.model.entity.ProjectDelayApply; | |||
import com.hz.pm.api.projectlib.model.entity.ProjectInst; | |||
import com.hz.pm.api.projectlib.model.enumeration.InstTypeEnum; | |||
import com.hz.pm.api.projectlib.model.enumeration.ProjectTypeNewEnum; | |||
import com.hz.pm.api.projectlib.model.enumeration.status.ProjectStatus; | |||
import com.hz.pm.api.projectlib.model.req.ProjectListReq; | |||
@@ -29,10 +24,8 @@ import com.hz.pm.api.projectlib.model.vo.ProjectLibListItemVO; | |||
import com.hz.pm.api.projectlib.service.INdProjectDelayApplyService; | |||
import com.hz.pm.api.projectlib.service.IProjectInstService; | |||
import com.hz.pm.api.projectlib.service.IProjectService; | |||
import com.hz.pm.api.staging.enums.MsgTypeEnum; | |||
import com.hz.pm.api.sys.manage.NoticeManage; | |||
import com.hz.pm.api.sys.manage.ProcessModelManage; | |||
import com.hz.pm.api.todocenter.constant.WorkNoticeConst; | |||
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; | |||
@@ -41,26 +34,19 @@ 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.wflow.bean.entity.WflowModels; | |||
import com.wflow.contants.HisProInsEndActId; | |||
import com.wflow.workflow.bean.dto.OrgInfoDTO; | |||
import com.wflow.workflow.bean.vo.ProcessStartParamsVo; | |||
import com.wflow.workflow.service.ProcessInstanceService; | |||
import lombok.RequiredArgsConstructor; | |||
import lombok.extern.slf4j.Slf4j; | |||
import org.apache.commons.lang3.StringUtils; | |||
import org.flowable.engine.HistoryService; | |||
import org.flowable.engine.history.HistoricProcessInstance; | |||
import org.springframework.beans.BeanUtils; | |||
import org.springframework.stereotype.Component; | |||
import org.springframework.transaction.annotation.Transactional; | |||
import javax.servlet.http.HttpServletResponse; | |||
import java.io.IOException; | |||
import java.time.LocalDateTime; | |||
import java.util.Collections; | |||
import java.util.List; | |||
import java.util.Map; | |||
import java.util.Objects; | |||
import java.util.concurrent.atomic.AtomicInteger; | |||
import java.util.stream.Collectors; | |||
@@ -95,7 +81,7 @@ public class DelayedApplyManage { | |||
* @return | |||
*/ | |||
public PageVo<ProjectLibListItemVO> projectLibList(ProjectListReq req) { | |||
UserInfoDetails user = LoginUserUtil.loginUserDetail(); | |||
UserInfoDetails user = LoginUserUtil.userDetail(); | |||
LambdaQueryWrapper<Project> query = ProjectManageUtil.projectQuery(req); | |||
// 待终验 并且已经过期 | |||
// 只能看自己单位的 | |||
@@ -111,7 +111,7 @@ public class FinalAcceptanceManage { | |||
* @return \ | |||
*/ | |||
public FinalAcceptProgressStatisticsVO finalAcceptProgressStatistics(ProjectListReq req) { | |||
UserInfoDetails user = LoginUserUtil.loginUserDetail(); | |||
UserInfoDetails user = LoginUserUtil.userDetail(); | |||
Long buildOrgCode = req.clearBuildOrgCode(); | |||
UnitQueryState queryState = mhUnitQueryAuthHelper.listCanViewUnitIds(buildOrgCode, user); | |||
if (!queryState.isState()) { | |||
@@ -157,7 +157,7 @@ public class FinalAcceptanceManage { | |||
* @return \ | |||
*/ | |||
public PageVo<ProjectLibListItemVO> projectLibList(ProjectListReq req) { | |||
UserInfoDetails user = LoginUserUtil.loginUserDetail(); | |||
UserInfoDetails user = LoginUserUtil.userDetail(); | |||
Long buildOrgCode = req.clearBuildOrgCode(); | |||
UnitQueryState queryState = mhUnitQueryAuthHelper.listCanViewUnitIds(buildOrgCode, user); | |||
if (!queryState.isState()) { | |||
@@ -300,7 +300,7 @@ public class FinalAcceptanceManage { | |||
*/ | |||
@Transactional(rollbackFor = Exception.class) | |||
public synchronized String startProcess(SubmitFinallyInspectedReq req) { | |||
UserInfoDetails user = LoginUserUtil.loginUserDetail(); | |||
UserInfoDetails user = LoginUserUtil.userDetail(); | |||
ProjectProcessType instType = ProjectProcessType.ACCEPTANCE_DECLARATION_APPROVAL_PROCESS; | |||
WflowModels model = processModelManage.getWflowModelsNoNull(instType, user.getMhUnitId()); | |||
@@ -75,7 +75,7 @@ public class OperationManage { | |||
@Transactional(rollbackFor = Exception.class) | |||
public synchronized String pushOperation(OperationReq req) { | |||
UserInfoDetails user = LoginUserUtil.loginUserDetail(); | |||
UserInfoDetails user = LoginUserUtil.userDetail(); | |||
List<Purchase> purchases = purchaseService.listByProjectId(req.getProjectId()); | |||
Map<Long, Purchase> purchaseMap = CollUtils.listToMap(purchases, Purchase::getId); | |||
Purchase purchase = purchaseMap.get(req.getBidId()); | |||
@@ -1,6 +1,8 @@ | |||
package com.hz.pm.api.projectdeclared.manage; | |||
import cn.hutool.core.bean.BeanUtil; | |||
import cn.hutool.core.collection.CollUtil; | |||
import cn.hutool.core.util.StrUtil; | |||
import cn.hutool.extra.spring.SpringUtil; | |||
import com.baomidou.mybatisplus.core.conditions.Wrapper; | |||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |||
@@ -94,7 +96,7 @@ public class ProjectReviewManage { | |||
throw BizException.wrap("该项目不允许申请项目评审"); | |||
} | |||
UserInfoDetails user = LoginUserUtil.loginUserDetail(); | |||
UserInfoDetails user = LoginUserUtil.userDetail(); | |||
WflowModels model = processModelManage.getWflowModelsNoNull(ProjectProcessType.PROJECT_REVIEW, | |||
user.getMhUnitId()); | |||
@@ -233,7 +235,7 @@ public class ProjectReviewManage { | |||
.ne(Project::getStage, ProjectStatus.STOPPED.getCode()) | |||
.ne(Project::getStatus, ProjectStatus.CHANGE_APPLY_PASSED.getCode()) | |||
.eq(Project::getNewest, Boolean.TRUE) | |||
.select(Project::getStatus, Project::getId); | |||
.select(Project::getStatus, Project::getId, Project::getConstructionPlanSealFile); | |||
List<Project> projects = projectService.list(query); | |||
Map<ProjectStatus, Long> countMap = CollUtils.groupCount(projects, w -> { | |||
if (!ProjectStatus.EXPERT_REVIEW_FAILED.eq(w.getStatus()) | |||
@@ -247,6 +249,7 @@ public class ProjectReviewManage { | |||
}); | |||
return ReviewProgressStatisticsVO.builder() | |||
.totalCount(projects.size()) | |||
.withoutConstructionPlanSealFileCount(CollUtil.count(projects, w -> StrUtil.isNotBlank(w.getConstructionPlanSealFile()))) | |||
.todoCount(countMap.getOrDefault(ProjectStatus.WITHOUT_EXPERT_REVIEW, 0L)) | |||
.auditCount(countMap.getOrDefault(ProjectStatus.ON_EXPERT_REVIEW, 0L)) | |||
.passedCount(countMap.getOrDefault(ProjectStatus.EXPERT_REVIEW_PASSED, 0L)) | |||
@@ -141,7 +141,7 @@ public class PurchaseManage { | |||
private final StagingManage stagingManage; | |||
public PurchaseProgressStatVO purchaseProgressStatistics(ProjectListReq req) { | |||
UserInfoDetails user = LoginUserUtil.loginUserDetail(); | |||
UserInfoDetails user = LoginUserUtil.userDetail(); | |||
Long buildOrgCode = req.clearBuildOrgCode(); | |||
LambdaQueryWrapper<Project> query = ProjectManageUtil.projectQuery(req); | |||
//数据权限 | |||
@@ -182,7 +182,7 @@ public class PurchaseManage { | |||
* @return \ | |||
*/ | |||
public PageVo<ProjectLibListItemVO> projectLibList(ProjectListReq req) { | |||
UserInfoDetails user = LoginUserUtil.loginUserDetail(); | |||
UserInfoDetails user = LoginUserUtil.userDetail(); | |||
Assert.notNull(user, "获取登录用户失败!"); | |||
Long buildOrgCode = req.clearBuildOrgCode(); | |||
LambdaQueryWrapper<Project> query = ProjectManageUtil.projectQuery(req); | |||
@@ -409,7 +409,7 @@ public class PurchaseManage { | |||
@Transactional(rollbackFor = Exception.class) | |||
public synchronized void submitPurchaseNotice(SubmitPurchaseNoticeReq req) { | |||
UserInfoDetails user = LoginUserUtil.loginUserDetail(); | |||
UserInfoDetails user = LoginUserUtil.userDetail(); | |||
Long projectId = req.getProjectId(); | |||
Project project = projectService.getNewestNoNull(projectId); | |||
@@ -480,7 +480,7 @@ public class PurchaseManage { | |||
@Transactional(rollbackFor = Exception.class) | |||
public synchronized void appendPurchaseNotice(SubmitPurchaseNoticeReq req) { | |||
UserInfoDetails user = LoginUserUtil.loginUserDetail(); | |||
UserInfoDetails user = LoginUserUtil.userDetail(); | |||
Long projectId = req.getProjectId(); | |||
long purchaseCount = purchaseService.countByProjectId(projectId); | |||
if (purchaseCount == 0) { | |||
@@ -614,7 +614,7 @@ public class PurchaseManage { | |||
tenderStateMachineUtil.pass(purchase); | |||
purchaseService.saveOrUpdate(purchase); | |||
UserInfoDetails user = LoginUserUtil.loginUserDetail(); | |||
UserInfoDetails user = LoginUserUtil.userDetail(); | |||
Long projectId = req.getProjectId(); | |||
Project project = projectService.getNewestNoNull(projectId); | |||
LocalDateTime now = LocalDateTime.now(); | |||
@@ -851,7 +851,7 @@ public class PurchaseManage { | |||
throw BizException.wrap("该状态下不支持提交测试验证信息"); | |||
} | |||
}); | |||
UserInfoDetails user = LoginUserUtil.loginUserDetail(); | |||
UserInfoDetails user = LoginUserUtil.userDetail(); | |||
ProjectProcessType instType = ProjectProcessType.TEST_VALID; | |||
WflowModels model = processModelManage.getWflowModelsNoNull(instType, user.getMhUnitId()); | |||
LocalDateTime now = LocalDateTime.now(); | |||
@@ -916,7 +916,7 @@ public class PurchaseManage { | |||
throw BizException.wrap("该状态下不支持提交系统自测信息"); | |||
} | |||
} | |||
UserInfoDetails user = LoginUserUtil.loginUserDetail(); | |||
UserInfoDetails user = LoginUserUtil.userDetail(); | |||
ProjectProcessType instType = ProjectProcessType.SELF_TEST; | |||
WflowModels model = processModelManage.getWflowModelsNoNull(instType, user.getMhUnitId()); | |||
@@ -964,7 +964,7 @@ public class PurchaseManage { | |||
throw BizException.wrap("该状态下不支持提交适配改造信息"); | |||
} | |||
} | |||
UserInfoDetails user = LoginUserUtil.loginUserDetail(); | |||
UserInfoDetails user = LoginUserUtil.userDetail(); | |||
ProjectProcessType instType = ProjectProcessType.ADAPTION; | |||
WflowModels model = processModelManage.getWflowModelsNoNull(instType, user.getMhUnitId()); | |||
Long projectId = purchases.get(0).getProjectId(); | |||
@@ -18,6 +18,8 @@ public class ReviewProgressStatisticsVO { | |||
@ApiModelProperty("总数") | |||
private Integer totalCount; | |||
@ApiModelProperty("未上传建设方案盖章件的文件") | |||
private Integer withoutConstructionPlanSealFileCount; | |||
@ApiModelProperty("待提交") | |||
private Long todoCount; | |||
@ApiModelProperty("审核中") | |||
@@ -0,0 +1,31 @@ | |||
package com.hz.pm.api.projectlib.controller; | |||
import com.hz.pm.api.projectlib.manage.ProjectManageTodoCountManage; | |||
import com.hz.pm.api.projectlib.model.vo.ProjectManageTodoCountVO; | |||
import lombok.RequiredArgsConstructor; | |||
import org.springframework.web.bind.annotation.GetMapping; | |||
import org.springframework.web.bind.annotation.RequestMapping; | |||
import org.springframework.web.bind.annotation.RestController; | |||
/** | |||
* <p> | |||
* ProjectManageTodoCountController | |||
* </p> | |||
* | |||
* @author WendyYang | |||
* @since 12:44 2024/10/31 | |||
*/ | |||
@RestController | |||
@RequiredArgsConstructor | |||
@RequestMapping("/api/v1/projectManage") | |||
public class ProjectManageController { | |||
private final ProjectManageTodoCountManage projectManageTodoCountManage; | |||
@GetMapping("/allTodoCount") | |||
public ProjectManageTodoCountVO allTodoCount() { | |||
return projectManageTodoCountManage.allTodoCount(); | |||
} | |||
} | |||
@@ -99,7 +99,7 @@ public class ProjectSaveHelper { | |||
} | |||
public void saveApplication(ProjectDTO projectDto, Project project, Boolean isConstruct) { | |||
UserInfoDetails user = LoginUserUtil.loginUserDetail(); | |||
UserInfoDetails user = LoginUserUtil.userDetail(); | |||
//保存项目应用 | |||
boolean isApp = Objects.nonNull(projectDto.getIncludeApplication()) && CommonEnum.YES.getCode().equals(projectDto.getIncludeApplication()) | |||
? Boolean.TRUE : Boolean.FALSE; | |||
@@ -294,7 +294,7 @@ public class DeclaredRecordManage { | |||
@Transactional(rollbackFor = Exception.class) | |||
public synchronized void startDeclaredRecord(DefaultDeclaredDTO req) { | |||
ProjectDTO reqProj = req.getProjectInfo(); | |||
UserInfoDetails user = LoginUserUtil.loginUserDetail(); | |||
UserInfoDetails user = LoginUserUtil.userDetail(); | |||
reqProj.setBuildOrgCode(user.getMhUnitIdStr()); | |||
reqProj.setBuildOrgName(user.getMhUnitName()); | |||
@@ -360,7 +360,7 @@ public class DeclaredRecordManage { | |||
@Transactional(rollbackFor = Exception.class) | |||
public synchronized void restartDeclaredRecord(DefaultDeclaredDTO req) { | |||
UserInfoDetails user = LoginUserUtil.loginUserDetail(); | |||
UserInfoDetails user = LoginUserUtil.userDetail(); | |||
ProjectDTO reqProj = req.getProjectInfo(); | |||
Assert.notNull(reqProj.getId(), "提交失败,缺少项目ID!"); | |||
reqProj.setBuildOrgCode(user.getMhUnitIdStr()); | |||
@@ -181,8 +181,12 @@ public class MhSystemReplaceManage { | |||
BizUtils.notEmpty(state.getUnitIds(), w -> query.in(MhSystemReplaceInfo::getBuildOrgCode, w)); | |||
query.notExists("select 1 from qx_project_system_replace_infos_relation qpr " + | |||
"where qpr.source_system_id = mh_system_replace_info.id"); | |||
String includeProjectCodeSql = ""; | |||
if (StrUtil.isNotBlank(req.getIncludeProjectCode())) { | |||
includeProjectCodeSql += " and npr.project_code != '" + req.getIncludeProjectCode() + "'"; | |||
} | |||
query.notExists("select 1 from nd_project_gov_system_replace_infos npr " + | |||
"where npr.source_system_id = mh_system_replace_info.id"); | |||
"where npr.source_system_id = mh_system_replace_info.id" + includeProjectCodeSql); | |||
List<MhSystemReplaceInfo> page = mhSystemReplaceInfoService.list(query); | |||
return BeanUtil.copyToList(page, MhSystemReplaceInfoVO.class); | |||
} | |||
@@ -94,7 +94,7 @@ public class ProjectChangeManage { | |||
throw ReturnException.wrap("暂无法提交变更申请"); | |||
} | |||
// 采购信息变更比较 | |||
UserInfoDetails userDetail = LoginUserUtil.loginUserDetail(); | |||
UserInfoDetails userDetail = LoginUserUtil.userDetail(); | |||
WflowModels wflowModels = processModelManage.getWflowModelsNoNull(ProjectProcessType.PROJECT_CHANGE, userDetail.getMhUnitId()); | |||
@@ -195,7 +195,7 @@ public class ProjectChangeManage { | |||
if (changeFieldsCount == 0) { | |||
throw BizException.wrap("项目内容无修改"); | |||
} | |||
UserInfoDetails userDetail = LoginUserUtil.loginUserDetail(); | |||
UserInfoDetails userDetail = LoginUserUtil.userDetail(); | |||
WflowModels wflowModels = processModelManage.getWflowModelsNoNull(ProjectProcessType.PROJECT_CHANGE, userDetail.getMhUnitId()); | |||
@@ -52,7 +52,7 @@ public class ProjectCollectionManage { | |||
* @return | |||
*/ | |||
public PageVo<ProjectCollectionVO> list(ProjectListReq req) { | |||
UserInfoDetails user = LoginUserUtil.loginUserDetail(); | |||
UserInfoDetails user = LoginUserUtil.userDetail(); | |||
String buildOrgCode = req.getBuildOrgCode(); | |||
//如果是超管 可以看所有 | |||
if (user.hasSuperAdmin()) { | |||
@@ -101,7 +101,7 @@ public class ProjectCollectionManage { | |||
* @return | |||
*/ | |||
public String save(ProjectCollectionSaveDTO dto) { | |||
UserInfoDetails user = LoginUserUtil.loginUserDetail(); | |||
UserInfoDetails user = LoginUserUtil.userDetail(); | |||
ProjectCollection projectCollection = BeanUtil.copyProperties(dto, ProjectCollection.class); | |||
if (Objects.nonNull(dto.getId())) { | |||
@@ -0,0 +1,111 @@ | |||
package com.hz.pm.api.projectlib.manage; | |||
import com.hz.pm.api.common.util.ThreadPoolUtil; | |||
import com.hz.pm.api.projectdeclared.manage.*; | |||
import com.hz.pm.api.projectdeclared.model.req.PurchaseAdaptionListReq; | |||
import com.hz.pm.api.projectdeclared.model.vo.*; | |||
import com.hz.pm.api.projectlib.model.req.DeclaredProjectListReq; | |||
import com.hz.pm.api.projectlib.model.req.ProjectListReq; | |||
import com.hz.pm.api.projectlib.model.vo.AmountApprovalProgressStatisticsVO; | |||
import com.hz.pm.api.projectlib.model.vo.AnnualPlanProgressStatisticsVO; | |||
import com.hz.pm.api.projectlib.model.vo.DeclaredRecordProgressStatVO; | |||
import com.hz.pm.api.projectlib.model.vo.ProjectManageTodoCountVO; | |||
import com.hz.pm.api.user.util.LoginUserUtil; | |||
import lombok.RequiredArgsConstructor; | |||
import lombok.extern.slf4j.Slf4j; | |||
import org.springframework.stereotype.Component; | |||
import java.util.ArrayList; | |||
import java.util.Arrays; | |||
import java.util.List; | |||
import java.util.Objects; | |||
import java.util.concurrent.CompletableFuture; | |||
import java.util.function.Function; | |||
/** | |||
* <p> | |||
* ProjectTodoCountManage | |||
* </p> | |||
* | |||
* @author WendyYang | |||
* @since 10:51 2024/10/31 | |||
*/ | |||
@Slf4j | |||
@Component | |||
@RequiredArgsConstructor | |||
public class ProjectManageTodoCountManage { | |||
private final DeclaredProjectManage declaredProjectManage; | |||
private final AnnualPlanLibManage annualPlanLibManage; | |||
private final AmountApprovalManage amountApprovalManage; | |||
private final DeclaredRecordManage declaredRecordManage; | |||
private final PurchaseManage purchaseManage; | |||
private final ConstructionManage constructionManage; | |||
private final FinalAcceptanceManage finalAcceptanceManage; | |||
private final ProjectReviewManage projectReviewManage; | |||
public ProjectManageTodoCountVO allTodoCount() { | |||
ProjectManageTodoCountVO todoCount = new ProjectManageTodoCountVO(); | |||
List<CompletableFuture<Void>> futures = new ArrayList<>(); | |||
futures.add(CompletableFuture.runAsync(() -> { | |||
// 项目申报 | |||
DeclaredProgressStatisticsVO declaredStat = declaredProjectManage.declaredProgressStatistics(new ProjectListReq()); | |||
todoCount.setProjectDeclare(sum(declaredStat, DeclaredProgressStatisticsVO::getTodoCount, | |||
DeclaredProgressStatisticsVO::getFailedCount)); | |||
// 专家评审 | |||
ReviewProgressStatisticsVO expertReviewStat = projectReviewManage.expertReviewProjectProgressStatistics(new ProjectListReq()); | |||
todoCount.setExpertReview(sum(expertReviewStat, ReviewProgressStatisticsVO::getWithoutConstructionPlanSealFileCount)); | |||
// 项目复核 | |||
ReviewProgressStatisticsVO projectReviewStat = projectReviewManage.reviewProjectProgressStatistics(new ProjectListReq()); | |||
todoCount.setProjectReview(sum(projectReviewStat, ReviewProgressStatisticsVO::getTodoCount, | |||
ReviewProgressStatisticsVO::getFailedCount)); | |||
}, ThreadPoolUtil.REQUEST)); | |||
futures.add(CompletableFuture.runAsync(() -> { | |||
// 年度计划 | |||
AnnualPlanProgressStatisticsVO annualStat = annualPlanLibManage.annualProgressStatistics(new ProjectListReq()); | |||
todoCount.setAnnualPlan(sum(annualStat, AnnualPlanProgressStatisticsVO::getNotOpenAnnualPlanCount)); | |||
// 资金下达 | |||
AmountApprovalProgressStatisticsVO amountApprovalStat = amountApprovalManage.progressStatistics(new ProjectListReq()); | |||
todoCount.setAmountApproval(sum(amountApprovalStat, AmountApprovalProgressStatisticsVO::getUnApprovalCount)); | |||
// 立项备案 | |||
DeclaredRecordProgressStatVO recordStat = declaredRecordManage.declaredRecordProgressStatistics(new DeclaredProjectListReq()); | |||
todoCount.setProjectRecord(sum(recordStat, DeclaredRecordProgressStatVO::getTodoCount, | |||
DeclaredRecordProgressStatVO::getFailedCount)); | |||
}, ThreadPoolUtil.REQUEST)); | |||
futures.add(CompletableFuture.runAsync(() -> { | |||
// 招标采购 | |||
PurchaseProgressStatVO purchaseStat = purchaseManage.purchaseProgressStatistics(new ProjectListReq()); | |||
todoCount.setProjectPurchase(sum(purchaseStat, PurchaseProgressStatVO::getToBePurchaseCount)); | |||
// 适配改造 | |||
AdaptionProgressStatVO adaptionStat = purchaseManage.adaptionProgressStatistics(new PurchaseAdaptionListReq()); | |||
todoCount.setProjectAdaption(sum(adaptionStat, AdaptionProgressStatVO::getWithoutOperationCount, | |||
AdaptionProgressStatVO::getWithoutAdaptionInfo, | |||
AdaptionProgressStatVO::getWithoutTestValidCount, | |||
AdaptionProgressStatVO::getWithoutOrgConfirmCount, | |||
AdaptionProgressStatVO::getWithoutSelfTestCount)); | |||
// 项目初验 | |||
FirstAcceptProgressStatisticsVO firstAcceptStat = constructionManage.firstAcceptProgressStatistics(new ProjectListReq()); | |||
todoCount.setFirstAccept(sum(firstAcceptStat, FirstAcceptProgressStatisticsVO::getTodoCount)); | |||
// 项目终验 | |||
FinalAcceptProgressStatisticsVO finalAcceptStat = finalAcceptanceManage.finalAcceptProgressStatistics(new ProjectListReq()); | |||
todoCount.setFinalAccept(sum(finalAcceptStat, FinalAcceptProgressStatisticsVO::getTodoCount, | |||
FinalAcceptProgressStatisticsVO::getFailedCount)); | |||
log.error("登录用户为:{}", LoginUserUtil.getRealName()); | |||
}, ThreadPoolUtil.REQUEST)); | |||
CompletableFuture.allOf(futures.toArray(new CompletableFuture[0])).join(); | |||
return todoCount; | |||
} | |||
@SafeVarargs | |||
private final <T> int sum(T obj, Function<T, Number>... function) { | |||
if (obj == null || function == null || function.length == 0) { | |||
return 0; | |||
} | |||
return Arrays.stream(function) | |||
.map(w -> w.apply(obj)) | |||
.filter(Objects::nonNull) | |||
.mapToInt(Number::intValue) | |||
.sum(); | |||
} | |||
} |
@@ -25,7 +25,6 @@ import com.hz.pm.api.projectlib.service.IProjectService; | |||
import com.hz.pm.api.sys.manage.ProcessModelManage; | |||
import com.hz.pm.api.user.security.model.UserInfoDetails; | |||
import com.hz.pm.api.user.util.LoginUserUtil; | |||
import com.ningdatech.basic.exception.BizException; | |||
import com.ningdatech.basic.model.PageVo; | |||
import com.ningdatech.basic.util.CollUtils; | |||
import com.wflow.bean.entity.WflowModels; | |||
@@ -74,7 +73,7 @@ public class ProjectStoppedManage { | |||
} | |||
project.setStoppedFiles(req.getStoppedFiles()); | |||
project.setStoppedReason(req.getStoppedReason()); | |||
UserInfoDetails userDetail = LoginUserUtil.loginUserDetail(); | |||
UserInfoDetails userDetail = LoginUserUtil.userDetail(); | |||
WflowModels wflowModels = processModelManage.getWflowModelsNoNull(ProjectProcessType.PROJECT_STOPPED, userDetail.getMhUnitId()); | |||
@@ -140,7 +139,7 @@ public class ProjectStoppedManage { | |||
.orderByDesc(Project::getCreateOn) | |||
.notIn(Project::getStatus, ProjectStatus.STOPPED_PASSED.getCode(), | |||
ProjectStatus.ON_STOPPED_APPLY.getCode()); | |||
UserInfoDetails userDetail = LoginUserUtil.loginUserDetail(); | |||
UserInfoDetails userDetail = LoginUserUtil.userDetail(); | |||
if (!userDetail.hasSuperAdmin()) { | |||
query.eq(Project::getBuildOrgCode, userDetail.getMhUnitIdStr()); | |||
} | |||
@@ -42,4 +42,6 @@ public class MhSystemReplaceReq extends PagePo { | |||
@ApiModelProperty("计划完成时间") | |||
private Integer planFinishDateMax; | |||
private String includeProjectCode; | |||
} |
@@ -0,0 +1,47 @@ | |||
package com.hz.pm.api.projectlib.model.vo; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Data; | |||
/** | |||
* <p> | |||
* ProjectManageTodoCountVO | |||
* </p> | |||
* | |||
* @author WendyYang | |||
* @since 10:52 2024/10/31 | |||
*/ | |||
@Data | |||
public class ProjectManageTodoCountVO { | |||
@ApiModelProperty("项目申报") | |||
private Integer projectDeclare; | |||
@ApiModelProperty("专家评审") | |||
private Integer expertReview; | |||
@ApiModelProperty("项目复核") | |||
private Integer projectReview; | |||
@ApiModelProperty("年度计划") | |||
private Integer annualPlan; | |||
@ApiModelProperty("资金下达") | |||
private Integer amountApproval; | |||
@ApiModelProperty("项目立项") | |||
private Integer projectRecord; | |||
@ApiModelProperty("项目采购") | |||
private Integer projectPurchase; | |||
@ApiModelProperty("项目适配") | |||
private Integer projectAdaption; | |||
@ApiModelProperty("项目初验") | |||
private Integer firstAccept; | |||
@ApiModelProperty("项目终验") | |||
private Integer finalAccept; | |||
} |
@@ -67,7 +67,7 @@ public class SafetyRiskManage { | |||
.like(StringUtils.isNotBlank(req.getProjectName()), Project::getProjectName, req.getProjectName()) | |||
.like(StringUtils.isNotBlank(req.getBuildOrgName()), Project::getBuildOrgName, req.getBuildOrgName()) | |||
.orderByDesc(Project::getUpdateOn); | |||
checkAuth(query, LoginUserUtil.loginUserDetail()); | |||
checkAuth(query, LoginUserUtil.userDetail()); | |||
Page<Project> page = projectService.page(req.page(), query); | |||
long total; | |||
if ((total = page.getTotal()) == 0) { | |||
@@ -160,7 +160,7 @@ public class SafetyRiskManage { | |||
return "数据为空"; | |||
} | |||
UserInfoDetails user = LoginUserUtil.loginUserDetail(); | |||
UserInfoDetails user = LoginUserUtil.userDetail(); | |||
String projectCode = dtos.get(0).getProjectCode(); | |||
if (StringUtils.isBlank(projectCode)) { | |||
@@ -198,7 +198,7 @@ public class SafetyRiskManage { | |||
return "数据为空"; | |||
} | |||
UserInfoDetails user = LoginUserUtil.loginUserDetail(); | |||
UserInfoDetails user = LoginUserUtil.userDetail(); | |||
String projectCode = dtos.get(0).getProjectCode(); | |||
if (StringUtils.isBlank(projectCode)) { | |||
@@ -78,7 +78,7 @@ public class NoticeManage { | |||
@Transactional(rollbackFor = Exception.class) | |||
public IdVo<Long> saveOrModify(NoticeSaveReq req) { | |||
Notice notice = BeanUtil.copyProperties(req, Notice.class); | |||
permissionsSave(notice, LoginUserUtil.loginUserDetail()); | |||
permissionsSave(notice, LoginUserUtil.userDetail()); | |||
noticeService.saveOrUpdate(notice); | |||
return IdVo.of(notice.getId()); | |||
} | |||
@@ -39,7 +39,7 @@ public class UserGuidanceManage { | |||
* @return \ | |||
*/ | |||
public UserGuidanceVO userGuidanceDetail() { | |||
UserInfoDetails user = LoginUserUtil.loginUserDetail(); | |||
UserInfoDetails user = LoginUserUtil.userDetail(); | |||
UserGuidanceVO vo = UserGuidanceVO.builder() | |||
.orgCode(user.getMhUnitId()) | |||
.username(user.getUsername()) | |||
@@ -15,7 +15,6 @@ import com.hz.pm.api.todocenter.constant.TodoCenterConst; | |||
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; | |||
import com.ningdatech.basic.function.VUtils; | |||
import com.wflow.contants.HisProInsEndActId; | |||
import com.wflow.workflow.bean.dto.ReqProcessHandlerDTO; | |||
import com.wflow.workflow.bean.process.ProgressNode; | |||
@@ -65,7 +64,7 @@ public class WithDrawHandle { | |||
public Boolean checkCanWithdraw(String instanceId, ProcessProgressVo progressInstanceDetail, String taskId) { | |||
HistoricProcessInstance historicProcessInstance = historyService.createHistoricProcessInstanceQuery() | |||
.processInstanceId(instanceId).singleResult(); | |||
UserInfoDetails userInfoDetails = LoginUserUtil.loginUserDetail(); | |||
UserInfoDetails userInfoDetails = LoginUserUtil.userDetail(); | |||
String userId = userInfoDetails.getEmployeeCode(); | |||
//如果不是审核中 | |||
if (!ProcessStatusEnum.UNDER_REVIEW.getDesc() | |||
@@ -14,11 +14,9 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |||
import com.google.common.collect.Lists; | |||
import com.google.common.collect.Maps; | |||
import com.google.common.collect.Sets; | |||
import com.hz.pm.api.common.enumeration.CommonEnum; | |||
import com.hz.pm.api.common.enumeration.ProjectProcessType; | |||
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.entity.ExcelExportWriter; | |||
import com.hz.pm.api.common.util.BizUtils; | |||
import com.hz.pm.api.common.util.ExcelDownUtil; | |||
@@ -36,7 +34,6 @@ import com.hz.pm.api.projectlib.model.dto.ProjectDTO; | |||
import com.hz.pm.api.projectlib.model.entity.Project; | |||
import com.hz.pm.api.projectlib.model.entity.ProjectApplication; | |||
import com.hz.pm.api.projectlib.model.entity.ProjectInst; | |||
import com.hz.pm.api.projectlib.model.enumeration.InstTypeEnum; | |||
import com.hz.pm.api.projectlib.model.enumeration.status.ProjectStatus; | |||
import com.hz.pm.api.projectlib.model.req.ProjectListReq; | |||
import com.hz.pm.api.projectlib.service.IProjectApplicationService; | |||
@@ -44,7 +41,6 @@ import com.hz.pm.api.projectlib.service.IProjectInstService; | |||
import com.hz.pm.api.projectlib.service.IProjectService; | |||
import com.hz.pm.api.signature.entity.CompanySignature; | |||
import com.hz.pm.api.signature.service.ICompanySignatureService; | |||
import com.hz.pm.api.sys.model.entity.Region; | |||
import com.hz.pm.api.sys.service.IRegionService; | |||
import com.hz.pm.api.todocenter.constant.TodoCenterConst; | |||
import com.hz.pm.api.todocenter.constant.TodoCenterConst.Declared; | |||
@@ -447,7 +443,7 @@ public class TodoCenterManage { | |||
@Transactional(rollbackFor = Exception.class) | |||
public synchronized String handler(ReqProcessHandlerDTO param) { | |||
// 获取登录用户ID | |||
UserInfoDetails user = LoginUserUtil.loginUserDetail(); | |||
UserInfoDetails user = LoginUserUtil.userDetail(); | |||
// 获取登录用户浙政钉code | |||
String userIdStr = user.getUserIdStr(); | |||
// 获取入参 | |||
@@ -557,7 +553,7 @@ public class TodoCenterManage { | |||
@Transactional(rollbackFor = Exception.class) | |||
public synchronized String handlerXinchuang(ReqProcessHandlerDTO param) { | |||
// 获取登录用户ID | |||
UserInfoDetails user = LoginUserUtil.loginUserDetail(); | |||
UserInfoDetails user = LoginUserUtil.userDetail(); | |||
// 获取登录用户浙政钉code | |||
String userIdStr = user.getUserIdStr(); | |||
// 获取入参 | |||
@@ -759,7 +755,7 @@ public class TodoCenterManage { | |||
* @return 流程进度及表单详情 | |||
*/ | |||
public ProcessProgressDetailVO getProcessDetail(ProcessDetailReq request) { | |||
String employeeCode = LoginUserUtil.loginUserDetail().getEmployeeCode(); | |||
String employeeCode = LoginUserUtil.userDetail().getEmployeeCode(); | |||
String instanceId = request.getInstanceId(); | |||
String nodeId = request.getNodeId(); | |||
Long projectId = request.getProjectId(); | |||
@@ -778,7 +774,7 @@ public class TodoCenterManage { | |||
Boolean isHighLine = Boolean.FALSE; | |||
if (CollUtil.isNotEmpty(progressInfo)) { | |||
buildUserUtils.buildUserByProcessInfo(progressInfo); | |||
isHighLine = checkHighLine(progressInfo, taskId, LoginUserUtil.loginUserDetail()); | |||
isHighLine = checkHighLine(progressInfo, taskId, LoginUserUtil.userDetail()); | |||
} | |||
ProcessProgressDetailVO res = new ProcessProgressDetailVO(); | |||
if (Objects.nonNull(projectInst)) { | |||
@@ -801,7 +797,7 @@ public class TodoCenterManage { | |||
} | |||
public ProcessProgressDetailVO getProcessXinchuangDetail(ProcessDetailReq request) { | |||
String employeeCode = LoginUserUtil.loginUserDetail().getEmployeeCode(); | |||
String employeeCode = LoginUserUtil.userDetail().getEmployeeCode(); | |||
String instanceId = request.getInstanceId(); | |||
String nodeId = request.getNodeId(); | |||
Long xinchuangId = request.getXinchuangId(); | |||
@@ -817,7 +813,7 @@ public class TodoCenterManage { | |||
Boolean isHighLine = Boolean.FALSE; | |||
if (CollUtil.isNotEmpty(progressInfo)) { | |||
buildUserUtils.buildUserByProcessInfo(progressInfo); | |||
isHighLine = checkHighLine(progressInfo, taskId, LoginUserUtil.loginUserDetail()); | |||
isHighLine = checkHighLine(progressInfo, taskId, LoginUserUtil.userDetail()); | |||
} | |||
ProcessProgressDetailVO res = new ProcessProgressDetailVO(); | |||
res.setProcessProgressVo(progressInstanceDetail); | |||
@@ -1739,7 +1735,7 @@ public class TodoCenterManage { | |||
* @return | |||
*/ | |||
public String todoTaskId(String instanceId) { | |||
String employeeCode = LoginUserUtil.loginUserDetail().getEmployeeCode(); | |||
String employeeCode = LoginUserUtil.userDetail().getEmployeeCode(); | |||
List<Task> tasks = taskService.createTaskQuery() | |||
.processInstanceId(instanceId) | |||
.taskAssignee(employeeCode) | |||
@@ -66,7 +66,7 @@ public class TodoServiceImpl implements ITodoService { | |||
*/ | |||
@Override | |||
public ProcessProgressDetailVO getProcessDetail(ProcessDetailReq request) { | |||
String employeeCode = LoginUserUtil.loginUserDetail().getUserIdStr(); | |||
String employeeCode = LoginUserUtil.userDetail().getUserIdStr(); | |||
String instanceId = request.getInstanceId(); | |||
String nodeId = request.getNodeId(); | |||
Long projectId = request.getProjectId(); | |||
@@ -81,7 +81,7 @@ public class TodoServiceImpl implements ITodoService { | |||
Boolean isHighLine = Boolean.FALSE; | |||
if (CollUtil.isNotEmpty(progressInfo)) { | |||
buildUserUtils.buildUserByProcessInfo(progressInfo); | |||
isHighLine = checkHighLine(progressInfo, taskId, LoginUserUtil.loginUserDetail()); | |||
isHighLine = checkHighLine(progressInfo, taskId, LoginUserUtil.userDetail()); | |||
} | |||
ProcessProgressDetailVO res = new ProcessProgressDetailVO(); | |||
res.setProcessProgressVo(instDetail); | |||
@@ -61,7 +61,7 @@ public class MhUnitQueryAuthHelper { | |||
} | |||
public UnitQueryState listCanViewUnitIds(Long unitId) { | |||
return listCanViewUnitIds(unitId, LoginUserUtil.loginUserDetail()); | |||
return listCanViewUnitIds(unitId, LoginUserUtil.userDetail()); | |||
} | |||
} |
@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |||
import com.baomidou.mybatisplus.core.toolkit.StringUtils; | |||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |||
import com.hz.pm.api.common.exception.ReturnException; | |||
import com.hz.pm.api.common.helper.UserInfoHelper; | |||
import com.hz.pm.api.common.util.BizUtils; | |||
import com.hz.pm.api.common.util.StrUtils; | |||
@@ -298,10 +299,10 @@ public class UserInfoManage { | |||
public ResUserDetailVO currentUserInfo() { | |||
UserInfoDetails userDetail = LoginUserUtil.loginUserDetail(); | |||
UserInfoDetails userDetail = LoginUserUtil.userDetailNotNull(); | |||
UserInfo userInfo = userInfoService.getById(userDetail.getUserId()); | |||
if (Objects.isNull(userInfo)) { | |||
return null; | |||
if (userInfo == null) { | |||
throw ReturnException.wrap("用户不存在"); | |||
} | |||
ResUserDetailVO resUserDetail = new ResUserDetailVO(); | |||
resUserDetail.setRealName(userInfo.getRealName()); | |||
@@ -1,9 +1,11 @@ | |||
package com.hz.pm.api.user.util; | |||
import cn.hutool.core.collection.CollUtil; | |||
import com.ningdatech.basic.auth.AbstractLoginUserUtil; | |||
import com.hz.pm.api.sys.model.entity.Role; | |||
import com.hz.pm.api.user.model.enumeration.RoleEnum; | |||
import com.hz.pm.api.user.security.model.UserInfoDetails; | |||
import org.springframework.util.Assert; | |||
import java.util.Collections; | |||
import java.util.List; | |||
@@ -20,12 +22,18 @@ import java.util.stream.Collectors; | |||
*/ | |||
public class LoginUserUtil extends AbstractLoginUserUtil { | |||
public static UserInfoDetails loginUserDetail() { | |||
return getLoginUserPrincipal(); | |||
public static UserInfoDetails userDetail() { | |||
return isLogin() ? getLoginUserPrincipal() : null; | |||
} | |||
public static UserInfoDetails userDetailNotNull() { | |||
UserInfoDetails userInfoDetails = userDetail(); | |||
Assert.notNull(userInfoDetails, "用户未登录"); | |||
return userInfoDetails; | |||
} | |||
public static List<Long> getRoleIdList() { | |||
UserInfoDetails userInfoDetails = loginUserDetail(); | |||
UserInfoDetails userInfoDetails = userDetailNotNull(); | |||
List<Role> userRoleList = userInfoDetails.getUserRoleList(); | |||
if (userRoleList == null) { | |||
return Collections.emptyList(); | |||
@@ -34,12 +42,12 @@ public class LoginUserUtil extends AbstractLoginUserUtil { | |||
} | |||
public static boolean isExpert() { | |||
UserInfoDetails detail = loginUserDetail(); | |||
return detail.getUserRoleList().stream().anyMatch(w -> RoleEnum.EXPERT.eq(w.getCode())); | |||
UserInfoDetails detail = userDetailNotNull(); | |||
return CollUtil.anyMatch(detail.getUserRoleList(), w -> RoleEnum.EXPERT.eq(w.getCode())); | |||
} | |||
public static Long getMhUnitId() { | |||
return loginUserDetail().getMhUnitId(); | |||
return userDetailNotNull().getMhUnitId(); | |||
} | |||
} |
@@ -200,7 +200,7 @@ public class WorkbenchManage { | |||
private void initWorkbenchDefaultParam(WorkbenchReq req) { | |||
if (req.getUnitId() == null) { | |||
req.setUnitId(LoginUserUtil.loginUserDetail().getMhUnitId()); | |||
req.setUnitId(LoginUserUtil.userDetail().getMhUnitId()); | |||
} | |||
if (req.getProjectYear() == null) { | |||
req.setProjectYear(LocalDate.now().getYear()); | |||
@@ -944,7 +944,7 @@ public class WorkbenchManage { | |||
} | |||
public List<WorkbenchProjectMonitorEarlyWarnVO> projectMonitorEarlyWarnings(WorkbenchReq req) { | |||
UserInfoDetails userInfoDetails = LoginUserUtil.loginUserDetail(); | |||
UserInfoDetails userInfoDetails = LoginUserUtil.userDetail(); | |||
// 从预警表中查询当前登录用户所能查看的项目 | |||
LambdaQueryWrapper<ProjectEarlyWarning> queryWrapper = Wrappers.lambdaQuery(ProjectEarlyWarning.class); | |||
buildPermissionWarningWrapper(queryWrapper, userInfoDetails); | |||
@@ -29,7 +29,7 @@ public class StateMachineTest extends AppTests { | |||
public void test() { | |||
CountDownLatch count = new CountDownLatch(1000); | |||
for (int j = 0; j < 100; j++) { | |||
ThreadPoolUtil.REQUEST.execute(() -> { | |||
ThreadPoolUtil.SCHEDULER.execute(() -> { | |||
Purchase purchase = new Purchase(); | |||
purchase.setProjectId(3496L); | |||
for (int i = 0; i < 5; i++) { | |||