@@ -29,7 +29,7 @@ import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE; | |||
@Setter | |||
@Accessors(chain = true) | |||
@ToString(callSuper = true) | |||
public class MenuTreeEntity<E, T extends Serializable> { | |||
public class MenuTreeEntity<E> { | |||
@TableId(value = "id", type = IdType.AUTO) | |||
protected Long id; | |||
@@ -4,7 +4,7 @@ import cn.hutool.core.collection.CollUtil; | |||
import com.hz.pm.api.common.model.constant.ProjectDeclareConst; | |||
import com.hz.pm.api.common.model.constant.StateMachineConst; | |||
import com.hz.pm.api.common.enumeration.CommonEnum; | |||
import com.hz.pm.api.common.statemachine.util.StateMachineUtils; | |||
import com.hz.pm.api.common.statemachine.util.StateMachineUtil; | |||
import com.hz.pm.api.common.statemachine.event.ProjectStatusChangeEvent; | |||
import com.hz.pm.api.projectlib.model.enumeration.ProjectStatusEnum; | |||
import com.hz.pm.api.projectlib.model.entity.Project; | |||
@@ -75,7 +75,7 @@ public class ProjectDeclareChoiceAction implements Action<ProjectStatusEnum, Pro | |||
private void preDeclareChoice(StateContext<ProjectStatusEnum, ProjectStatusChangeEvent> stateContext) { | |||
Project project = stateContext.getMessage().getHeaders().get(PROJECT_DECLARE, Project.class); | |||
log.info("预审申报事件之前,项目的状态为:{}"+project.getStatus()); | |||
if (StateMachineUtils.isCityProject(project) && StateMachineUtils.judgeDeclareAmount(project, | |||
if (StateMachineUtil.isCityProject(project) && StateMachineUtil.judgeDeclareAmount(project, | |||
ProjectDeclareConst.Number.DECLARE_AMOUNT_JUDGEMENT)){ | |||
project.setStatus(ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS.getCode()); | |||
}else { | |||
@@ -86,7 +86,7 @@ public class ProjectDeclareChoiceAction implements Action<ProjectStatusEnum, Pro | |||
private void preWithDrawChoice(StateContext<ProjectStatusEnum, ProjectStatusChangeEvent> stateContext) { | |||
Project project = stateContext.getMessage().getHeaders().get(PROJECT_DECLARE, Project.class); | |||
log.info("预审中撤回事件之前,项目的状态为:{}"+project.getStatus()); | |||
if (StateMachineUtils.isCityProject(project) && StateMachineUtils.judgeDeclareAmount(project, | |||
if (StateMachineUtil.isCityProject(project) && StateMachineUtil.judgeDeclareAmount(project, | |||
ProjectDeclareConst.Number.DECLARE_AMOUNT_JUDGEMENT)){ | |||
project.setStatus(ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS_SUCCESS.getCode()); | |||
}else { | |||
@@ -4,7 +4,7 @@ import cn.hutool.core.collection.CollUtil; | |||
import com.hz.pm.api.common.model.constant.ProjectDeclareConst; | |||
import com.hz.pm.api.common.model.constant.StateMachineConst; | |||
import com.hz.pm.api.common.enumeration.CommonEnum; | |||
import com.hz.pm.api.common.statemachine.util.StateMachineUtils; | |||
import com.hz.pm.api.common.statemachine.util.StateMachineUtil; | |||
import com.hz.pm.api.common.statemachine.event.ProjectStatusChangeEvent; | |||
import com.hz.pm.api.projectlib.model.enumeration.ProjectStatusEnum; | |||
import com.hz.pm.api.projectlib.model.entity.Project; | |||
@@ -31,7 +31,7 @@ public class ProjectDeclareGuardFactory { | |||
public boolean evaluate(StateContext<ProjectStatusEnum, ProjectStatusChangeEvent> context) { | |||
Project project = context.getMessage().getHeaders().get(PROJECT_DECLARE, Project.class); | |||
// 判断申报项目是否是市级项目,且申报金额是否大于等于1000万元 | |||
if (StateMachineUtils.isCityProject(project) && StateMachineUtils.judgeDeclareAmount(project, | |||
if (StateMachineUtil.isCityProject(project) && StateMachineUtil.judgeDeclareAmount(project, | |||
ProjectDeclareConst.Number.DECLARE_AMOUNT_JUDGEMENT)){ | |||
return true; | |||
} | |||
@@ -1,13 +1,13 @@ | |||
package com.hz.pm.api.common.statemachine.util; | |||
import com.google.common.collect.Maps; | |||
import com.hz.pm.api.common.statemachine.builder.*; | |||
import com.hz.pm.api.common.statemachine.contant.RegionContant; | |||
import lombok.RequiredArgsConstructor; | |||
import lombok.extern.slf4j.Slf4j; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.stereotype.Component; | |||
import javax.annotation.PostConstruct; | |||
import java.util.HashMap; | |||
import java.util.Map; | |||
/** | |||
@@ -16,58 +16,42 @@ import java.util.Map; | |||
* @author CMM | |||
* @since 2023/02/07 15:56 | |||
*/ | |||
@Component | |||
@Slf4j | |||
@Component | |||
@RequiredArgsConstructor | |||
public class MachineBuilderFounder { | |||
public final static Map<String,ProjectDeclareStateMachineBuilder> machineBuilderMap = | |||
Maps.newConcurrentMap(); | |||
@Autowired | |||
private ProjectDeclareStateMachineSBJBuilder projectDeclareStateMachineSBJBuilder; | |||
@Autowired | |||
private ProjectDeclareStateMachineLDBuilder projectDeclareStateMachineLDBuilder; | |||
@Autowired | |||
private ProjectDeclareStateMachineQTBuilder projectDeclareStateMachineQTBuilder; | |||
@Autowired | |||
private ProjectDeclareStateMachineJYBuilder projectDeclareStateMachineJYBuilder; | |||
@Autowired | |||
private ProjectDeclareStateMachineSCBuilder projectDeclareStateMachineSCBuilder; | |||
private static final Map<String, ProjectDeclareStateMachineBuilder> MACHINE_BUILDER_MAP = new HashMap<>(16); | |||
@Autowired | |||
private ProjectDeclareStateMachineSYBuilder projectDeclareStateMachineSYBuilder; | |||
@Autowired | |||
private ProjectDeclareStateMachineYHBuilder projectDeclareStateMachineYHBuilder; | |||
@Autowired | |||
private ProjectDeclareStateMachineQYBuilder projectDeclareStateMachineQYBuilder; | |||
@Autowired | |||
private ProjectDeclareStateMachineJNBuilder projectDeclareStateMachineJNBuilder; | |||
@Autowired | |||
private ProjectDeclareStateMachineLQBuilder projectDeclareStateMachineLQBuilder; | |||
public static ProjectDeclareStateMachineBuilder getByRegion(String regionCode) { | |||
return MACHINE_BUILDER_MAP.get(regionCode); | |||
} | |||
@Autowired | |||
private ProjectDeclareStateMachineKFQBuilder projectDeclareStateMachineKFQBuilder; | |||
private final ProjectDeclareStateMachineSBJBuilder projectDeclareStateMachineSBJBuilder; | |||
private final ProjectDeclareStateMachineLDBuilder projectDeclareStateMachineLDBuilder; | |||
private final ProjectDeclareStateMachineQTBuilder projectDeclareStateMachineQTBuilder; | |||
private final ProjectDeclareStateMachineJYBuilder projectDeclareStateMachineJYBuilder; | |||
private final ProjectDeclareStateMachineSCBuilder projectDeclareStateMachineSCBuilder; | |||
private final ProjectDeclareStateMachineSYBuilder projectDeclareStateMachineSYBuilder; | |||
private final ProjectDeclareStateMachineYHBuilder projectDeclareStateMachineYHBuilder; | |||
private final ProjectDeclareStateMachineQYBuilder projectDeclareStateMachineQYBuilder; | |||
private final ProjectDeclareStateMachineJNBuilder projectDeclareStateMachineJNBuilder; | |||
private final ProjectDeclareStateMachineLQBuilder projectDeclareStateMachineLQBuilder; | |||
private final ProjectDeclareStateMachineKFQBuilder projectDeclareStateMachineKFQBuilder; | |||
@PostConstruct | |||
public void MachineBuilderFounder(){ | |||
machineBuilderMap.put(RegionContant.LS_SBJ_CODE, projectDeclareStateMachineSBJBuilder); | |||
machineBuilderMap.put(RegionContant.LS_LD_CODE, projectDeclareStateMachineLDBuilder); | |||
machineBuilderMap.put(RegionContant.LS_QT_CODE, projectDeclareStateMachineQTBuilder); | |||
machineBuilderMap.put(RegionContant.LS_JY_CODE, projectDeclareStateMachineJYBuilder); | |||
machineBuilderMap.put(RegionContant.LS_SC_CODE, projectDeclareStateMachineSCBuilder); | |||
machineBuilderMap.put(RegionContant.LS_SY_CODE, projectDeclareStateMachineSYBuilder); | |||
machineBuilderMap.put(RegionContant.LS_YH_CODE, projectDeclareStateMachineYHBuilder); | |||
machineBuilderMap.put(RegionContant.LS_QY_CODE, projectDeclareStateMachineQYBuilder); | |||
machineBuilderMap.put(RegionContant.LS_JN_CODE, projectDeclareStateMachineJNBuilder); | |||
machineBuilderMap.put(RegionContant.LS_LQ_CODE, projectDeclareStateMachineLQBuilder); | |||
machineBuilderMap.put(RegionContant.LS_KFQ_CODE, projectDeclareStateMachineKFQBuilder); | |||
public void machineBuilderFounder(){ | |||
MACHINE_BUILDER_MAP.put(RegionContant.LS_SBJ_CODE, projectDeclareStateMachineSBJBuilder); | |||
MACHINE_BUILDER_MAP.put(RegionContant.LS_LD_CODE, projectDeclareStateMachineLDBuilder); | |||
MACHINE_BUILDER_MAP.put(RegionContant.LS_QT_CODE, projectDeclareStateMachineQTBuilder); | |||
MACHINE_BUILDER_MAP.put(RegionContant.LS_JY_CODE, projectDeclareStateMachineJYBuilder); | |||
MACHINE_BUILDER_MAP.put(RegionContant.LS_SC_CODE, projectDeclareStateMachineSCBuilder); | |||
MACHINE_BUILDER_MAP.put(RegionContant.LS_SY_CODE, projectDeclareStateMachineSYBuilder); | |||
MACHINE_BUILDER_MAP.put(RegionContant.LS_YH_CODE, projectDeclareStateMachineYHBuilder); | |||
MACHINE_BUILDER_MAP.put(RegionContant.LS_QY_CODE, projectDeclareStateMachineQYBuilder); | |||
MACHINE_BUILDER_MAP.put(RegionContant.LS_JN_CODE, projectDeclareStateMachineJNBuilder); | |||
MACHINE_BUILDER_MAP.put(RegionContant.LS_LQ_CODE, projectDeclareStateMachineLQBuilder); | |||
MACHINE_BUILDER_MAP.put(RegionContant.LS_KFQ_CODE, projectDeclareStateMachineKFQBuilder); | |||
} | |||
} |
@@ -33,7 +33,7 @@ import java.util.Objects; | |||
@Slf4j | |||
@Component | |||
@RequiredArgsConstructor | |||
public class StateMachineUtils { | |||
public class StateMachineUtil { | |||
private static final String PROJECT_DECLARE = StateMachineConst.PROJECT_DECLARE; | |||
@@ -45,51 +45,51 @@ public class StateMachineUtils { | |||
//通过审核 | |||
public void pass(Project project) { | |||
try{ | |||
execute(project,getProjectStatusPassEvent(project.getStatus())); | |||
}catch (Exception e){ | |||
log.info("状态机 通过失败 :{}",e.getMessage()); | |||
try { | |||
execute(project, getProjectStatusPassEvent(project.getStatus())); | |||
} catch (Exception e) { | |||
log.info("状态机 通过失败 :{}", e.getMessage()); | |||
throw new BusinessException("状态机 通过失败: " + e); | |||
} | |||
} | |||
//拒绝 | |||
public void reject(Project project) { | |||
try{ | |||
execute(project,getProjectStatusRejectEvent(project.getStatus())); | |||
}catch (Exception e){ | |||
log.info("状态机 拒绝失败 :{}",e.getMessage()); | |||
try { | |||
execute(project, getProjectStatusRejectEvent(project.getStatus())); | |||
} catch (Exception e) { | |||
log.info("状态机 拒绝失败 :{}", e.getMessage()); | |||
throw new BusinessException("状态机 拒绝失败: " + e); | |||
} | |||
} | |||
//撤回 | |||
public void withDraw(Project project) { | |||
try{ | |||
execute(project,getProjectStatusWithdrawEvent(project.getStatus())); | |||
}catch (Exception e){ | |||
log.info("状态机 撤回失败 :{}",e.getMessage()); | |||
try { | |||
execute(project, getProjectStatusWithdrawEvent(project.getStatus())); | |||
} catch (Exception e) { | |||
log.info("状态机 撤回失败 :{}", e.getMessage()); | |||
throw new BusinessException("状态机 撤回失败: " + e); | |||
} | |||
} | |||
public void execute(Project project, ProjectStatusChangeEvent event) throws Exception { | |||
log.info("调用状态机前的项目状态为>>>>>>>>>>{}" + project.getStatus()); | |||
log.info("调用状态机前的项目状态为:{}", project.getStatus()); | |||
// 将状态变更记录保存到项目状态变更表中 | |||
ProjectStatusChange projectStatusChange = new ProjectStatusChange(); | |||
projectStatusChange.setBeforeStatus(project.getStatus()); | |||
ProjectDeclareStateMachineBuilder builder = MachineBuilderFounder.machineBuilderMap.get(project.getAreaCode()); | |||
ProjectDeclareStateMachineBuilder builder = MachineBuilderFounder.getByRegion(project.getAreaCode()); | |||
VUtils.isTrue(Objects.isNull(builder)).throwMessage("状态机初始化失败!"); | |||
//获取TO状态机 | |||
StateMachine<ProjectStatusEnum, ProjectStatusChangeEvent> stateMachine = builder.build(); | |||
Message message = MessageBuilder.withPayload(event) | |||
Message<ProjectStatusChangeEvent> message = MessageBuilder.withPayload(event) | |||
.setHeader(PROJECT_DECLARE, project) | |||
.setHeader(APPLICATION_DECLARE,projectApplicationService.getApplicationsByProject(project)) | |||
.setHeader(APPLICATION_DECLARE, projectApplicationService.getApplicationsByProject(project)) | |||
.build(); | |||
//初始化状态机 | |||
StateMachinePersister projectDeclareStateMachinePersister = builder.getProjectPersister(); | |||
StateMachinePersister<ProjectStatusEnum, ProjectStatusChangeEvent, Project> projectDeclareStateMachinePersister = builder.getProjectPersister(); | |||
projectDeclareStateMachinePersister.restore(stateMachine, project); | |||
stateMachine.sendEvent(message); | |||
projectStatusChange.setProjectId(project.getId()); | |||
@@ -99,39 +99,31 @@ public class StateMachineUtils { | |||
projectStatusChange.setProjectCode(project.getProjectCode()); | |||
// 插入项目状态变更表中 | |||
projectStatusChangeService.save(projectStatusChange); | |||
log.info("调用状态机后的项目状态为>>>>>>>>>>{}" + project.getStatus()); | |||
log.info("调用状态机后的项目状态为:{}", project.getStatus()); | |||
} | |||
/** | |||
* 判断项目申报金额是否大于1000万元 | |||
* | |||
* @param project | |||
* @param project \ | |||
* @return boolean | |||
* @author CMM | |||
* @since 2023/02/07 17:13 | |||
*/ | |||
public static boolean judgeDeclareAmount(Project project, BigDecimal targetAmount) { | |||
int flag = project.getDeclareAmount().compareTo(targetAmount); | |||
if (flag > 0 || flag == 0) { | |||
return true; | |||
} | |||
return false; | |||
return flag > 0 || flag == 0; | |||
} | |||
/** | |||
* 判断申报项目是否为市级项目 | |||
* | |||
* @param project | |||
* @param project \ | |||
* @return boolean | |||
* @author CMM | |||
* @since 2023/02/07 17:05 | |||
*/ | |||
public static boolean isCityProject(Project project) { | |||
String areaCode = project.getAreaCode(); | |||
if (areaCode.equals(RegionConst.RC_HZ)) { | |||
return true; | |||
} | |||
return false; | |||
return areaCode.equals(RegionConst.RC_HZ); | |||
} | |||
public ProjectStatusChangeEvent getProjectStatusPassEvent(Integer status) { | |||
@@ -157,4 +149,5 @@ public class StateMachineUtils { | |||
} | |||
return event; | |||
} | |||
} |
@@ -1,91 +0,0 @@ | |||
package com.hz.pm.api.common.util; | |||
import com.alibaba.fastjson.JSON; | |||
import com.alibaba.fastjson.JSONObject; | |||
import com.auth0.jwt.JWT; | |||
import com.auth0.jwt.JWTVerifier; | |||
import com.auth0.jwt.algorithms.Algorithm; | |||
import com.hz.pm.api.common.model.ZwddTokenUser; | |||
import org.apache.commons.lang3.StringUtils; | |||
import java.util.Date; | |||
import java.util.HashMap; | |||
import java.util.Map; | |||
/** | |||
* @author liuxinxin | |||
* @date 2023/5/4 下午2:34 | |||
*/ | |||
public class JwtTokenUtil { | |||
private static final String SECRET_KEY = "dbe1cc89019c4c7abd5085bf47a25fb0"; | |||
private static final String CLAIM_KEY = "content"; | |||
private static final Integer DEFAULT_EXPIRE_TIME = Integer.valueOf(86400); | |||
public static String createToken(ZwddTokenUser dingTokenUser) { | |||
return createToken(dingTokenUser, DEFAULT_EXPIRE_TIME); | |||
} | |||
public static String createToken(ZwddTokenUser dingTokenUser, Integer expireTime) { | |||
if (dingTokenUser == null) { | |||
throw new IllegalArgumentException(""); | |||
} | |||
if (dingTokenUser.getTenantId() == null) { | |||
throw new IllegalArgumentException(""); | |||
} | |||
if (StringUtils.isEmpty(dingTokenUser.getEmployeeCode())) { | |||
throw new IllegalArgumentException(""); | |||
} | |||
if (dingTokenUser.getTenantId() == null) { | |||
throw new IllegalArgumentException(""); | |||
} | |||
return createToken(JSON.toJSONString(dingTokenUser), expireTime); | |||
} | |||
private static String createToken(String content, Integer expireTime) { | |||
if (StringUtils.isEmpty(content)) { | |||
throw new IllegalArgumentException(""); | |||
} | |||
Map<String, Object> header = new HashMap<>(4); | |||
header.put("alg", "HS256"); | |||
header.put("typ", "JWT"); | |||
Algorithm algorithm = Algorithm.HMAC256(SECRET_KEY); | |||
return JWT.create() | |||
.withHeader(header) | |||
.withClaim("content", content) | |||
.withIssuedAt(new Date()) | |||
.withExpiresAt(new Date(System.currentTimeMillis() + (expireTime.intValue() * 1000))) | |||
.sign(algorithm); | |||
} | |||
public static boolean verifyToken(String token) { | |||
if (StringUtils.isEmpty(token)) { | |||
throw new IllegalArgumentException("token"); | |||
} | |||
Algorithm algorithm = Algorithm.HMAC256(SECRET_KEY); | |||
JWTVerifier verifier = JWT.require(algorithm).build(); | |||
verifier.verify(token); | |||
return true; | |||
} | |||
private static String parseJwtString(String token) { | |||
if (StringUtils.isEmpty(token)) { | |||
throw new IllegalArgumentException("token"); | |||
} | |||
Algorithm algorithm = Algorithm.HMAC256(SECRET_KEY); | |||
JWTVerifier verifier = JWT.require(algorithm).build(); | |||
return verifier.verify(token).getClaim("content").asString(); | |||
} | |||
public static ZwddTokenUser parseJwt(String token) { | |||
String dingUserJson = parseJwtString(token); | |||
if (StringUtils.isEmpty(dingUserJson)) { | |||
return null; | |||
} | |||
ZwddTokenUser dingTokenUser = (ZwddTokenUser) JSONObject.parseObject(dingUserJson, ZwddTokenUser.class); | |||
return dingTokenUser; | |||
} | |||
} |
@@ -12,6 +12,9 @@ import org.slf4j.MDC; | |||
**/ | |||
public class MDCUtil { | |||
private MDCUtil() { | |||
} | |||
public static final String TRACE_ID = "traceId"; | |||
public static final String TRACE_ID_HEADER = "Trace-Id"; | |||
@@ -46,7 +46,7 @@ public final class TreeUtil { | |||
* @param treeList 待转换的集合 | |||
* @return 树结构 | |||
*/ | |||
public static <E extends MenuTreeEntity<E, ? extends Serializable>> List<E> buildTree(List<E> treeList) { | |||
public static <E extends MenuTreeEntity<E>> List<E> buildTree(List<E> treeList) { | |||
if (CollUtil.isEmpty(treeList)) { | |||
return treeList; | |||
} | |||
@@ -71,7 +71,7 @@ public final class TreeUtil { | |||
return trees; | |||
} | |||
private static <E extends MenuTreeEntity<E, ? extends Serializable>> | |||
private static <E extends MenuTreeEntity<E>> | |||
void foreachNodes(List<E> treeList, List<Serializable> selfIdEqSelfParent) { | |||
nodeMap = Maps.newConcurrentMap(); | |||
for (E parent : treeList) { | |||
@@ -98,7 +98,7 @@ public final class TreeUtil { | |||
} | |||
} | |||
private static <E extends MenuTreeEntity<E, ? extends Serializable>> void foreachNodesWithTopMenu(List<E> treeList) { | |||
private static <E extends MenuTreeEntity<E>> void foreachNodesWithTopMenu(List<E> treeList) { | |||
for (E parent : treeList) { | |||
Serializable id = parent.getId(); | |||
for (E children : treeList) { | |||
@@ -136,10 +136,7 @@ public class MeetingStatisticsManage { | |||
data.setCode(region.getRegionCode()); | |||
data.setName(region.getRegionName()); | |||
//先求出 此区域会议 | |||
List<Long> regionMeetingIds = meetings.stream().filter(m -> { | |||
return Boolean.FALSE; | |||
}).map(Meeting::getId).collect(Collectors.toList()); | |||
List<Long> regionMeetingIds = meetings.stream().filter(m -> Boolean.FALSE).map(Meeting::getId).collect(Collectors.toList()); | |||
List<ExpertReview> regionReviews = expertReviews.stream().filter(r -> { | |||
if (Objects.nonNull(r.getMeetingId()) && | |||
@@ -6,11 +6,10 @@ import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Data; | |||
import java.io.Serializable; | |||
import java.math.BigDecimal; | |||
import java.util.List; | |||
@Data | |||
@ApiModel(value = "绩效统计", description = "") | |||
@ApiModel(value = "绩效统计") | |||
public class PerformanceStatisticsVO implements Serializable { | |||
private static final long serialVersionUID = 1L; | |||
@@ -2,19 +2,17 @@ package com.hz.pm.api.expert.assembler; | |||
import cn.hutool.core.collection.CollUtil; | |||
import cn.hutool.core.collection.CollectionUtil; | |||
import com.hz.pm.api.common.helper.RegionCacheHelper; | |||
import com.hz.pm.api.expert.model.DictFieldInfoDTO; | |||
import com.hz.pm.api.expert.model.TagFieldInfo; | |||
import com.hz.pm.api.expert.model.dto.ExpertAdminExpertListDTO; | |||
import com.hz.pm.api.expert.model.vo.ExpertLibraryListItemVO; | |||
import com.hz.pm.api.meta.helper.DictionaryCache; | |||
import com.hz.pm.api.meta.helper.impl.TagsCacheImpl; | |||
import com.hz.pm.api.meta.model.dto.DictionaryDTO; | |||
import com.hz.pm.api.meta.model.dto.TagDTO; | |||
import lombok.RequiredArgsConstructor; | |||
import org.springframework.stereotype.Component; | |||
import java.util.*; | |||
import java.util.Collections; | |||
import java.util.List; | |||
import java.util.Optional; | |||
import java.util.stream.Collectors; | |||
/** | |||
@@ -1,29 +0,0 @@ | |||
package com.hz.pm.api.expert.assembler; | |||
import cn.hutool.core.collection.CollectionUtil; | |||
import com.hz.pm.api.expert.model.TagFieldInfo; | |||
import com.hz.pm.api.meta.model.entity.ExpertTag; | |||
import java.util.ArrayList; | |||
import java.util.List; | |||
import java.util.stream.Collectors; | |||
/** | |||
* @author liuxinxin | |||
* @date 2022/7/25 下午4:30 | |||
*/ | |||
public class TagAssembler { | |||
public static List<TagFieldInfo> toTagFieldInfoList(List<ExpertTag> expertTagList) { | |||
if (CollectionUtil.isEmpty(expertTagList)) { | |||
return new ArrayList<>(); | |||
} | |||
return expertTagList.stream().map(r -> { | |||
TagFieldInfo dictionaryFieldInfo = new TagFieldInfo(); | |||
dictionaryFieldInfo.setTagFieldName(r.getExpertInfoField()); | |||
dictionaryFieldInfo.setTagCode(r.getTagCode()); | |||
return dictionaryFieldInfo; | |||
}).collect(Collectors.toList()); | |||
} | |||
} |
@@ -16,12 +16,9 @@ import io.swagger.annotations.Api; | |||
import io.swagger.annotations.ApiOperation; | |||
import lombok.RequiredArgsConstructor; | |||
import org.springframework.web.bind.annotation.*; | |||
import springfox.documentation.annotations.ApiIgnore; | |||
import javax.servlet.http.HttpServletResponse; | |||
import javax.validation.Valid; | |||
import javax.validation.constraints.NotNull; | |||
import java.io.IOException; | |||
/** | |||
* <p> | |||
@@ -37,7 +37,6 @@ import com.hz.pm.api.meta.model.bo.RegionContainsBO; | |||
import com.hz.pm.api.meta.model.dto.DictionaryDTO; | |||
import com.hz.pm.api.meta.model.entity.ExpertDictionary; | |||
import com.hz.pm.api.meta.service.IExpertDictionaryService; | |||
import com.hz.pm.api.sys.model.dto.RegionDTO; | |||
import com.hz.pm.api.user.util.LoginUserUtil; | |||
import com.ningdatech.basic.exception.BizException; | |||
import com.ningdatech.basic.model.PageVo; | |||
@@ -1,14 +1,11 @@ | |||
package com.hz.pm.api.expert.service.impl; | |||
import cn.hutool.core.collection.CollUtil; | |||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |||
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; | |||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |||
import com.hz.pm.api.expert.entity.ExpertUserFullInfo; | |||
import com.ningdatech.basic.util.CollUtils; | |||
import com.hz.pm.api.common.model.CommonPage; | |||
import com.hz.pm.api.expert.assembler.ExpertUserInfoAssembler; | |||
import com.hz.pm.api.expert.constant.ExpertAccountStatusEnum; | |||
import com.hz.pm.api.expert.entity.ExpertUserFullInfo; | |||
import com.hz.pm.api.expert.mapper.ExpertAdminManageMapper; | |||
import com.hz.pm.api.expert.model.cmd.ExpertAdminExpertManageQueryCmd; | |||
import com.hz.pm.api.expert.model.dto.ExpertAdminExpertListDTO; | |||
@@ -18,16 +15,15 @@ import com.hz.pm.api.expert.model.query.ListExpertQuery; | |||
import com.hz.pm.api.expert.service.ExpertAdminManageService; | |||
import com.hz.pm.api.expert.service.IExpertUserFullInfoService; | |||
import com.hz.pm.api.meta.model.entity.ExpertDictionary; | |||
import com.hz.pm.api.meta.model.entity.ExpertTag; | |||
import com.hz.pm.api.meta.service.IExpertDictionaryService; | |||
import com.hz.pm.api.meta.service.IExpertTagService; | |||
import com.ningdatech.basic.util.CollUtils; | |||
import lombok.RequiredArgsConstructor; | |||
import org.springframework.stereotype.Service; | |||
import java.util.ArrayList; | |||
import java.util.List; | |||
import java.util.Map; | |||
import java.util.stream.Collectors; | |||
/** | |||
* @author liuxinxin | |||
@@ -1,6 +1,5 @@ | |||
package com.hz.pm.api.external.controller; | |||
import com.hz.pm.api.external.MhApiClient; | |||
import com.hz.pm.api.user.manage.SyncMhUserOrgManage; | |||
import io.swagger.annotations.Api; | |||
import lombok.RequiredArgsConstructor; | |||
@@ -1,12 +1,8 @@ | |||
package com.hz.pm.api.external.model.dto; | |||
import cn.hutool.core.collection.CollUtil; | |||
import lombok.Data; | |||
import java.util.Arrays; | |||
import java.util.Date; | |||
import java.util.List; | |||
import java.util.stream.Collectors; | |||
/** | |||
* <p> | |||
@@ -525,8 +525,7 @@ public class ProjectFileManage { | |||
private List<Long> getFileIdList(String buildBasis) { | |||
List<JSONObject> prePlanFileArray = JSON.parseArray(buildBasis, JSONObject.class); | |||
List<Long> prePlanFileIdList = CollUtils.fieldList(prePlanFileArray, w -> w.getLong(CommonConst.ID_STR)); | |||
return prePlanFileIdList; | |||
return CollUtils.fieldList(prePlanFileArray, w -> w.getLong(CommonConst.ID_STR)); | |||
} | |||
/** | |||
@@ -19,7 +19,7 @@ import lombok.Data; | |||
*/ | |||
@Data | |||
@TableName("nd_project_apply_borrow") | |||
@ApiModel(value = "NdProjectApplyBorrow对象", description = "") | |||
@ApiModel(value = "NdProjectApplyBorrow对象") | |||
public class ProjectApplyBorrow implements Serializable { | |||
private static final long serialVersionUID = 1L; | |||
@@ -1,6 +1,5 @@ | |||
package com.hz.pm.api.filemanage.model.vo; | |||
import com.hz.pm.api.expert.model.vo.ExpertReviewDetailVO; | |||
import com.hz.pm.api.expert.model.vo.ProjectReviewDetailVO; | |||
import com.hz.pm.api.projectdeclared.model.vo.ContractVO; | |||
import com.hz.pm.api.projectdeclared.model.vo.FinalAcceptanceVO; | |||
@@ -12,7 +11,6 @@ import io.swagger.annotations.ApiModel; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Data; | |||
import java.time.LocalDateTime; | |||
import java.util.List; | |||
/** | |||
@@ -240,7 +240,7 @@ public class ProjectConvertUtil { | |||
if(CollUtil.isNotEmpty(purchases)){ | |||
purchases.stream().map(PurchaseVO::getTransactionAmount) | |||
.filter(Objects::nonNull).reduce(BigDecimal::add) | |||
.ifPresent(j -> approve.setReleaseYearMoney(j)); | |||
.ifPresent(approve::setReleaseYearMoney); | |||
} | |||
return approve; | |||
@@ -1,11 +1,10 @@ | |||
package com.hz.pm.api.irs.controller; | |||
import com.ningdatech.log.annotation.WebLog; | |||
import com.hz.pm.api.irs.model.dto.ForwardDTO; | |||
import com.hz.pm.api.projectdeclared.manage.IrsManage; | |||
import com.hz.pm.api.projectdeclared.model.vo.IrsApplicationVO; | |||
import com.hz.pm.api.projectdeclared.model.vo.PiotTasksVO; | |||
import com.hz.pm.api.scheduler.task.SynProjectCoreBizTask; | |||
import com.ningdatech.log.annotation.WebLog; | |||
import io.swagger.annotations.Api; | |||
import io.swagger.annotations.ApiOperation; | |||
import lombok.RequiredArgsConstructor; | |||
@@ -56,7 +55,7 @@ public class IrsController { | |||
@ApiOperation(value = "获取企业社会信用编码", notes = "获取企业社会信用编码") | |||
@GetMapping("/get-credit-code") | |||
public String getCreditCode() throws NoSuchAlgorithmException, UnsupportedEncodingException { | |||
public String getCreditCode() throws NoSuchAlgorithmException { | |||
return irsManage.getCreditCode(); | |||
} | |||
@@ -1,18 +1,17 @@ | |||
package com.hz.pm.api.irs.controller; | |||
import com.ningdatech.basic.model.PageVo; | |||
import com.hz.pm.api.dashboard.model.vo.ProtraitProjectOutputVO; | |||
import com.hz.pm.api.irs.manage.IrsProjectManage; | |||
import com.hz.pm.api.projectlib.model.req.ProjectListReq; | |||
import com.hz.pm.api.projectlib.model.vo.ProjectLibListItemVO; | |||
import com.ningdatech.basic.model.PageVo; | |||
import io.swagger.annotations.Api; | |||
import io.swagger.annotations.ApiOperation; | |||
import lombok.RequiredArgsConstructor; | |||
import lombok.extern.slf4j.Slf4j; | |||
import org.springframework.validation.annotation.Validated; | |||
import org.springframework.web.bind.annotation.*; | |||
import java.util.List; | |||
import org.springframework.web.bind.annotation.GetMapping; | |||
import org.springframework.web.bind.annotation.RequestMapping; | |||
import org.springframework.web.bind.annotation.RestController; | |||
/** | |||
* @Classname IrsController | |||
@@ -8,7 +8,7 @@ import com.alibaba.fastjson.JSONObject; | |||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |||
import com.hz.pm.api.common.model.constant.RegionConst; | |||
import com.hz.pm.api.common.enumeration.CommonEnum; | |||
import com.hz.pm.api.common.statemachine.util.StateMachineUtils; | |||
import com.hz.pm.api.common.statemachine.util.StateMachineUtil; | |||
import com.hz.pm.api.common.util.CryptUtils; | |||
import com.hz.pm.api.common.util.HttpUtil; | |||
import com.hz.pm.api.irs.model.dto.ApiApplyDTO; | |||
@@ -54,7 +54,7 @@ public class AppIrsManage { | |||
private final IProjectApplicationService applicationService; | |||
private final StateMachineUtils stateMachineUtils; | |||
private final StateMachineUtil stateMachineUtil; | |||
@Value("${irs.push-app.appKey}") | |||
private String pushAppKey; | |||
@@ -172,7 +172,7 @@ public class AppIrsManage { | |||
//如果筛选出来的 为空的话 就调用状态机 | |||
if (CollUtil.isEmpty(apps)) { | |||
stateMachineUtils.pass(project); | |||
stateMachineUtil.pass(project); | |||
project.setUpdateOn(LocalDateTime.now()); | |||
projectService.updateById(project); | |||
} | |||
@@ -66,10 +66,7 @@ public class IrsProjectManage { | |||
if(CollUtil.isEmpty(page.getRecords())){ | |||
return PageVo.empty(); | |||
} | |||
List<ProjectLibListItemVO> res = page.getRecords().stream().map(p -> { | |||
ProjectLibListItemVO vo = BeanUtil.copyProperties(p,ProjectLibListItemVO.class); | |||
return vo; | |||
}).collect(Collectors.toList()); | |||
List<ProjectLibListItemVO> res = page.getRecords().stream().map(p -> BeanUtil.copyProperties(p,ProjectLibListItemVO.class)).collect(Collectors.toList()); | |||
return PageVo.of(res,page.getTotal()); | |||
} | |||
@@ -15,10 +15,8 @@ import com.hz.pm.api.common.util.StrUtils; | |||
import com.hz.pm.api.expert.constant.ExpertApplyStatusEnum; | |||
import com.hz.pm.api.expert.constant.ExpertApplyTypeEnum; | |||
import com.hz.pm.api.expert.entity.ExpertMetaApply; | |||
import com.hz.pm.api.expert.entity.ExpertUserFullInfo; | |||
import com.hz.pm.api.expert.model.dto.ModifyApplyExtraInfoDTO; | |||
import com.hz.pm.api.expert.service.IExpertMetaApplyService; | |||
import com.hz.pm.api.expert.service.IExpertUserFullInfoService; | |||
import com.hz.pm.api.leave.entity.domain.ExpertLeave; | |||
import com.hz.pm.api.leave.entity.domain.ExpertLeaveDetail; | |||
import com.hz.pm.api.leave.entity.enumeration.LeaveStatusEnum; | |||
@@ -77,7 +75,6 @@ public class LeaveManage { | |||
private final IExpertLeaveDetailService leaveDetailService; | |||
private final IExpertMetaApplyService metaApplyService; | |||
private final FileService fileService; | |||
private final IExpertUserFullInfoService userFullInfoService; | |||
private final MeetingCallOrMsgHelper meetingCallOrMsgHelper; | |||
private static final int HOURS_BEFORE_MEETING = 2; | |||
@@ -1,129 +0,0 @@ | |||
//package com.hz.pm.api.meeting.builder; | |||
// | |||
// | |||
//import com.hz.pm.api.meeting.entity.domain.Meeting; | |||
//import com.hz.pm.api.meeting.entity.domain.MeetingExpert; | |||
//import com.hz.pm.api.sms.utils.DateUtil; | |||
// | |||
//import java.time.format.DateTimeFormatter; | |||
//import java.util.ArrayList; | |||
//import java.util.List; | |||
// | |||
///** | |||
// * <p> | |||
// * YxtSmsContextBuilder | |||
// * </p> | |||
// * | |||
// * @author WendyYang | |||
// * @since 14:19 2022/11/17 | |||
// */ | |||
//public class YxtSmsContextBuilder { | |||
// | |||
// private YxtSmsContextBuilder() { | |||
// } | |||
// | |||
// public static List<SendSmsContext> smsToExpertByCancelMeeting(Meeting meeting, List<MeetingExpert> experts, String meetingType) { | |||
// String holdCompany = meeting.getHoldCompanyBracket(); | |||
// String meetingTime = meeting.getStartTime().format(DateUtil.DTF_YMD_HM); | |||
// List<SendSmsContext> contexts = new ArrayList<>(); | |||
// for (MeetingExpert me : experts) { | |||
// SendSmsContext context = new SendSmsContext(); | |||
// context.setContent(holdCompany + String.format(YxtSmsTemplateConst.MEETING_CANCEL, | |||
// me.getExpertName(), meeting.getCancelRemark(), meetingTime, meetingType, meeting.getContact())); | |||
// context.setReceiveNumber(me.getMobile()); | |||
// contexts.add(context); | |||
// } | |||
// return contexts; | |||
// } | |||
// | |||
// public static List<SendSmsContext> smsToExpertBySendNotice(Meeting meeting, List<MeetingExpert> experts, String meetingType) { | |||
// String holdCompany = meeting.getHoldCompanyBracket(); | |||
// String meetingTime = meeting.getStartTime().format(DateUtil.DTF_YMD_HM); | |||
// List<SendSmsContext> contexts = new ArrayList<>(); | |||
// for (MeetingExpert me : experts) { | |||
// SendSmsContext context = new SendSmsContext(); | |||
// context.setContent(holdCompany + String.format(YxtSmsTemplateConst.SEND_MEETING_NOTICE, | |||
// me.getExpertName(), me.getUpdateOn().format(DateUtil.DTF_YMD_HM), | |||
// meetingType, meetingTime, meeting.getRegionDetail(), meeting.getContact())); | |||
// context.setReceiveNumber(me.getMobile()); | |||
// contexts.add(context); | |||
// } | |||
// return contexts; | |||
// } | |||
// | |||
// public static SendSmsContext smsToExpertByReplace(Meeting meeting, MeetingExpert expert, String meetingType) { | |||
// SendSmsContext context = new SendSmsContext(); | |||
// String holdCompany = meeting.getHoldCompanyBracket(); | |||
// context.setContent(holdCompany + String.format(YxtSmsTemplateConst.EXPERT_REPLACED, | |||
// expert.getExpertName(), | |||
// meeting.getStartTime().format(DateUtil.DTF_YMD_HM), | |||
// meetingType, | |||
// meeting.getContact() | |||
// )); | |||
// context.setReceiveNumber(expert.getMobile()); | |||
// return context; | |||
// } | |||
// | |||
// public static List<SendSmsContext> smsToExpertByMeetingChange(Meeting old, Meeting curr, List<MeetingExpert> experts, String meetingType) { | |||
// List<SendSmsContext> contexts = new ArrayList<>(); | |||
// String holdCompany = curr.getHoldCompanyBracket(); | |||
// String sTimeOld = old.getStartTime().format(DateUtil.DTF_YMD_HM); | |||
// String sTimeNew = curr.getStartTime().format(DateUtil.DTF_YMD_HM); | |||
// for (MeetingExpert me : experts) { | |||
// SendSmsContext context = new SendSmsContext(); | |||
// String content = String.format(YxtSmsTemplateConst.MEETING_INGO_CHANGE, me.getExpertName(), | |||
// sTimeOld, meetingType, sTimeNew, curr.getRegionDetail(), curr.getContact()); | |||
// context.setContent(holdCompany + content); | |||
// context.setReceiveNumber(me.getMobile()); | |||
// contexts.add(context); | |||
// } | |||
// return contexts; | |||
// } | |||
// | |||
// public static SendSmsContext smsToInvitorByExpertLeave(UserBasicInfo invitor, String meetingName, String expertName) { | |||
// SendSmsContext context = new SendSmsContext(); | |||
// context.setReceiveNumber(invitor.getPhoneNo()); | |||
// context.setContent(String.format(YxtSmsTemplateConst.TEMP_LEAVE_APPLY, invitor.getNickName(), | |||
// meetingName, expertName, WebProperties.webUrl)); | |||
// return context; | |||
// } | |||
// | |||
// public static SendSmsContext smsToExpertByLeavePassed(ExpertLeave leave, String leaveUser, String mobile) { | |||
// String smsContent = String.format(YxtSmsTemplateConst.LEAVE_APPLY_PASSED, leaveUser, | |||
// leave.getStartTime().format(DateTimeFormatter.ofPattern(DatePattern.YMD_HMS)), | |||
// leave.getEndTime().format(DateTimeFormatter.ofPattern(DatePattern.YMD_HMS))); | |||
// SendSmsContext context = new SendSmsContext(); | |||
// context.setContent(smsContent); | |||
// context.setReceiveNumber(mobile); | |||
// return context; | |||
// } | |||
// | |||
// public static SendSmsContext smsToExpertBtLeaveReject(String leaveUser, String mobile, String opinion) { | |||
// String smsContent = String.format(YxtSmsTemplateConst.LEAVE_APPLY_REFUSED, leaveUser, opinion); | |||
// SendSmsContext context = new SendSmsContext(); | |||
// context.setContent(smsContent); | |||
// context.setReceiveNumber(mobile); | |||
// return context; | |||
// } | |||
// | |||
// public static SendSmsContext smsByRandomInviteStop(String inviterName, String meetingName, String mobile) { | |||
// String smsContent = String.format(YxtSmsTemplateConst.RANDOM_INVITE_STOP, | |||
// inviterName, meetingName, WebProperties.webUrl | |||
// ); | |||
// SendSmsContext context = new SendSmsContext(); | |||
// context.setContent(smsContent); | |||
// context.setReceiveNumber(mobile); | |||
// return context; | |||
// } | |||
// | |||
// | |||
// public static SendSmsContext meetingInviteCompleteNotice(Meeting meeting) { | |||
// String smsContent = String.format(YxtSmsTemplateConst.RANDOM_EXTRACTION_COMPLETED, | |||
// meeting.getConnecter(), meeting.getName(), WebProperties.webUrl | |||
// ); | |||
// SendSmsContext context = new SendSmsContext(); | |||
// context.setContent(smsContent); | |||
// context.setReceiveNumber(meeting.getContact()); | |||
// return context; | |||
// } | |||
//} |
@@ -10,8 +10,6 @@ import lombok.AllArgsConstructor; | |||
import org.springframework.validation.annotation.Validated; | |||
import org.springframework.web.bind.annotation.*; | |||
import javax.validation.Valid; | |||
/** | |||
* <p> | |||
* 前端控制器 | |||
@@ -1,7 +1,6 @@ | |||
package com.hz.pm.api.meeting.entity.domain; | |||
import com.baomidou.mybatisplus.annotation.*; | |||
import io.swagger.annotations.Api; | |||
import io.swagger.annotations.ApiModel; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Data; | |||
@@ -2,7 +2,6 @@ package com.hz.pm.api.meeting.entity.dto; | |||
import lombok.AllArgsConstructor; | |||
import lombok.Data; | |||
import lombok.RequiredArgsConstructor; | |||
import java.util.List; | |||
@@ -3,9 +3,7 @@ package com.hz.pm.api.meeting.entity.vo; | |||
import com.alibaba.fastjson.annotation.JSONField; | |||
import io.swagger.annotations.ApiModel; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Builder; | |||
import lombok.Data; | |||
import lombok.experimental.Tolerate; | |||
import java.time.LocalDateTime; | |||
@@ -31,7 +31,6 @@ import com.hz.pm.api.meeting.service.IMeetingExpertService; | |||
import com.hz.pm.api.meta.constant.ExpertDictTypeEnum; | |||
import com.hz.pm.api.meta.helper.DictionaryCache; | |||
import com.hz.pm.api.meta.model.dto.DictionaryDTO; | |||
import com.hz.pm.api.sys.model.dto.RegionDTO; | |||
import com.ningdatech.basic.exception.BizException; | |||
import com.ningdatech.basic.util.CollUtils; | |||
import lombok.AllArgsConstructor; | |||
@@ -34,10 +34,10 @@ public class YxtCallOrSmsHelper { | |||
} | |||
public void sendSms(List<SendSmsContext> smsList) { | |||
yxtClient.submitSmsTask(new SendSmsCmd() {{ | |||
setContextList(smsList); | |||
setSmsSignEnum(YxtSmsSignEnum.LS_BIG_DATA_BUREAU); | |||
}}); | |||
SendSmsCmd cmd = new SendSmsCmd(); | |||
cmd.setContextList(smsList); | |||
cmd.setSmsSignEnum(YxtSmsSignEnum.LS_BIG_DATA_BUREAU); | |||
yxtClient.submitSmsTask(cmd); | |||
} | |||
public void sendSms(SendSmsContext sms) { | |||
@@ -7,34 +7,41 @@ import com.hz.pm.api.meta.model.vo.ResTagTreeVO; | |||
import org.apache.commons.collections4.CollectionUtils; | |||
import java.util.ArrayList; | |||
import java.util.Collections; | |||
import java.util.List; | |||
import java.util.stream.Collectors; | |||
/** | |||
* @author liuxinxin | |||
* @date 2022/7/22 上午9:57 | |||
* <p> | |||
* MetaTagAssembler | |||
* </p> | |||
* | |||
* @author WendyYang | |||
* @since 17:06 2024/1/8 | |||
*/ | |||
public class MetaTagAssembler { | |||
public static TagDTO toTagDTO(MetaTag metaTagManage) { | |||
private MetaTagAssembler() { | |||
} | |||
public static TagDTO convert(MetaTag metaTag) { | |||
TagDTO tagDTO = new TagDTO(); | |||
tagDTO.setParentCode(metaTagManage.getParentCode()); | |||
tagDTO.setTagCode(metaTagManage.getTagCode()); | |||
tagDTO.setTagLevel(metaTagManage.getTagLevel()); | |||
tagDTO.setTagName(metaTagManage.getTagName()); | |||
tagDTO.setParentCode(metaTag.getParentCode()); | |||
tagDTO.setTagCode(metaTag.getTagCode()); | |||
tagDTO.setTagLevel(metaTag.getTagLevel()); | |||
tagDTO.setTagName(metaTag.getTagName()); | |||
return tagDTO; | |||
} | |||
public static List<TagTreeDTO> toTagTreeDTOList(List<TagDTO> tagDTOList) { | |||
if (CollectionUtils.isEmpty(tagDTOList)) { | |||
return new ArrayList<>(); | |||
public static List<TagTreeDTO> convert(List<TagDTO> tagList) { | |||
if (CollectionUtils.isEmpty(tagList)) { | |||
return Collections.emptyList(); | |||
} | |||
return tagDTOList.stream().map(MetaTagAssembler::toTagTreeDTO).collect(Collectors.toList()); | |||
return tagList.stream().map(MetaTagAssembler::convert).collect(Collectors.toList()); | |||
} | |||
public static TagTreeDTO toTagTreeDTO(TagDTO tagDTO) { | |||
public static TagTreeDTO convert(TagDTO tagDTO) { | |||
TagTreeDTO tagTreeDTO = new TagTreeDTO(); | |||
tagTreeDTO.setParentCode(tagDTO.getParentCode()); | |||
tagTreeDTO.setTagCode(tagDTO.getTagCode()); | |||
@@ -43,7 +50,7 @@ public class MetaTagAssembler { | |||
return tagTreeDTO; | |||
} | |||
public static List<ResTagTreeVO> toTagTreeVOList(List<TagTreeDTO> tagTreeDTOList) { | |||
public static List<ResTagTreeVO> to(List<TagTreeDTO> tagTreeDTOList) { | |||
List<ResTagTreeVO> resTagTreeVOList = new ArrayList<>(); | |||
for (TagTreeDTO tagTreeDTO : tagTreeDTOList) { | |||
ResTagTreeVO resTagTreeVO = new ResTagTreeVO(); | |||
@@ -53,7 +60,7 @@ public class MetaTagAssembler { | |||
resTagTreeVO.setTagCode(tagTreeDTO.getTagCode()); | |||
resTagTreeVO.setUnionCode(tagTreeDTO.getTagName() + "##" + tagTreeDTO.getTagCode()); | |||
if (CollectionUtils.isNotEmpty(tagTreeDTO.getChildren())) { | |||
resTagTreeVO.setChildren(toTagTreeVOList(tagTreeDTO.getChildren())); | |||
resTagTreeVO.setChildren(to(tagTreeDTO.getChildren())); | |||
} | |||
resTagTreeVOList.add(resTagTreeVO); | |||
} | |||
@@ -51,7 +51,7 @@ public abstract class AbstractTagsCache implements InitializingBean, TagCache { | |||
// 查询全部 | |||
List<TagDTO> tags = metaTagService.queryLeLevel(Integer.parseInt(key)); | |||
putToTagMap(tags); | |||
return toTree(MetaTagAssembler.toTagTreeDTOList(tags)); | |||
return toTree(MetaTagAssembler.convert(tags)); | |||
} | |||
@Override | |||
@@ -75,7 +75,7 @@ public abstract class AbstractTagsCache implements InitializingBean, TagCache { | |||
List<TagDTO> tagsByLevel = allTags.stream() | |||
.filter(w -> w.getTagLevel() <= currLevel) | |||
.collect(Collectors.toList()); | |||
mapByKeys.put(String.valueOf(currLevel), toTree(MetaTagAssembler.toTagTreeDTOList(tagsByLevel))); | |||
mapByKeys.put(String.valueOf(currLevel), toTree(MetaTagAssembler.convert(tagsByLevel))); | |||
}); | |||
return mapByKeys; | |||
} | |||
@@ -119,24 +119,24 @@ public class MetaManage { | |||
tagTreeDTOList.add(tagTreeDTO); | |||
} | |||
} | |||
return MetaTagAssembler.toTagTreeVOList(tagTreeDTOList); | |||
return MetaTagAssembler.to(tagTreeDTOList); | |||
} | |||
/** | |||
* 专家管理员才能调用 | |||
* | |||
* @param reqAddDictionaryPO | |||
* @param req \ | |||
*/ | |||
@Transactional(rollbackFor = Exception.class) | |||
public void addDictionary(ReqAddDictionaryPO reqAddDictionaryPO) { | |||
String dictionaryType = reqAddDictionaryPO.getDictionaryType(); | |||
public void addDictionary(ReqAddDictionaryPO req) { | |||
String dictionaryType = req.getDictionaryType(); | |||
boolean contains = ExpertDictTypeEnum.contains(dictionaryType); | |||
if (!contains) { | |||
throw BizException.wrap("无效的专家字典类型:%s", dictionaryType); | |||
} | |||
String name = reqAddDictionaryPO.getName(); | |||
Integer sortValue = reqAddDictionaryPO.getSortValue(); | |||
String name = req.getName(); | |||
Integer sortValue = req.getSortValue(); | |||
LambdaQueryWrapper<MetaDictionary> eq = Wrappers.lambdaQuery(MetaDictionary.class).eq(MetaDictionary::getDictionaryType, dictionaryType); | |||
List<MetaDictionary> dictionaryManageList = metaDictionaryManageService.list(eq); | |||
@@ -232,8 +232,8 @@ public class MetaManage { | |||
}).collect(Collectors.toList()); | |||
} | |||
public List<ResTagListVO> tagQuery(ReqTagQueryPO reqTagQueryPO) { | |||
String parentCode = reqTagQueryPO.getParentCode(); | |||
public List<ResTagListVO> tagQuery(ReqTagQueryPO req) { | |||
String parentCode = req.getParentCode(); | |||
if (StringUtils.isBlank(parentCode)) { | |||
parentCode = TagConst.TAG_ROOT_PARENT_CODE; | |||
} | |||
@@ -1,17 +1,16 @@ | |||
package com.hz.pm.api.meta.service.impl; | |||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |||
import com.hz.pm.api.meta.model.entity.MetaDictionary; | |||
import com.hz.pm.api.meta.mapper.MetaDictionaryMapper; | |||
import com.hz.pm.api.meta.service.IMetaDictionaryService; | |||
import com.hz.pm.api.meta.assembler.MetaDictionaryAssembler; | |||
import com.hz.pm.api.meta.mapper.MetaDictionaryMapper; | |||
import com.hz.pm.api.meta.model.dto.DictionaryDTO; | |||
import com.hz.pm.api.meta.model.entity.MetaDictionary; | |||
import com.hz.pm.api.meta.service.IMetaDictionaryService; | |||
import com.ningdatech.basic.util.CollUtils; | |||
import org.springframework.stereotype.Service; | |||
import java.util.Collection; | |||
import java.util.List; | |||
import java.util.stream.Collectors; | |||
/** | |||
* <p> | |||
@@ -2,15 +2,14 @@ package com.hz.pm.api.meta.service.impl; | |||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |||
import com.hz.pm.api.meta.assembler.MetaTagAssembler; | |||
import com.hz.pm.api.meta.model.entity.MetaTag; | |||
import com.hz.pm.api.meta.mapper.MetaTagMapper; | |||
import com.hz.pm.api.meta.model.dto.TagDTO; | |||
import com.hz.pm.api.meta.model.entity.MetaTag; | |||
import com.hz.pm.api.meta.service.IMetaTagService; | |||
import com.ningdatech.basic.util.CollUtils; | |||
import org.springframework.stereotype.Service; | |||
import java.util.List; | |||
import java.util.stream.Collectors; | |||
/** | |||
* <p> | |||
@@ -27,7 +26,7 @@ public class MetaTagServiceImpl extends ServiceImpl<MetaTagMapper, MetaTag> impl | |||
@Override | |||
public List<TagDTO> queryAll() { | |||
List<MetaTag> allTags = this.lambdaQuery().ne(MetaTag::getId, -1).list(); | |||
return CollUtils.convert(allTags, MetaTagAssembler::toTagDTO); | |||
return CollUtils.convert(allTags, MetaTagAssembler::convert); | |||
} | |||
@Override | |||
@@ -36,7 +35,7 @@ public class MetaTagServiceImpl extends ServiceImpl<MetaTagMapper, MetaTag> impl | |||
.ne(MetaTag::getId, -1) | |||
.le(MetaTag::getTagLevel, level) | |||
.list(); | |||
return CollUtils.convert(allTags, MetaTagAssembler::toTagDTO); | |||
return CollUtils.convert(allTags, MetaTagAssembler::convert); | |||
} | |||
@@ -95,8 +95,8 @@ public class OrganizationManage { | |||
} | |||
public List<OrganizationTreeVO> getChildOrganizationList(String parentCode, String orgName, Boolean onlyUnit) { | |||
List<String> parentCodeList = new ArrayList<>(); | |||
List<DingOrganization> dingOrganizationList = new ArrayList<>(); | |||
List<String> parentCodeList; | |||
List<DingOrganization> dingOrganizationList; | |||
if (StrUtils.isBlank(parentCode)) { | |||
parentCodeList = dingOrganizationProperties.getDeptVisibleScopes(); | |||
dingOrganizationList = iDingOrganizationService.list(Wrappers.lambdaQuery(DingOrganization.class) | |||
@@ -24,9 +24,6 @@ public class OrganizationSynthesizeTreeVO { | |||
@ApiModelProperty("名称") | |||
private String name; | |||
// @ApiModelProperty("自己组织列表") | |||
// private List<OrganizationSynthesizeTreeVO> childOrganizationList; | |||
@ApiModelProperty("组织下成员列表") | |||
private List<OrganizationMemberInfo> memberList; | |||
@@ -37,5 +37,5 @@ public class OrganizationTreeVO { | |||
// private Boolean isLeaf; | |||
// | |||
@ApiModelProperty(value = "社会同一信用代码") | |||
private String unifiedSocialCreditCode;; | |||
private String unifiedSocialCreditCode; | |||
} |
@@ -86,11 +86,10 @@ public class PerformanceAppraisalConveter { | |||
*/ | |||
public static Boolean checkCanSelfAppraisal(PerformanceAppraisalProject appraisalProject) { | |||
if (Objects.nonNull(appraisalProject.getSelfAppraisalStart()) | |||
&& Objects.nonNull(appraisalProject.getSelfAppraisalEnd())) { | |||
if (LocalDateTime.now().compareTo(appraisalProject.getSelfAppraisalStart()) > 0 && | |||
LocalDateTime.now().compareTo(appraisalProject.getSelfAppraisalEnd()) < 0) { | |||
&& Objects.nonNull(appraisalProject.getSelfAppraisalEnd()) && (LocalDateTime.now().isAfter(appraisalProject.getSelfAppraisalStart()) && | |||
LocalDateTime.now().isBefore(appraisalProject.getSelfAppraisalEnd()))) { | |||
return Boolean.TRUE; | |||
} | |||
} | |||
return Boolean.FALSE; | |||
} | |||
@@ -502,7 +502,7 @@ public class OrgSelfAppraisalManage { | |||
.sheet(fileName) | |||
.doWrite(exportDataList); | |||
} catch (IOException e) { | |||
throw new RuntimeException(e); | |||
throw new BizException(e); | |||
} | |||
} | |||
@@ -2,7 +2,6 @@ package com.hz.pm.api.performance.mapper; | |||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |||
import com.hz.pm.api.performance.model.entity.PerformanceAppraisal; | |||
import com.hz.pm.api.projectlib.model.entity.Project; | |||
/** | |||
* <p> | |||
@@ -1,7 +1,6 @@ | |||
package com.hz.pm.api.performance.mapper; | |||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |||
import com.hz.pm.api.performance.model.entity.PerformanceAppraisal; | |||
import com.hz.pm.api.performance.model.entity.PerformanceAppraisalProject; | |||
/** | |||
@@ -1,15 +1,12 @@ | |||
package com.hz.pm.api.performance.model.dto; | |||
import com.alibaba.fastjson.annotation.JSONField; | |||
import io.swagger.annotations.ApiModel; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Data; | |||
import org.hibernate.validator.constraints.Range; | |||
import javax.validation.constraints.NotBlank; | |||
import javax.validation.constraints.NotNull; | |||
import java.io.Serializable; | |||
import java.time.LocalDateTime; | |||
import java.util.List; | |||
/** | |||
@@ -1,14 +1,10 @@ | |||
package com.hz.pm.api.performance.model.dto; | |||
import com.baomidou.mybatisplus.annotation.IdType; | |||
import com.baomidou.mybatisplus.annotation.TableId; | |||
import com.baomidou.mybatisplus.annotation.TableName; | |||
import io.swagger.annotations.ApiModel; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Data; | |||
import java.io.Serializable; | |||
import java.time.LocalDateTime; | |||
import java.util.List; | |||
/** | |||
@@ -1,19 +1,12 @@ | |||
package com.hz.pm.api.performance.model.dto; | |||
import java.io.Serializable; | |||
import java.math.BigDecimal; | |||
import java.time.LocalDateTime; | |||
import javax.validation.constraints.Size; | |||
import com.baomidou.mybatisplus.annotation.IdType; | |||
import com.baomidou.mybatisplus.annotation.TableId; | |||
import org.hibernate.validator.constraints.Range; | |||
import io.swagger.annotations.ApiModel; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Data; | |||
import java.io.Serializable; | |||
import java.math.BigDecimal; | |||
/** | |||
* 绩效评级-应用指标库 新增指标保存 | |||
* @return | |||
@@ -1,17 +1,13 @@ | |||
package com.hz.pm.api.performance.model.dto; | |||
import java.io.Serializable; | |||
import java.math.BigDecimal; | |||
import java.util.List; | |||
import com.baomidou.mybatisplus.annotation.IdType; | |||
import com.baomidou.mybatisplus.annotation.TableId; | |||
import io.swagger.annotations.ApiModel; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Data; | |||
import org.hibernate.validator.constraints.Range; | |||
import javax.validation.constraints.Size; | |||
import java.io.Serializable; | |||
import java.math.BigDecimal; | |||
/** | |||
* 绩效评级-项目指标库 新增指标保存 | |||
@@ -1,6 +1,5 @@ | |||
package com.hz.pm.api.performance.model.entity; | |||
import com.alibaba.fastjson.annotation.JSONField; | |||
import com.baomidou.mybatisplus.annotation.IdType; | |||
import com.baomidou.mybatisplus.annotation.TableId; | |||
import com.baomidou.mybatisplus.annotation.TableName; | |||
@@ -5,12 +5,10 @@ import com.baomidou.mybatisplus.annotation.TableId; | |||
import com.baomidou.mybatisplus.annotation.TableName; | |||
import io.swagger.annotations.ApiModel; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import liquibase.pro.packaged.I; | |||
import lombok.Data; | |||
import java.io.Serializable; | |||
import java.time.LocalDateTime; | |||
import java.util.List; | |||
/** | |||
* @Classname PerformanceIndicatorTemplate | |||
@@ -1,6 +1,5 @@ | |||
package com.hz.pm.api.performance.model.vo; | |||
import com.hz.pm.api.performance.model.dto.ProjectTemplateDetailDTO; | |||
import io.swagger.annotations.ApiModel; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Data; | |||
@@ -1,16 +1,13 @@ | |||
package com.hz.pm.api.performance.model.vo; | |||
import java.io.Serializable; | |||
import java.math.BigDecimal; | |||
import java.time.LocalDateTime; | |||
import java.util.List; | |||
import com.baomidou.mybatisplus.annotation.IdType; | |||
import com.baomidou.mybatisplus.annotation.TableId; | |||
import io.swagger.annotations.ApiModel; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Data; | |||
import java.io.Serializable; | |||
import java.math.BigDecimal; | |||
import java.time.LocalDateTime; | |||
/** | |||
* 绩效评价-项目指标库 | |||
* @return | |||
@@ -7,7 +7,6 @@ package com.hz.pm.api.performance.util; | |||
import cn.hutool.core.util.CharsetUtil; | |||
import com.ningdatech.basic.exception.BizException; | |||
import com.wflow.config.ResponseCode; | |||
import java.io.UnsupportedEncodingException; | |||
import java.net.URLEncoder; | |||
@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |||
import com.google.common.collect.Lists; | |||
import com.hz.pm.api.common.model.constant.BizConst; | |||
import com.hz.pm.api.common.helper.UserInfoHelper; | |||
import com.hz.pm.api.common.statemachine.util.StateMachineUtils; | |||
import com.hz.pm.api.common.statemachine.util.StateMachineUtil; | |||
import com.hz.pm.api.common.util.ExcelDownUtil; | |||
import com.hz.pm.api.common.util.ExcelExportStyle; | |||
import com.hz.pm.api.projectdeclared.model.dto.ContractSaveDTO; | |||
@@ -79,7 +79,7 @@ public class ConstructionManage { | |||
private final IPreInsAcceptancePersonService acceptancePersonService; | |||
private final StateMachineUtils stateMachineUtils; | |||
private final StateMachineUtil stateMachineUtil; | |||
/** | |||
* 待采购的-项目列表 | |||
@@ -349,7 +349,7 @@ public class ConstructionManage { | |||
//判断下 如果和初验都完成了 才进入下一阶段 | |||
if (StringUtils.isNotBlank(project.getPreliminaryInspectionMaterials())) { | |||
//进入到下一状态 | |||
stateMachineUtils.pass(project); | |||
stateMachineUtil.pass(project); | |||
} | |||
project.setUpdateOn(LocalDateTime.now()); | |||
if (Objects.nonNull(dto.getDeliveryTime())) { | |||
@@ -540,7 +540,7 @@ public class ConstructionManage { | |||
//判断下 如果和初验都完成了 才进入下一阶段 | |||
if (Objects.nonNull(project.getDeliveryTime())) { | |||
//进入到下一状态 | |||
stateMachineUtils.pass(project); | |||
stateMachineUtil.pass(project); | |||
} | |||
project.setUpdateOn(LocalDateTime.now()); | |||
project.setPreliminaryInspectionMaterials(dto.getPreliminaryInspectionMaterials()); | |||
@@ -12,7 +12,7 @@ import com.hz.pm.api.common.enumeration.CommonEnum; | |||
import com.hz.pm.api.common.enumeration.ProjectProcessStageEnum; | |||
import com.hz.pm.api.common.helper.RegionCacheHelper; | |||
import com.hz.pm.api.common.helper.UserInfoHelper; | |||
import com.hz.pm.api.common.statemachine.util.StateMachineUtils; | |||
import com.hz.pm.api.common.statemachine.util.StateMachineUtil; | |||
import com.hz.pm.api.common.util.ExcelDownUtil; | |||
import com.hz.pm.api.common.util.ExcelExportStyle; | |||
import com.hz.pm.api.projectdeclared.model.dto.ConstructionPlanExportDTO; | |||
@@ -79,7 +79,7 @@ public class ConstructionPlanManage { | |||
private final IProjectService projectService; | |||
private final ProcessInstanceService processService; | |||
private final ProcessModelService processModelService; | |||
private final StateMachineUtils stateMachineUtils; | |||
private final StateMachineUtil stateMachineUtil; | |||
private final IProjectInstService projectInstService; | |||
private final ProjectLibManage projectLibManage; | |||
private final UserInfoHelper userInfoHelper; | |||
@@ -159,8 +159,8 @@ public class ConstructionPlanManage { | |||
//如果被禁用了的话 直接跳过 进入到下一个状态 | |||
if (Boolean.TRUE.equals(model.getIsStop())) { | |||
//被禁用了 调2次状态机 | |||
stateMachineUtils.pass(constructProject); | |||
stateMachineUtils.pass(constructProject); | |||
stateMachineUtil.pass(constructProject); | |||
stateMachineUtil.pass(constructProject); | |||
constructProject.setUpdateOn(LocalDateTime.now()); | |||
projectService.updateById(constructProject); | |||
return "因为建设方案流程被禁用了 直接跳过!"; | |||
@@ -194,7 +194,7 @@ public class ConstructionPlanManage { | |||
} | |||
private Project contructionPlanModifyProject(Project project, String instanceId) { | |||
stateMachineUtils.pass(project); | |||
stateMachineUtil.pass(project); | |||
project.setUpdateOn(LocalDateTime.now()); | |||
project.setInstCode(instanceId); | |||
projectService.updateById(project); | |||
@@ -249,7 +249,7 @@ public class ConstructionPlanManage { | |||
project.setInstCode(instanceId); | |||
project.setConstructionPlanFile(constructionPlanFile); | |||
//调用状态机 进入下一个通过状态 | |||
stateMachineUtils.pass(project); | |||
stateMachineUtil.pass(project); | |||
projectService.updateById(project); | |||
//保存项目和实例的关系 | |||
@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |||
import com.google.common.collect.Lists; | |||
import com.ningdatech.basic.exception.BizException; | |||
import com.ningdatech.basic.function.VUtils; | |||
import com.ningdatech.basic.model.PageVo; | |||
import com.ningdatech.basic.util.CollUtils; | |||
@@ -88,6 +89,7 @@ public class DelayedApplyManage { | |||
/** | |||
* 延期的-项目列表 | |||
* | |||
* @param req | |||
* @return | |||
*/ | |||
@@ -97,11 +99,11 @@ public class DelayedApplyManage { | |||
LambdaQueryWrapper<Project> query = ProjectHelper.projectQuery(req); | |||
//待终验 并且已经过期 | |||
//只能看自己单位的 | |||
query.eq(Project::getBuildOrgCode,user.getEmpPosUnitCode()); | |||
query.eq(Project::getStatus,ProjectStatusEnum.TO_BE_FINALLY_INSPECTED.getCode()); | |||
query.eq(Project::getStage,ProjectStatusEnum.PROJECT_APPROVED.getCode()); | |||
query.eq(Project::getBuildOrgCode, user.getEmpPosUnitCode()); | |||
query.eq(Project::getStatus, ProjectStatusEnum.TO_BE_FINALLY_INSPECTED.getCode()); | |||
query.eq(Project::getStage, ProjectStatusEnum.PROJECT_APPROVED.getCode()); | |||
query.lt(Project::getPlanAcceptanceTime, LocalDateTime.now()); | |||
query.eq(Project::getNewest,Boolean.TRUE); | |||
query.eq(Project::getNewest, Boolean.TRUE); | |||
query.isNotNull(Project::getApprovalDate); | |||
query.isNotNull(Project::getBuildCycle); | |||
query.orderByAsc(Project::getApprovalDate); | |||
@@ -167,18 +169,18 @@ public class DelayedApplyManage { | |||
LambdaQueryWrapper<Project> query = ProjectHelper.projectQuery(param); | |||
//待终验 | |||
//只能看自己单位的 | |||
query.eq(Project::getBuildOrgCode,user.getEmpPosUnitCode()); | |||
query.eq(Project::getStatus,ProjectStatusEnum.TO_BE_FINALLY_INSPECTED.getCode()); | |||
query.eq(Project::getStage,ProjectStatusEnum.PROJECT_APPROVED.getCode()); | |||
query.eq(Project::getNewest,Boolean.TRUE); | |||
query.eq(Project::getBuildOrgCode, user.getEmpPosUnitCode()); | |||
query.eq(Project::getStatus, ProjectStatusEnum.TO_BE_FINALLY_INSPECTED.getCode()); | |||
query.eq(Project::getStage, ProjectStatusEnum.PROJECT_APPROVED.getCode()); | |||
query.eq(Project::getNewest, Boolean.TRUE); | |||
query.isNotNull(Project::getApprovalDate); | |||
query.isNotNull(Project::getBuildCycle); | |||
query.orderByAsc(Project::getApprovalDate); | |||
List<Project> records = projectService.list(query); | |||
AtomicInteger serialNumber = new AtomicInteger(0); | |||
List<DeclaredProjectExportDTO> collect = Lists.newArrayList(); | |||
if(CollUtil.isNotEmpty(records)){ | |||
if (CollUtil.isNotEmpty(records)) { | |||
AtomicInteger rowNo = new AtomicInteger(0); | |||
collect = records.stream().map(r -> { | |||
DeclaredProjectExportDTO exportDTO = new DeclaredProjectExportDTO(); | |||
BeanUtils.copyProperties(r, exportDTO); | |||
@@ -186,7 +188,7 @@ public class DelayedApplyManage { | |||
exportDTO.setStatusName(ProjectStatusEnum.getDesc(r.getStatus())); | |||
String createOnStr = NdDateUtils.format(r.getCreateOn(), "yyyy-MM-dd HH:mm"); | |||
exportDTO.setCreateOn(createOnStr); | |||
exportDTO.setSerialNumber(serialNumber.incrementAndGet()); | |||
exportDTO.setSerialNumber(rowNo.incrementAndGet()); | |||
exportDTO.setPlanAcceptanceTime(Objects.nonNull(r.getPlanAcceptanceTime()) ? | |||
NdDateUtils.format(r.getPlanAcceptanceTime(), "yyyy-MM-dd") : StringUtils.EMPTY); | |||
return exportDTO; | |||
@@ -194,7 +196,7 @@ public class DelayedApplyManage { | |||
} | |||
String fileName = "待终验申请项目列表"; | |||
ExcelDownUtil.setFileName(fileName,response); | |||
ExcelDownUtil.setFileName(fileName, response); | |||
//数据导出处理函数 | |||
try { | |||
EasyExcel.write(response.getOutputStream(), DeclaredProjectExportDTO.class) | |||
@@ -203,14 +205,14 @@ public class DelayedApplyManage { | |||
.sheet(fileName) | |||
.doWrite(collect); | |||
} catch (IOException e) { | |||
throw new RuntimeException(e); | |||
} catch (Exception e) { | |||
throw new RuntimeException(e); | |||
log.error("待终验申请项目列表导出失败:{}", e.getMessage(), e); | |||
throw BizException.wrap("导出失败"); | |||
} | |||
} | |||
/** | |||
* 延期申请 | |||
* | |||
* @param dto | |||
* @return | |||
*/ | |||
@@ -229,7 +231,7 @@ public class DelayedApplyManage { | |||
.throwMessage("提交失败 该项目不是 已立项|待终验"); | |||
VUtils.isTrue(Objects.isNull(project.getPlanAcceptanceTime()) | |||
|| project.getPlanAcceptanceTime().compareTo(LocalDateTime.now()) <= 0) | |||
|| !project.getPlanAcceptanceTime().isAfter(LocalDateTime.now())) | |||
.throwMessage("当前项目还未过期验收"); | |||
return "申请发起成功"; | |||
@@ -237,6 +239,7 @@ public class DelayedApplyManage { | |||
/** | |||
* 开启延期申请审批流程 | |||
* | |||
* @param dto | |||
* @return | |||
*/ | |||
@@ -256,7 +259,7 @@ public class DelayedApplyManage { | |||
.throwMessage("提交失败 该项目不是 已立项|待终验"); | |||
VUtils.isTrue(Objects.isNull(project.getPlanAcceptanceTime()) | |||
|| project.getPlanAcceptanceTime().compareTo(LocalDateTime.now()) > 0) | |||
|| project.getPlanAcceptanceTime().isAfter(LocalDateTime.now())) | |||
.throwMessage("当前项目还未过期验收"); | |||
String regionCode = project.getAreaCode(); | |||
@@ -286,7 +289,7 @@ public class DelayedApplyManage { | |||
projectLibManage.saveProjectByApplyDelay(dto, project, instanceId); | |||
//发送给第一个审批人消息 | |||
noticeManage.sendFirtUser(project,model.getFormName(),instanceId, | |||
noticeManage.sendFirtUser(project, model.getFormName(), instanceId, | |||
WorkNoticeConstant.PASS_MSG_TEMPLATE, MsgTypeEnum.PROJECT_REVIEW); | |||
return instanceId; | |||
@@ -294,6 +297,7 @@ public class DelayedApplyManage { | |||
/** | |||
* 查询延期 详情 | |||
* | |||
* @param projectId | |||
* @return | |||
*/ | |||
@@ -302,14 +306,15 @@ public class DelayedApplyManage { | |||
.eq(ProjectDelayApply::getProjectId, projectId) | |||
.orderByDesc(ProjectDelayApply::getCreateOn) | |||
.last(BizConst.LIMIT_1)); | |||
if(Objects.isNull(delayApply)){ | |||
if (Objects.isNull(delayApply)) { | |||
return null; | |||
} | |||
return BeanUtil.copyProperties(delayApply,DelayedApplyVO.class); | |||
return BeanUtil.copyProperties(delayApply, DelayedApplyVO.class); | |||
} | |||
/** | |||
* 查看某个项目的 延期列表 | |||
* | |||
* @param projectId | |||
* @return | |||
*/ | |||
@@ -319,11 +324,11 @@ public class DelayedApplyManage { | |||
.in(ProjectDelayApply::getProjectId, allVersionProjectId) | |||
.eq(ProjectDelayApply::getSuccess, Boolean.TRUE)); | |||
if(CollUtil.isEmpty(delays)){ | |||
if (CollUtil.isEmpty(delays)) { | |||
return Collections.emptyList(); | |||
} | |||
return delays.stream().map(d -> BeanUtil.copyProperties(d,DelayedApplyVO.class)) | |||
return delays.stream().map(d -> BeanUtil.copyProperties(d, DelayedApplyVO.class)) | |||
.collect(Collectors.toList()); | |||
} | |||
} |
@@ -4,7 +4,7 @@ import cn.hutool.core.bean.BeanUtil; | |||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |||
import com.ningdatech.basic.function.VUtils; | |||
import com.hz.pm.api.common.model.constant.BizConst; | |||
import com.hz.pm.api.common.statemachine.util.StateMachineUtils; | |||
import com.hz.pm.api.common.statemachine.util.StateMachineUtil; | |||
import com.hz.pm.api.projectdeclared.model.dto.OperationDTO; | |||
import com.hz.pm.api.projectdeclared.model.entity.Operation; | |||
import com.hz.pm.api.projectdeclared.model.vo.OperationVO; | |||
@@ -36,7 +36,7 @@ public class OperationManage { | |||
private final IProjectService projectService; | |||
private final StateMachineUtils stateMachineUtils; | |||
private final StateMachineUtil stateMachineUtil; | |||
/** | |||
* 获取实施详情 | |||
@@ -84,7 +84,7 @@ public class OperationManage { | |||
//强制放入 计划终验时间 | |||
entity.setFinalInspectionDate(project.getPlanAcceptanceTime()); | |||
if(operationService.saveOrUpdate(entity)){ | |||
stateMachineUtils.pass(project); | |||
stateMachineUtil.pass(project); | |||
project.setUpdateOn(LocalDateTime.now()); | |||
projectService.updateById(project); | |||
} | |||
@@ -8,7 +8,7 @@ import com.google.common.collect.Lists; | |||
import com.hz.pm.api.common.enumeration.ProjectProcessStageEnum; | |||
import com.hz.pm.api.common.helper.UserInfoHelper; | |||
import com.hz.pm.api.common.model.constant.BizConst; | |||
import com.hz.pm.api.common.statemachine.util.StateMachineUtils; | |||
import com.hz.pm.api.common.statemachine.util.StateMachineUtil; | |||
import com.hz.pm.api.common.util.ExcelDownUtil; | |||
import com.hz.pm.api.common.util.ExcelExportStyle; | |||
import com.hz.pm.api.projectdeclared.model.dto.DefaultDeclaredDTO; | |||
@@ -73,7 +73,7 @@ public class PrequalificationDeclaredProjectManage { | |||
private final ProjectLibManage projectLibManage; | |||
private final StateMachineUtils stateMachineUtils; | |||
private final StateMachineUtil stateMachineUtil; | |||
private final IProjectStagingService projectStagingService; | |||
@@ -122,7 +122,7 @@ public class PrequalificationDeclaredProjectManage { | |||
if (StringUtils.isNotBlank(projectDto.getHigherLineSuperOrgReviewComments())) { | |||
projectInfo.setHigherLineSuperOrgReviewComments(projectDto.getHigherLineSuperOrgReviewComments()); | |||
} | |||
stateMachineUtils.pass(projectInfo); | |||
stateMachineUtil.pass(projectInfo); | |||
String instanceId = null; | |||
//如果是省级部门 需要联审的(申报金额大于1000万 并且是市级项目) | |||
if (ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS | |||
@@ -10,21 +10,21 @@ import com.hz.pm.api.common.util.ExcelExportStyle; | |||
import com.hz.pm.api.projectdeclared.model.dto.DefaultDeclaredDTO; | |||
import com.hz.pm.api.projectdeclared.model.dto.ProjectAdjustmentExportDTO; | |||
import com.hz.pm.api.projectdeclared.model.req.AdjustmentListReq; | |||
import com.hz.pm.api.projectdeclared.utils.GenerateProjectCodeUtil; | |||
import com.hz.pm.api.projectdeclared.utils.ReStartProcessMapUtil; | |||
import com.hz.pm.api.projectlib.model.enumeration.ProjectStatusEnum; | |||
import com.hz.pm.api.projectlib.model.enumeration.ProjectTypeNewEnum; | |||
import com.hz.pm.api.projectdeclared.utils.RestartProcessMapUtil; | |||
import com.hz.pm.api.projectlib.helper.ProjectHelper; | |||
import com.hz.pm.api.projectlib.manage.ProjectLibManage; | |||
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.enumeration.ProjectStatusEnum; | |||
import com.hz.pm.api.projectlib.model.enumeration.ProjectTypeNewEnum; | |||
import com.hz.pm.api.projectlib.model.req.ProjectListReq; | |||
import com.hz.pm.api.projectlib.model.vo.ProjectLibListItemVO; | |||
import com.hz.pm.api.projectlib.service.IProjectApplicationService; | |||
import com.hz.pm.api.projectlib.service.IProjectService; | |||
import com.hz.pm.api.user.security.model.UserFullInfoDTO; | |||
import com.hz.pm.api.user.util.LoginUserUtil; | |||
import com.ningdatech.basic.exception.BizException; | |||
import com.ningdatech.basic.function.VUtils; | |||
import com.ningdatech.basic.model.PageVo; | |||
import com.ningdatech.basic.util.NdDateUtils; | |||
@@ -40,6 +40,7 @@ import javax.servlet.http.HttpServletResponse; | |||
import java.io.IOException; | |||
import java.time.LocalDateTime; | |||
import java.util.Arrays; | |||
import java.util.Collections; | |||
import java.util.List; | |||
import java.util.Objects; | |||
import java.util.concurrent.atomic.AtomicInteger; | |||
@@ -61,17 +62,17 @@ public class ProjectAdjustmentManage { | |||
private final IProjectApplicationService projectApplicationService; | |||
private final ReStartProcessMapUtil reStartProcessMapUtil; | |||
private final RestartProcessMapUtil reStartProcessMapUtil; | |||
private final DefaultDeclaredProjectManage defaultDeclaredProjectManage; | |||
private final ProjectLibManage projectLibManage; | |||
private final UserInfoHelper userInfoHelper; | |||
private final GenerateProjectCodeUtil generateProjectCodeUtil; | |||
/** | |||
* 项目内容调整 | |||
* | |||
* @param dto | |||
* @return | |||
*/ | |||
@@ -83,25 +84,20 @@ public class ProjectAdjustmentManage { | |||
VUtils.isTrue(Objects.isNull(projectInfo)).throwMessage("调整失败 此项目不存在!"); | |||
//项目名称去重 | |||
if(StringUtils.isNotBlank(projectDto.getProjectName()) && | |||
!projectDto.getProjectName().equals(projectInfo.getProjectName())){ | |||
if (StringUtils.isNotBlank(projectDto.getProjectName()) && | |||
!projectDto.getProjectName().equals(projectInfo.getProjectName())) { | |||
projectDto.setProjectCode(projectInfo.getProjectCode()); | |||
defaultDeclaredProjectManage.checkDuplication(projectDto); | |||
} | |||
//金额check | |||
if(Objects.nonNull(projectDto.getDeclareAmount())){ | |||
if (Objects.nonNull(projectDto.getDeclareAmount())) { | |||
defaultDeclaredProjectManage.checkAmount(projectDto); | |||
} | |||
//修改项目内容 | |||
// if(!modifyProject(projectDto)){ | |||
// throw new BusinessException("调整项目失败!"); | |||
// } | |||
//最后去重新 提交项目流程 不同的状态 提交到不同的工作流去 | |||
Function<DefaultDeclaredDTO, String> declaredFunction = | |||
reStartProcessMapUtil.reStartProcessMap.get(projectInfo.getStatus()); | |||
RestartProcessMapUtil.getRestartFunction(projectInfo.getStatus()); | |||
VUtils.isTrue(Objects.isNull(declaredFunction)).throwMessage("状态不正常 没有找到对应申报函数!"); | |||
return declaredFunction.apply(dto); | |||
} | |||
@@ -109,16 +105,16 @@ public class ProjectAdjustmentManage { | |||
private Boolean modifyProject(ProjectDTO projectDto) { | |||
//先修改项目信息 | |||
Project project = new Project(); | |||
BeanUtils.copyProperties(projectDto,project); | |||
BeanUtils.copyProperties(projectDto, project); | |||
project.setUpdateOn(LocalDateTime.now()); | |||
if(!projectService.updateById(project)){ | |||
if (!projectService.updateById(project)) { | |||
throw new BusinessException("项目调整失败"); | |||
} | |||
//再修改应用信息 | |||
if(CollUtil.isNotEmpty(projectDto.getApplicationList())){ | |||
if (CollUtil.isNotEmpty(projectDto.getApplicationList())) { | |||
//采取批量删除 批量添加的方式 | |||
projectApplicationService.remove(Wrappers.lambdaQuery(ProjectApplication.class) | |||
.eq(ProjectApplication::getProjectId,project.getId())); | |||
.eq(ProjectApplication::getProjectId, project.getId())); | |||
//批量添加 | |||
List<ProjectApplication> applications = projectDto.getApplicationList().stream().map(application -> { | |||
ProjectApplication projectApplication = new ProjectApplication(); | |||
@@ -133,22 +129,26 @@ public class ProjectAdjustmentManage { | |||
return Boolean.TRUE; | |||
} | |||
private static final List<Integer> PROJECT_STATUS = Arrays.asList( | |||
ProjectStatusEnum.UNDER_INTERNAL_AUDIT_NOT_PASS.getCode(), | |||
ProjectStatusEnum.PREQUALIFICATION_FAILED.getCode(), | |||
ProjectStatusEnum.THE_JOINT_REVIEW_OF_PROVINCIAL_DEPARTMENTS_FAILED.getCode(), | |||
ProjectStatusEnum.SCHEME_REVIEW_FAILED.getCode()); | |||
/** | |||
* 项目库 | |||
* | |||
* @param preReq | |||
* @return | |||
*/ | |||
public PageVo<ProjectLibListItemVO> projectLibList(AdjustmentListReq preReq) { | |||
//限定参数 复制bean | |||
ProjectListReq req = new ProjectListReq(); | |||
BeanUtils.copyProperties(preReq,req); | |||
BeanUtils.copyProperties(preReq, req); | |||
//项目阶段 状态 已定 方案待申报 | |||
req.setStageList(Arrays.asList(ProjectStatusEnum.NOT_APPROVED.getCode())); | |||
req.setStageList(Collections.singletonList(ProjectStatusEnum.NOT_APPROVED.getCode())); | |||
//只有 单位内部审核不通过 省级联审不通过 预审不通过 建设方案不通过 4种状态 | |||
req.setStatusList(Arrays.asList(ProjectStatusEnum.UNDER_INTERNAL_AUDIT_NOT_PASS.getCode(), | |||
ProjectStatusEnum.PREQUALIFICATION_FAILED.getCode(), | |||
ProjectStatusEnum.THE_JOINT_REVIEW_OF_PROVINCIAL_DEPARTMENTS_FAILED.getCode(), | |||
ProjectStatusEnum.SCHEME_REVIEW_FAILED.getCode())); | |||
req.setStatusList(PROJECT_STATUS); | |||
UserFullInfoDTO user = userInfoHelper.getUserFullInfo(LoginUserUtil.getUserId()); | |||
VUtils.isTrue(Objects.isNull(user)).throwMessage("获取登录用户失败!"); | |||
//放入用户的单位 | |||
@@ -159,14 +159,11 @@ public class ProjectAdjustmentManage { | |||
public void exportList(HttpServletResponse response, AdjustmentListReq preReq) { | |||
//限定参数 复制bean | |||
ProjectListReq req = new ProjectListReq(); | |||
BeanUtils.copyProperties(preReq,req); | |||
BeanUtils.copyProperties(preReq, req); | |||
//项目阶段 状态 已定 方案待申报 | |||
req.setStageList(Arrays.asList(ProjectStatusEnum.NOT_APPROVED.getCode())); | |||
req.setStageList(Collections.singletonList(ProjectStatusEnum.NOT_APPROVED.getCode())); | |||
//只有 单位内部审核不通过 省级联审不通过 预审不通过 建设方案不通过 4种状态 | |||
req.setStatusList(Arrays.asList(ProjectStatusEnum.UNDER_INTERNAL_AUDIT_NOT_PASS.getCode(), | |||
ProjectStatusEnum.PREQUALIFICATION_FAILED.getCode(), | |||
ProjectStatusEnum.THE_JOINT_REVIEW_OF_PROVINCIAL_DEPARTMENTS_FAILED.getCode(), | |||
ProjectStatusEnum.SCHEME_REVIEW_FAILED.getCode())); | |||
req.setStatusList(PROJECT_STATUS); | |||
UserFullInfoDTO user = userInfoHelper.getUserFullInfo(LoginUserUtil.getUserId()); | |||
VUtils.isTrue(Objects.isNull(user)).throwMessage("获取登录用户失败!"); | |||
//放入用户的单位 | |||
@@ -187,7 +184,7 @@ public class ProjectAdjustmentManage { | |||
return exportDTO; | |||
}).collect(Collectors.toList()); | |||
String fileName = "项目内容调整列表"; | |||
ExcelDownUtil.setFileName(fileName,response); | |||
ExcelDownUtil.setFileName(fileName, response); | |||
//数据导出处理函数 | |||
try { | |||
EasyExcel.write(response.getOutputStream(), ProjectAdjustmentExportDTO.class) | |||
@@ -196,7 +193,7 @@ public class ProjectAdjustmentManage { | |||
.sheet(fileName) | |||
.doWrite(collect); | |||
} catch (IOException e) { | |||
throw new RuntimeException(e); | |||
throw new BizException(e); | |||
} | |||
} | |||
} |
@@ -12,7 +12,7 @@ import com.ningdatech.basic.model.PageVo; | |||
import com.ningdatech.basic.util.CollUtils; | |||
import com.ningdatech.basic.util.NdDateUtils; | |||
import com.hz.pm.api.common.helper.UserInfoHelper; | |||
import com.hz.pm.api.common.statemachine.util.StateMachineUtils; | |||
import com.hz.pm.api.common.statemachine.util.StateMachineUtil; | |||
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; | |||
@@ -61,7 +61,7 @@ public class PurchaseManage { | |||
private final IPurchaseService purchaseService; | |||
private final StateMachineUtils stateMachineUtils; | |||
private final StateMachineUtil stateMachineUtil; | |||
/** | |||
* 待采购的-项目列表 | |||
@@ -207,7 +207,7 @@ public class PurchaseManage { | |||
// } | |||
// } | |||
//进入到下一状态 | |||
stateMachineUtils.pass(project); | |||
stateMachineUtil.pass(project); | |||
project.setUpdateOn(LocalDateTime.now()); | |||
// 获取总的成交时间及金额 | |||
@@ -1,8 +1,5 @@ | |||
package com.hz.pm.api.projectdeclared.model.dto; | |||
import com.baomidou.mybatisplus.annotation.IdType; | |||
import com.baomidou.mybatisplus.annotation.TableId; | |||
import com.baomidou.mybatisplus.annotation.TableName; | |||
import io.swagger.annotations.ApiModel; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.AllArgsConstructor; | |||
@@ -1,13 +1,11 @@ | |||
package com.hz.pm.api.projectdeclared.model.dto; | |||
import com.fasterxml.jackson.annotation.JsonFormat; | |||
import io.swagger.annotations.ApiModel; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Data; | |||
import javax.validation.constraints.NotNull; | |||
import java.math.BigDecimal; | |||
import java.time.LocalDateTime; | |||
/** | |||
* @Classname PaymentPlan | |||
@@ -4,9 +4,6 @@ import io.swagger.annotations.ApiModel; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Data; | |||
import javax.validation.constraints.NotNull; | |||
import java.time.LocalDateTime; | |||
/** | |||
* @Classname PreInsAcceptancePerson | |||
* @Description 初验人员 | |||
@@ -1,14 +1,11 @@ | |||
package com.hz.pm.api.projectdeclared.model.dto; | |||
import com.fasterxml.jackson.annotation.JsonFormat; | |||
import io.swagger.annotations.ApiModel; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Data; | |||
import javax.validation.constraints.NotBlank; | |||
import javax.validation.constraints.NotNull; | |||
import java.math.BigDecimal; | |||
import java.time.LocalDateTime; | |||
import java.util.List; | |||
/** | |||
@@ -1,10 +1,10 @@ | |||
package com.hz.pm.api.projectdeclared.model.dto; | |||
import com.hz.pm.api.projectlib.model.dto.ProjectDTO; | |||
import com.wflow.workflow.bean.dto.ProcessInstanceUserDto; | |||
import io.swagger.annotations.ApiModel; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.*; | |||
import javax.validation.constraints.NotNull; | |||
import java.io.Serializable; | |||
@@ -1,12 +1,13 @@ | |||
package com.hz.pm.api.projectdeclared.model.entity; | |||
import com.baomidou.mybatisplus.annotation.*; | |||
import com.baomidou.mybatisplus.annotation.IdType; | |||
import com.baomidou.mybatisplus.annotation.TableId; | |||
import com.baomidou.mybatisplus.annotation.TableName; | |||
import io.swagger.annotations.ApiModel; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Data; | |||
import java.math.BigDecimal; | |||
import java.time.LocalDate; | |||
import java.time.LocalDateTime; | |||
/** | |||
@@ -7,7 +7,6 @@ import io.swagger.annotations.ApiModel; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Data; | |||
import java.math.BigDecimal; | |||
import java.time.LocalDateTime; | |||
/** | |||
@@ -1,8 +1,5 @@ | |||
package com.hz.pm.api.projectdeclared.model.vo; | |||
import com.baomidou.mybatisplus.annotation.IdType; | |||
import com.baomidou.mybatisplus.annotation.TableId; | |||
import com.baomidou.mybatisplus.annotation.TableName; | |||
import io.swagger.annotations.ApiModel; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Data; | |||
@@ -1,14 +1,9 @@ | |||
package com.hz.pm.api.projectdeclared.model.vo; | |||
import com.baomidou.mybatisplus.annotation.FieldFill; | |||
import com.baomidou.mybatisplus.annotation.TableField; | |||
import com.fasterxml.jackson.annotation.JsonFormat; | |||
import io.swagger.annotations.ApiModel; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Data; | |||
import java.math.BigDecimal; | |||
import java.time.LocalDateTime; | |||
import java.util.List; | |||
/** | |||
@@ -1,58 +0,0 @@ | |||
package com.hz.pm.api.projectdeclared.utils; | |||
import com.google.common.collect.Maps; | |||
import com.hz.pm.api.projectdeclared.manage.*; | |||
import com.hz.pm.api.projectdeclared.model.dto.DefaultDeclaredDTO; | |||
import com.hz.pm.api.projectlib.model.enumeration.ProjectStatusEnum; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.stereotype.Component; | |||
import java.util.Map; | |||
import java.util.function.Function; | |||
/** | |||
* @Classname ReSubmitProcessMap | |||
* @Description 项目调整 重新提交时的 事件函数MAP | |||
* @Date 2023/2/15 11:19 | |||
* @Author PoffyZhang | |||
*/ | |||
@Component | |||
public class ReStartProcessMapUtil { | |||
@Autowired | |||
private DeclaredProjectManage declaredProjectManage; | |||
@Autowired | |||
private ConstructionPlanManage constructionPlanManage; | |||
@Autowired | |||
private PrequalificationDeclaredProjectManage prequalificationDeclaredProjectManage; | |||
@Autowired | |||
private ReviewByProvincialDeptManage provincialDeptManage; | |||
@Autowired | |||
private FinalAcceptanceManage finalAcceptanceManage; | |||
public Map<Integer, Function<DefaultDeclaredDTO,String>> reStartProcessMap = Maps.newHashMap(); | |||
/** | |||
* 初始化业务分派逻辑,代替了if-else部分 | |||
* key: 枚举 状态值 | |||
* value: lambda表达式,最终会获取发起实例的函数 | |||
*/ | |||
public ReStartProcessMapUtil(){ | |||
//重新项目申报 | |||
reStartProcessMap.put(ProjectStatusEnum.UNDER_INTERNAL_AUDIT_NOT_PASS.getCode(), | |||
dto->declaredProjectManage.reStartTheProcess(dto)); | |||
//建设方案 | |||
reStartProcessMap.put(ProjectStatusEnum.SCHEME_REVIEW_FAILED.getCode(), | |||
dto->constructionPlanManage.restartTheProcess(dto)); | |||
//预审方案 | |||
reStartProcessMap.put(ProjectStatusEnum.PREQUALIFICATION_FAILED.getCode(), | |||
dto->prequalificationDeclaredProjectManage.restartTheProcess(dto)); | |||
//省级联审 | |||
reStartProcessMap.put(ProjectStatusEnum.THE_JOINT_REVIEW_OF_PROVINCIAL_DEPARTMENTS_FAILED.getCode(), | |||
dto->provincialDeptManage.restartTheProcess(dto)); | |||
//终审 | |||
reStartProcessMap.put(ProjectStatusEnum.FINAL_ACCEPTANCE_REVIEW_FAILED.getCode(), | |||
dto->finalAcceptanceManage.restartProcess(dto)); | |||
} | |||
} |
@@ -0,0 +1,51 @@ | |||
package com.hz.pm.api.projectdeclared.utils; | |||
import com.google.common.collect.Maps; | |||
import com.hz.pm.api.projectdeclared.manage.*; | |||
import com.hz.pm.api.projectdeclared.model.dto.DefaultDeclaredDTO; | |||
import com.hz.pm.api.projectlib.model.enumeration.ProjectStatusEnum; | |||
import org.springframework.stereotype.Component; | |||
import java.util.Map; | |||
import java.util.function.Function; | |||
/** | |||
* <p> | |||
* RestartProcessMapUtil - 项目调整 重新提交时的 事件函数MAP | |||
* </p> | |||
* | |||
* @author PoffyZhang | |||
* @since 2023/2/15 11:19 | |||
*/ | |||
@Component | |||
public class RestartProcessMapUtil { | |||
private static final Map<Integer, Function<DefaultDeclaredDTO, String>> RESTART_PROCESS_MAP = Maps.newHashMap(); | |||
public RestartProcessMapUtil(DeclaredProjectManage declaredProjectManage, | |||
ConstructionPlanManage constructionPlanManage, | |||
PrequalificationDeclaredProjectManage prequalificationDeclaredProjectManage, | |||
ReviewByProvincialDeptManage provincialDeptManage, | |||
FinalAcceptanceManage finalAcceptanceManage) { | |||
//重新项目申报 | |||
RESTART_PROCESS_MAP.put(ProjectStatusEnum.UNDER_INTERNAL_AUDIT_NOT_PASS.getCode(), | |||
declaredProjectManage::reStartTheProcess); | |||
//建设方案 | |||
RESTART_PROCESS_MAP.put(ProjectStatusEnum.SCHEME_REVIEW_FAILED.getCode(), | |||
constructionPlanManage::restartTheProcess); | |||
//预审方案 | |||
RESTART_PROCESS_MAP.put(ProjectStatusEnum.PREQUALIFICATION_FAILED.getCode(), | |||
prequalificationDeclaredProjectManage::restartTheProcess); | |||
//省级联审 | |||
RESTART_PROCESS_MAP.put(ProjectStatusEnum.THE_JOINT_REVIEW_OF_PROVINCIAL_DEPARTMENTS_FAILED.getCode(), | |||
provincialDeptManage::restartTheProcess); | |||
//终审 | |||
RESTART_PROCESS_MAP.put(ProjectStatusEnum.FINAL_ACCEPTANCE_REVIEW_FAILED.getCode(), | |||
finalAcceptanceManage::restartProcess); | |||
} | |||
public static Function<DefaultDeclaredDTO, String> getRestartFunction(Integer status) { | |||
return RESTART_PROCESS_MAP.get(status); | |||
} | |||
} |
@@ -1,5 +1,6 @@ | |||
package com.hz.pm.api.projectlib.handle; | |||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |||
import com.hz.pm.api.common.model.constant.BizConst; | |||
import com.hz.pm.api.common.model.constant.CommonConst; | |||
@@ -52,7 +53,7 @@ public class AnnualPlanHandle extends AbstractProcessBusinessHandle { | |||
DEPARTMENT_JOINT_REVIEW_FAILED | |||
); | |||
public AnnualPlanHandle(INdProjectStatusChangeService projectStatusChangeService, IProjectService projectService){ | |||
public AnnualPlanHandle(INdProjectStatusChangeService projectStatusChangeService, IProjectService projectService) { | |||
this.projectStatusChangeService = projectStatusChangeService; | |||
this.projectService = projectService; | |||
} | |||
@@ -69,7 +70,7 @@ public class AnnualPlanHandle extends AbstractProcessBusinessHandle { | |||
List<Long> allVersionProjectIds = projectService.getAllVersionProjectId(project); | |||
// 项目状态为年度计划中之前的状态 | |||
if (fieldList.contains(status)){ | |||
if (fieldList.contains(status)) { | |||
processDetailVO.setStepStatus(StepStatusEnum.NOT_START); | |||
processDetailVO.setProcessName(CommonConst.ANNUAL_PLAN); | |||
processSchedule.add(processDetailVO); | |||
@@ -77,33 +78,30 @@ public class AnnualPlanHandle extends AbstractProcessBusinessHandle { | |||
} | |||
// 项目状态为年度计划中 | |||
if (ProjectStatusEnum.IN_THE_ANNUAL_PLAN.getCode().equals(status)){ | |||
LambdaQueryWrapper<ProjectStatusChange> pscQuery = Wrappers.lambdaQuery(ProjectStatusChange.class) | |||
.in(ProjectStatusChange::getProjectId, allVersionProjectIds) | |||
.last(BizConst.LIMIT_1); | |||
if (ProjectStatusEnum.IN_THE_ANNUAL_PLAN.getCode().equals(status)) { | |||
// 根据部门联审通过的时间获取 | |||
ProjectStatusChange projectStatusChange = projectStatusChangeService.getOne(Wrappers.lambdaQuery(ProjectStatusChange.class) | |||
.in(ProjectStatusChange::getProjectId, allVersionProjectIds) | |||
.eq(ProjectStatusChange::getEvent, ProjectStatusChangeEvent.DEPARTMENT_UNITED_REVIEW_PASS.name()) | |||
.last(BizConst.LIMIT_1)); | |||
if(Objects.nonNull(projectStatusChange)){ | |||
pscQuery.eq(ProjectStatusChange::getEvent, ProjectStatusChangeEvent.DEPARTMENT_UNITED_REVIEW_PASS); | |||
ProjectStatusChange projectStatusChange = projectStatusChangeService.getOne(pscQuery); | |||
if (Objects.nonNull(projectStatusChange)) { | |||
processDetailVO.setFinishTime(projectStatusChange.getCreateOn()); | |||
processDetailVO.setStepStatus(StepStatusEnum.ON_GOING); | |||
} | |||
} else if (ProjectStatusEnum.BE_SUSPENDED.getCode().equals(status)) { | |||
// 根据年度计划暂缓的时间获取 | |||
ProjectStatusChange projectStatusChange = projectStatusChangeService.getOne(Wrappers.lambdaQuery(ProjectStatusChange.class) | |||
.in(ProjectStatusChange::getProjectId, allVersionProjectIds) | |||
.eq(ProjectStatusChange::getEvent, ProjectStatusChangeEvent.ANNUAL_PLAN_SUSPEND.name()) | |||
.last(BizConst.LIMIT_1)); | |||
if(Objects.nonNull(projectStatusChange)){ | |||
pscQuery.eq(ProjectStatusChange::getEvent, ProjectStatusChangeEvent.ANNUAL_PLAN_SUSPEND); | |||
ProjectStatusChange projectStatusChange = projectStatusChangeService.getOne(pscQuery); | |||
if (Objects.nonNull(projectStatusChange)) { | |||
processDetailVO.setFinishTime(projectStatusChange.getCreateOn()); | |||
processDetailVO.setStepStatus(StepStatusEnum.REJECTED); | |||
} | |||
} else { | |||
// 根据开启方案申报的时间获取 | |||
ProjectStatusChange projectStatusChange = projectStatusChangeService.getOne(Wrappers.lambdaQuery(ProjectStatusChange.class) | |||
.in(ProjectStatusChange::getProjectId, allVersionProjectIds) | |||
.eq(ProjectStatusChange::getEvent, ProjectStatusChangeEvent.ANNUAL_PLAN_PROJECT_OPEN_PLAN_DECLARE.name()) | |||
.last(BizConst.LIMIT_1)); | |||
if(Objects.nonNull(projectStatusChange)){ | |||
pscQuery.eq(ProjectStatusChange::getEvent, ProjectStatusChangeEvent.ANNUAL_PLAN_PROJECT_OPEN_PLAN_DECLARE); | |||
ProjectStatusChange projectStatusChange = projectStatusChangeService.getOne(pscQuery); | |||
if (Objects.nonNull(projectStatusChange)) { | |||
processDetailVO.setFinishTime(projectStatusChange.getCreateOn()); | |||
processDetailVO.setStepStatus(StepStatusEnum.COMPLETED); | |||
} | |||
@@ -6,7 +6,7 @@ import com.hz.pm.api.common.model.constant.BizConst; | |||
import com.hz.pm.api.common.model.constant.ProjectDeclareConst; | |||
import com.hz.pm.api.common.enumeration.ProjectProcessStageEnum; | |||
import com.hz.pm.api.common.statemachine.contant.RegionContant; | |||
import com.hz.pm.api.common.statemachine.util.StateMachineUtils; | |||
import com.hz.pm.api.common.statemachine.util.StateMachineUtil; | |||
import com.hz.pm.api.projectlib.model.entity.Project; | |||
import com.hz.pm.api.projectlib.service.IProjectService; | |||
import com.wflow.bean.entity.WflowModels; | |||
@@ -84,7 +84,7 @@ public class ProcessExecuteChainHandle { | |||
} | |||
} else if (processBusinessHandle instanceof ProvinceUnitedReviewHandle) { | |||
//省级联审 | |||
if (StateMachineUtils.isCityProject(project) && StateMachineUtils.judgeDeclareAmount(project, | |||
if (StateMachineUtil.isCityProject(project) && StateMachineUtil.judgeDeclareAmount(project, | |||
ProjectDeclareConst.Number.DECLARE_AMOUNT_JUDGEMENT)) { | |||
handles.add(processBusinessHandle); | |||
} | |||
@@ -16,7 +16,7 @@ import com.hz.pm.api.common.model.constant.CommonConst; | |||
import com.hz.pm.api.common.enumeration.CommonEnum; | |||
import com.hz.pm.api.common.helper.UserInfoHelper; | |||
import com.hz.pm.api.common.model.entity.ExcelExportWriter; | |||
import com.hz.pm.api.common.statemachine.util.StateMachineUtils; | |||
import com.hz.pm.api.common.statemachine.util.StateMachineUtil; | |||
import com.hz.pm.api.common.util.BizUtils; | |||
import com.hz.pm.api.common.util.ExcelDownUtil; | |||
import com.hz.pm.api.datascope.model.DataScopeDTO; | |||
@@ -80,7 +80,7 @@ public class AnnualPlanLibManage { | |||
private final IProjectService projectService; | |||
private final IProjectApplicationService applicationService; | |||
private final StateMachineUtils stateMachine; | |||
private final StateMachineUtil stateMachine; | |||
private final UserInfoHelper userInfoHelper; | |||
private final IProjectRenewalFundDeclarationService projectRenewalFundDeclarationService; | |||
@@ -25,7 +25,7 @@ import com.hz.pm.api.common.enumeration.ProjectProcessStageEnum; | |||
import com.hz.pm.api.common.helper.RegionCacheHelper; | |||
import com.hz.pm.api.common.helper.UserInfoHelper; | |||
import com.hz.pm.api.common.model.entity.ExcelExportWriter; | |||
import com.hz.pm.api.common.statemachine.util.StateMachineUtils; | |||
import com.hz.pm.api.common.statemachine.util.StateMachineUtil; | |||
import com.hz.pm.api.common.util.BizUtils; | |||
import com.hz.pm.api.common.util.ExcelDownUtil; | |||
import com.hz.pm.api.dashboard.handle.ApplicationHandler; | |||
@@ -93,6 +93,7 @@ import org.springframework.stereotype.Component; | |||
import javax.servlet.http.HttpServletResponse; | |||
import java.math.BigDecimal; | |||
import java.math.RoundingMode; | |||
import java.time.LocalDateTime; | |||
import java.util.*; | |||
import java.util.stream.Collectors; | |||
@@ -119,7 +120,7 @@ public class ProjectLibManage { | |||
private final IProjectApplicationService projectApplicationService; | |||
private final GenerateProjectCodeUtil generateProjectCodeUtil; | |||
private final IProjectInstService projectInstService; | |||
private final StateMachineUtils stateMachineUtils; | |||
private final StateMachineUtil stateMachineUtil; | |||
private final INdProjectDelayApplyService projectDelayApplyService; | |||
private final INdProjectApplyBorrowService projectApplyBorrowService; | |||
private final IDingOrganizationService dingOrganizationService; | |||
@@ -151,12 +152,11 @@ public class ProjectLibManage { | |||
LambdaQueryWrapper<Project> query = ProjectHelper.projectQuery(req); | |||
query.eq(Project::getNewest, Boolean.TRUE); | |||
Page<Project> page = projectService.page(req.page(), query); | |||
long total; | |||
if (CollUtil.isEmpty(page.getRecords())) { | |||
return PageVo.empty(); | |||
} | |||
// | |||
List<String> projectCodes = page.getRecords().stream() | |||
.map(Project::getProjectCode).collect(Collectors.toList()); | |||
@@ -208,7 +208,7 @@ public class ProjectLibManage { | |||
//项目查最新 | |||
query.eq(Project::getNewest, Boolean.TRUE); | |||
Page<Project> page = projectService.page(req.page(), query); | |||
long total; | |||
if (CollUtil.isEmpty(page.getRecords())) { | |||
return PageVo.empty(); | |||
} | |||
@@ -387,11 +387,10 @@ public class ProjectLibManage { | |||
public PageVo<ProjectLibListItemVO> projectAllListWithPermission(ProjectListReq req, UserFullInfoDTO user) { | |||
req = buildProjectLibPermission(req, user); | |||
Page<ProjectPO> page = projectService.pageAllWithPermission(req.page(), req); | |||
long total; | |||
if (CollUtil.isEmpty(page.getRecords())) { | |||
return PageVo.empty(); | |||
} | |||
UserFullInfoDTO finalUser = user; | |||
Set<String> projectCodes = page.getRecords().stream() | |||
.map(ProjectPO::getProjectCode).collect(Collectors.toSet()); | |||
@@ -443,10 +442,10 @@ public class ProjectLibManage { | |||
item.setProcessStatus(w.getProcessStatus()); | |||
item.setInstCode(w.getInstCode()); | |||
item.setIsHigherSuperOrg(w.getIsHigherSuperOrg()); | |||
if (finalUser.getIsOrgAdmin() && | |||
if (user.getIsOrgAdmin() && | |||
ProjectStatusEnum.PENDING_PREQUALIFICATION.getCode().equals(item.getStatus()) | |||
&& StringUtils.isNotBlank(w.getSuperOrgCode()) && StringUtils.isNotBlank(finalUser.getEmpPosUnitCode()) | |||
&& w.getSuperOrgCode().equals(finalUser.getEmpPosUnitCode())) { | |||
&& StringUtils.isNotBlank(w.getSuperOrgCode()) && StringUtils.isNotBlank(user.getEmpPosUnitCode()) | |||
&& w.getSuperOrgCode().equals(user.getEmpPosUnitCode())) { | |||
item.setCanPreDeclared(Boolean.TRUE); | |||
} | |||
item.setApprovedAmount(w.getApprovalAmount()); | |||
@@ -469,11 +468,10 @@ public class ProjectLibManage { | |||
public PageVo<ProjectLibListItemVO> libListWithPermission(ProjectListReq req, UserFullInfoDTO user) { | |||
req = buildProjectLibPermission(req, user); | |||
Page<ProjectPO> page = projectService.pagelibWithPermission(req.page(), req); | |||
long total; | |||
if (CollUtil.isEmpty(page.getRecords())) { | |||
return PageVo.empty(); | |||
} | |||
UserFullInfoDTO finalUser = user; | |||
Set<String> projectCodes = page.getRecords().stream() | |||
.map(ProjectPO::getProjectCode).collect(Collectors.toSet()); | |||
@@ -525,10 +523,10 @@ public class ProjectLibManage { | |||
item.setProcessStatus(w.getProcessStatus()); | |||
item.setInstCode(w.getInstCode()); | |||
item.setIsHigherSuperOrg(w.getIsHigherSuperOrg()); | |||
if (finalUser.getIsOrgAdmin() && | |||
if (user.getIsOrgAdmin() && | |||
ProjectStatusEnum.PENDING_PREQUALIFICATION.getCode().equals(item.getStatus()) | |||
&& StringUtils.isNotBlank(w.getSuperOrgCode()) && StringUtils.isNotBlank(finalUser.getEmpPosUnitCode()) | |||
&& w.getSuperOrgCode().equals(finalUser.getEmpPosUnitCode())) { | |||
&& StringUtils.isNotBlank(w.getSuperOrgCode()) && StringUtils.isNotBlank(user.getEmpPosUnitCode()) | |||
&& w.getSuperOrgCode().equals(user.getEmpPosUnitCode())) { | |||
item.setCanPreDeclared(Boolean.TRUE); | |||
} | |||
item.setApprovedAmount(w.getApprovalAmount()); | |||
@@ -552,15 +550,14 @@ public class ProjectLibManage { | |||
UserFullInfoDTO user) { | |||
req = buildProjectLibPermission(req, user); | |||
Page<ProjectPO> page = projectService.pagelibWithPermission(req.page(), req); | |||
long total; | |||
if (CollUtil.isEmpty(page.getRecords())) { | |||
return PageVo.empty(); | |||
} | |||
UserFullInfoDTO finalUser = user; | |||
Set<String> instCodes = page.getRecords().stream() | |||
.filter(p -> StringUtils.isNotBlank(p.getInstCode())) | |||
.map(ProjectPO::getInstCode).collect(Collectors.toSet()); | |||
.map(ProjectPO::getInstCode) | |||
.filter(StringUtils::isNotBlank).collect(Collectors.toSet()); | |||
List<Task> tasks = taskService.createTaskQuery() | |||
.processInstanceIdIn(instCodes) | |||
.orderByTaskCreateTime() | |||
@@ -594,10 +591,10 @@ public class ProjectLibManage { | |||
item.setInstCode(w.getInstCode()); | |||
item.setIsHigherSuperOrg(w.getIsHigherSuperOrg()); | |||
item.setApproveUsers(buildApproveUsers(w.getInstCode(), map, userMap)); | |||
if (finalUser.getIsOrgAdmin() && | |||
if (user.getIsOrgAdmin() && | |||
ProjectStatusEnum.PENDING_PREQUALIFICATION.getCode().equals(item.getStatus()) | |||
&& StringUtils.isNotBlank(w.getSuperOrgCode()) && StringUtils.isNotBlank(finalUser.getEmpPosUnitCode()) | |||
&& w.getSuperOrgCode().equals(finalUser.getEmpPosUnitCode())) { | |||
&& StringUtils.isNotBlank(w.getSuperOrgCode()) && StringUtils.isNotBlank(user.getEmpPosUnitCode()) | |||
&& w.getSuperOrgCode().equals(user.getEmpPosUnitCode())) { | |||
item.setCanPreDeclared(Boolean.TRUE); | |||
} | |||
item.setApprovedAmount(w.getApprovalAmount()); | |||
@@ -809,13 +806,11 @@ public class ProjectLibManage { | |||
.eq(ProjectRenewalFundDeclaration::getDeleted, Boolean.FALSE) | |||
.orderByAsc(ProjectRenewalFundDeclaration::getProjectYear)); | |||
Optional.ofNullable(renewalDeclarations).ifPresent(declarations -> | |||
declarations.forEach(declaration -> { | |||
annualAmounts.add(AnnualAmountVO.builder() | |||
.projectId(projectInfo.getId()) | |||
.projectYear(declaration.getProjectYear()) | |||
.annualAmount(declaration.getAnnualPaymentAmount()) | |||
.build()); | |||
}) | |||
declarations.forEach(declaration -> annualAmounts.add(AnnualAmountVO.builder() | |||
.projectId(projectInfo.getId()) | |||
.projectYear(declaration.getProjectYear()) | |||
.annualAmount(declaration.getAnnualPaymentAmount()) | |||
.build())) | |||
); | |||
vo.setAnnualAccumulateAmountList(annualAmounts); | |||
} | |||
@@ -1032,7 +1027,7 @@ public class ProjectLibManage { | |||
project.setCreateOn(LocalDateTime.now()); | |||
project.setUpdateOn(LocalDateTime.now()); | |||
project.setIsBackReject(Boolean.FALSE); | |||
stateMachineUtils.pass(project); | |||
stateMachineUtil.pass(project); | |||
projectService.save(project); | |||
oldProject.setIsBackReject(Boolean.TRUE); | |||
@@ -1156,7 +1151,7 @@ public class ProjectLibManage { | |||
project.setIsBackReject(isBackReject); | |||
//终验材料 | |||
project.setFinalAcceptanceMaterials(dto.getFinalAcceptanceMaterials()); | |||
stateMachineUtils.pass(project); | |||
stateMachineUtil.pass(project); | |||
oldProject.setIsBackReject(isBackReject); | |||
projectService.updateById(oldProject); | |||
@@ -1193,7 +1188,7 @@ public class ProjectLibManage { | |||
project.setUpdateOn(LocalDateTime.now()); | |||
// 标识保存的项目信息是否为建设方案申报项目 | |||
project.setIsConstruct(Boolean.FALSE); | |||
stateMachineUtils.pass(project); | |||
stateMachineUtil.pass(project); | |||
oldProject.setIsBackReject(Boolean.TRUE); | |||
projectService.updateById(oldProject); | |||
@@ -1218,7 +1213,7 @@ public class ProjectLibManage { | |||
/** | |||
* 获取项目初步方案详情 | |||
* | |||
* @param projectId | |||
* @param projectId \ | |||
* @return com.hz.pm.api.projectlib.model.vo.ProjectDetailVO | |||
* @author CMM | |||
* @since 2023/07/12 11:43 | |||
@@ -1253,17 +1248,16 @@ public class ProjectLibManage { | |||
private boolean checkCanRead(Set<String> subOrgSet, Project project) { | |||
// 从申请借阅信息表中查出本单位及下属单位审批通过的项目 | |||
HashSet<Long> borrowProjectIdSet = new HashSet<>(); | |||
List<Long> applyBorrowProjectIdList = projectApplyBorrowService | |||
.list(Wrappers.lambdaQuery(ProjectApplyBorrow.class) | |||
.in(ProjectApplyBorrow::getApplyBorrowEmpPosUnitCode, subOrgSet) | |||
.eq(ProjectApplyBorrow::getIsSuccess, Boolean.TRUE)) | |||
.stream().map(ProjectApplyBorrow::getProjectId).filter(borrowProjectIdSet::add).collect(Collectors.toList()); | |||
LambdaQueryWrapper<ProjectApplyBorrow> query = Wrappers.lambdaQuery(ProjectApplyBorrow.class) | |||
.select(ProjectApplyBorrow::getProjectId) | |||
.in(ProjectApplyBorrow::getApplyBorrowEmpPosUnitCode, subOrgSet) | |||
.eq(ProjectApplyBorrow::getIsSuccess, Boolean.TRUE); | |||
List<Long> applyBorrowProjectIdList = CollUtils.fieldList(projectApplyBorrowService.list(query), ProjectApplyBorrow::getProjectId); | |||
return applyBorrowProjectIdList.contains(project.getId()); | |||
} | |||
private Set<String> getSubOrgList(String empPosUnitCode) { | |||
HashSet<String> orgSet = new HashSet<>(); | |||
Set<String> orgSet = new HashSet<>(); | |||
// 先将自己加入子集 | |||
orgSet.add(empPosUnitCode); | |||
Set<String> subOrgList = dingOrganizationService | |||
@@ -1505,7 +1499,7 @@ public class ProjectLibManage { | |||
PaymentPlanVO vo = BeanUtil.copyProperties(p, PaymentPlanVO.class); | |||
vo.setRatio((Objects.isNull(totalAmount) || totalAmount.compareTo(BigDecimal.ZERO) == 0) ? "0%" | |||
: p.getPaymentAmount().multiply(BigDecimal.valueOf(100)) | |||
.divide(totalAmount, BigDecimal.ROUND_CEILING, BigDecimal.ROUND_CEILING) + "%"); | |||
.divide(totalAmount, BigDecimal.ROUND_CEILING, RoundingMode.CEILING) + "%"); | |||
return vo; | |||
}) | |||
.collect(Collectors.toList()); | |||
@@ -1565,7 +1559,7 @@ public class ProjectLibManage { | |||
//2.要判断 项目在当前状态 有没有被驳回和退回过 | |||
//当前项目状态流程的 实例 看看是不是有2个以上 有2个说明 有退回 驳回 | |||
Boolean isChangeRecord = todoService.isChangeRecord(projectId); | |||
boolean isChangeRecord = todoService.isChangeRecord(projectId); | |||
if (!isChangeRecord) { | |||
return res; | |||
} | |||
@@ -1623,7 +1617,7 @@ public class ProjectLibManage { | |||
private void saveApplication(ProjectDTO projectDto, Project project, Boolean isConstruct) { | |||
UserInfoDetails user = LoginUserUtil.loginUserDetail(); | |||
//保存项目应用 | |||
Boolean isApp = Objects.nonNull(projectDto.getIncludeApplication()) && CommonEnum.YES.getCode().equals(projectDto.getIncludeApplication()) | |||
boolean isApp = Objects.nonNull(projectDto.getIncludeApplication()) && CommonEnum.YES.getCode().equals(projectDto.getIncludeApplication()) | |||
? Boolean.TRUE : Boolean.FALSE; | |||
//采取批量删除 批量添加的方式 | |||
Integer version = Objects.nonNull(project.getVersion()) ? project.getVersion() : 1; | |||
@@ -289,7 +289,6 @@ public class ProjectRenewalFundManage { | |||
} | |||
vo.setProjectName(operationBaseinfo.getBaseProjName()); | |||
vo.setProjectType(operationBaseinfo.getBaseProjType()); | |||
// vo.setStage(project.getStage()); | |||
vo.setStatus(StringUtils.isNotBlank(operationBaseinfo.getBaseProjSetProg()) ? | |||
Integer.parseInt(operationBaseinfo.getBaseProjSetProg()) : null); | |||
vo.setBuildOrgName(operationBaseinfo.getBaseBuildDeprt()); | |||
@@ -307,19 +306,17 @@ public class ProjectRenewalFundManage { | |||
.eq(ProjectRenewalFundDeclaration::getDeleted,Boolean.FALSE) | |||
.orderByAsc(ProjectRenewalFundDeclaration::getProjectYear)); | |||
Optional.ofNullable(renewalDeclarations).ifPresent(declarations -> | |||
declarations.forEach(declaration -> { | |||
annualAmounts.add(AnnualAmountVO.builder() | |||
.projectId(operationBaseinfo.getId()) | |||
.projectCode(operationBaseinfo.getBaseProjId()) | |||
.projectYear(declaration.getProjectYear()) | |||
.annualAmount(declaration.getAnnualPaymentAmount()) | |||
.haveAmount(declaration.getHaveAmount()) | |||
.govOwnFinanceAmount(declaration.getGovOwnFinanceAmount()) | |||
.bankLendingAmount(declaration.getBankLendingAmount()) | |||
.govSuperiorFinanceAmount(declaration.getGovSuperiorFinanceAmount()) | |||
.otherAmount(declaration.getOtherAmount()) | |||
.build()); | |||
}) | |||
declarations.forEach(declaration -> annualAmounts.add(AnnualAmountVO.builder() | |||
.projectId(operationBaseinfo.getId()) | |||
.projectCode(operationBaseinfo.getBaseProjId()) | |||
.projectYear(declaration.getProjectYear()) | |||
.annualAmount(declaration.getAnnualPaymentAmount()) | |||
.haveAmount(declaration.getHaveAmount()) | |||
.govOwnFinanceAmount(declaration.getGovOwnFinanceAmount()) | |||
.bankLendingAmount(declaration.getBankLendingAmount()) | |||
.govSuperiorFinanceAmount(declaration.getGovSuperiorFinanceAmount()) | |||
.otherAmount(declaration.getOtherAmount()) | |||
.build())) | |||
); | |||
vo.setAnnualAccumulateAmountList(annualAmounts); | |||
} | |||
@@ -332,7 +329,6 @@ public class ProjectRenewalFundManage { | |||
* @return | |||
*/ | |||
public Long declared(ProjectRenewalFundDeclarationDTO dto) { | |||
Integer projectYear = dto.getProjectYear(); | |||
//要判断 项目id 是否 以及状态是 已验收 | |||
String projectCode = dto.getProjectCode(); | |||
Project project = projectService.getProjectByCode(projectCode); | |||
@@ -388,9 +384,6 @@ public class ProjectRenewalFundManage { | |||
.throwMessage("续建资金年度错误!"); | |||
} | |||
//判断金额 | |||
// checkPaymentAmount(projectCode,projectYear,dto.getAnnualPaymentAmount()); | |||
declaration.setApprovalStatus(ProjectRenewalApprovalStatusEnum.PENDING.name()); | |||
if(Objects.nonNull(project)){ | |||
declaration.setRegionCode(project.getAreaCode()); | |||
@@ -417,16 +410,16 @@ public class ProjectRenewalFundManage { | |||
.eq(PaymentPlan::getProjectCode, projectCode) | |||
.orderByAsc(PaymentPlan::getPaymentTime)); | |||
VUtils.isTrue(CollUtil.isEmpty(paymentPlans)).throwMessage("未有所选年度的支付计划,无法提交"); | |||
Boolean hasYearPlan = Boolean.FALSE; | |||
boolean hasYearPlan = Boolean.FALSE; | |||
for(PaymentPlan plan : paymentPlans){ | |||
if(Objects.isNull(plan.getPaymentTime())){ | |||
continue; | |||
} | |||
int year = plan.getPaymentTime().getYear(); | |||
if(Objects.nonNull(year) && projectYear.equals(year)){ | |||
if(projectYear.equals(year)){ | |||
hasYearPlan = Boolean.TRUE; | |||
}else if(Objects.nonNull(year) && projectYear.compareTo(year) > 0){ | |||
}else if(projectYear.compareTo(year) > 0){ | |||
//2 如果有 这一年前的实际支付金额有没有填 | |||
VUtils.isTrue(Objects.isNull(plan.getActualPaymentAmount())) | |||
.throwMessage("有漏填写此年度之前年度的实际支付金额,请去合同备案补充"); | |||
@@ -552,7 +545,7 @@ public class ProjectRenewalFundManage { | |||
.sheet(fileName) | |||
.doWrite(collect); | |||
} catch (IOException e) { | |||
throw new RuntimeException(e); | |||
throw new BizException(e); | |||
} | |||
} | |||
@@ -593,7 +586,7 @@ public class ProjectRenewalFundManage { | |||
.sheet(fileName) | |||
.doWrite(collect); | |||
} catch (IOException e) { | |||
throw new RuntimeException(e); | |||
throw new BizException(e); | |||
} | |||
} | |||
@@ -1,8 +1,5 @@ | |||
package com.hz.pm.api.projectlib.model.po; | |||
import com.baomidou.mybatisplus.annotation.IdType; | |||
import com.baomidou.mybatisplus.annotation.TableId; | |||
import com.baomidou.mybatisplus.annotation.TableName; | |||
import io.swagger.annotations.ApiModel; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Data; | |||
@@ -5,9 +5,7 @@ import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Data; | |||
import org.hibernate.validator.constraints.Length; | |||
import javax.validation.constraints.Max; | |||
import javax.validation.constraints.NotNull; | |||
import javax.validation.constraints.Size; | |||
/** | |||
* 续建项目审核请求实体 | |||
@@ -4,6 +4,8 @@ import com.hz.pm.api.common.statemachine.event.ProjectStatusChangeEvent; | |||
import com.hz.pm.api.projectlib.model.entity.ProjectStatusChange; | |||
import com.baomidou.mybatisplus.extension.service.IService; | |||
import java.util.Collection; | |||
/** | |||
* <p> | |||
* 服务类 | |||
@@ -16,4 +18,6 @@ public interface INdProjectStatusChangeService extends IService<ProjectStatusCha | |||
ProjectStatusChange getByProjectStatus(ProjectStatusChangeEvent event, Long projectId); | |||
ProjectStatusChange getByProjectStatus(ProjectStatusChangeEvent event, Collection<Long> projectIds); | |||
} |
@@ -10,6 +10,10 @@ import com.hz.pm.api.projectlib.service.INdProjectStatusChangeService; | |||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |||
import org.springframework.stereotype.Service; | |||
import java.util.Collection; | |||
import static com.hz.pm.api.common.statemachine.event.ProjectStatusChangeEvent.DEPARTMENT_UNITED_REVIEW_PASS; | |||
/** | |||
* <p> | |||
* 服务实现类 | |||
@@ -31,4 +35,12 @@ public class NdProjectStatusChangeServiceImpl extends ServiceImpl<NdProjectStatu | |||
return getOne(query); | |||
} | |||
@Override | |||
public ProjectStatusChange getByProjectStatus(ProjectStatusChangeEvent event, Collection<Long> projectIds) { | |||
LambdaQueryWrapper<ProjectStatusChange> query = Wrappers.lambdaQuery(ProjectStatusChange.class) | |||
.in(ProjectStatusChange::getProjectId, projectIds) | |||
.eq(ProjectStatusChange::getEvent, DEPARTMENT_UNITED_REVIEW_PASS) | |||
.last(BizConst.LIMIT_1); | |||
return getOne(query); | |||
} | |||
} |
@@ -1,7 +1,5 @@ | |||
package com.hz.pm.api.provincial.model.res; | |||
import com.ningdatech.basic.enumeration.Status; | |||
import com.ningdatech.basic.model.ApiStatus; | |||
import lombok.Data; | |||
import lombok.NoArgsConstructor; | |||
@@ -65,7 +65,7 @@ public class OssApiResponse<T> implements Serializable { | |||
* @return ApiResponse | |||
*/ | |||
public static <T> OssApiResponse<T> of(Integer respCode, String respMsg, T data) { | |||
return new OssApiResponse<T>(respCode, respMsg, data); | |||
return new OssApiResponse<>(respCode, respMsg, data); | |||
} | |||
/** | |||
@@ -7,7 +7,7 @@ import com.ningdatech.basic.exception.BizException; | |||
import com.ningdatech.file.service.FileService; | |||
import com.hz.pm.api.common.model.constant.BizConst; | |||
import com.hz.pm.api.common.model.constant.ProjectDeclareConst; | |||
import com.hz.pm.api.common.statemachine.util.StateMachineUtils; | |||
import com.hz.pm.api.common.statemachine.util.StateMachineUtil; | |||
import com.hz.pm.api.projectdeclared.converter.ApplicationConverter; | |||
import com.hz.pm.api.projectlib.model.enumeration.InstTypeEnum; | |||
import com.hz.pm.api.projectlib.model.enumeration.ProjectStatusEnum; | |||
@@ -211,8 +211,8 @@ public class ProcessEndListener { | |||
// 当前项目状态是部门联审中 | |||
case DEPARTMENT_JOINT_REVIEW: | |||
//如果是 区县 并且 500万及以上要推送省局重大项目 | |||
if (!StateMachineUtils.isCityProject(declaredProject) && | |||
StateMachineUtils.judgeDeclareAmount(declaredProject, | |||
if (!StateMachineUtil.isCityProject(declaredProject) && | |||
StateMachineUtil.judgeDeclareAmount(declaredProject, | |||
ProjectDeclareConst.Number.DECLARE_COUNTY_AMOUNT_JUDGEMENT)) { | |||
try { | |||
List<ProjectApplication> applications = projectApplicationService | |||
@@ -3,7 +3,7 @@ package com.hz.pm.api.scheduler.listener; | |||
import cn.hutool.core.collection.CollUtil; | |||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |||
import com.hz.pm.api.common.model.constant.BizConst; | |||
import com.hz.pm.api.common.statemachine.util.StateMachineUtils; | |||
import com.hz.pm.api.common.statemachine.util.StateMachineUtil; | |||
import com.hz.pm.api.projectlib.model.entity.Project; | |||
import com.hz.pm.api.projectlib.model.entity.ProjectInst; | |||
import com.hz.pm.api.projectlib.service.IProjectInstService; | |||
@@ -40,7 +40,7 @@ public class ProcessStartListener { | |||
private final IProjectService projectService; | |||
private final StateMachineUtils stateMachineUtils; | |||
private final StateMachineUtil stateMachineUtil; | |||
@Async | |||
@EventListener | |||
@@ -82,7 +82,7 @@ public class ProcessStartListener { | |||
//如果真的没有实时任务和历史任务 那么说明 该项目没有人审批 需要去调用状态机 | |||
Long projectId = projectInst.getProjectId(); | |||
Project project = projectService.getNewProject(projectId); | |||
stateMachineUtils.pass(project); | |||
stateMachineUtil.pass(project); | |||
project.setUpdateOn(LocalDateTime.now()); | |||
projectService.updateById(project); | |||
} | |||
@@ -7,7 +7,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |||
import com.hz.pm.api.common.model.constant.BizConst; | |||
import com.hz.pm.api.common.model.constant.ProjectDeclareConst; | |||
import com.hz.pm.api.common.model.constant.RegionConst; | |||
import com.hz.pm.api.common.statemachine.util.StateMachineUtils; | |||
import com.hz.pm.api.common.statemachine.util.StateMachineUtil; | |||
import com.hz.pm.api.projectlib.model.enumeration.ProjectStatusEnum; | |||
import com.hz.pm.api.projectlib.model.entity.Project; | |||
import com.hz.pm.api.projectlib.service.IProjectService; | |||
@@ -42,7 +42,7 @@ public class CheckProvincialReviewResultTask { | |||
private final IJoinReviewProvincialBureauService reviewProvincialBureauService; | |||
private final IProjectService projectService; | |||
private final StateMachineUtils stateMachineUtils; | |||
private final StateMachineUtil stateMachineUtil; | |||
@Value("${hostname}") | |||
private String HOST_NAME; | |||
@@ -96,7 +96,7 @@ public class CheckProvincialReviewResultTask { | |||
//在省级联审 才调状态机 否则 只改变 联审结果 | |||
if(ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS.getCode().equals( | |||
project.getStatus())){ | |||
stateMachineUtils.pass(project); | |||
stateMachineUtil.pass(project); | |||
} | |||
log.info("已经审批完成 进入下一状态"); | |||
} | |||
@@ -5,7 +5,6 @@ import com.alibaba.fastjson.JSON; | |||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |||
import com.hz.pm.api.projectlib.model.entity.Project; | |||
import com.hz.pm.api.projectlib.service.IProjectService; | |||
import com.hz.pm.api.scheduler.contants.TaskContant; | |||
import com.hz.pm.api.staging.contants.StagingContant; | |||
import com.hz.pm.api.staging.model.entity.ProjectStaging; | |||
import com.hz.pm.api.staging.service.IProjectStagingService; | |||
@@ -20,7 +19,6 @@ import java.net.InetAddress; | |||
import java.net.UnknownHostException; | |||
import java.time.LocalDateTime; | |||
import java.util.List; | |||
import java.util.Map; | |||
import java.util.Objects; | |||
import java.util.function.Function; | |||
@@ -38,9 +36,7 @@ public class ProjectStatusFlowTask { | |||
private final IProjectStagingService projectStagingService; | |||
private final IProjectService projectService; | |||
private final ProjectStatusFlowMapUtil projectStatusFlowMapUtil; | |||
@Value("${hostname}") | |||
private String HOST_NAME; | |||
@@ -49,44 +45,39 @@ public class ProjectStatusFlowTask { | |||
if (HOST_NAME.equals(InetAddress.getLocalHost().getHostName())) { | |||
//1. 定时取 项目暂存表的数据 去进行状态继续流转 | |||
List<ProjectStaging> stagingList = projectStagingService.list(Wrappers.lambdaQuery(ProjectStaging.class) | |||
.eq(ProjectStaging::getDead,Boolean.FALSE) | |||
.le(ProjectStaging::getNextTime, LocalDateTime.now()) | |||
.le(ProjectStaging::getRetryTimes, StagingContant.Retry.MAX_RETRY_TIMES) | |||
.orderByAsc(ProjectStaging::getProjectId)); | |||
.eq(ProjectStaging::getDead, Boolean.FALSE) | |||
.le(ProjectStaging::getNextTime, LocalDateTime.now()) | |||
.le(ProjectStaging::getRetryTimes, StagingContant.Retry.MAX_RETRY_TIMES) | |||
.orderByAsc(ProjectStaging::getProjectId)); | |||
log.info("需要状态流转的项目 size:{} :{}",stagingList.size(), JSON.toJSONString(stagingList)); | |||
if(CollUtil.isEmpty(stagingList)){ | |||
log.info("需要状态流转的项目 size:{} :{}", stagingList.size(), JSON.toJSONString(stagingList)); | |||
if (CollUtil.isEmpty(stagingList)) { | |||
log.info("没有需要状态流转的项目!"); | |||
return; | |||
} | |||
//遍历 | |||
for(ProjectStaging projectStaging : stagingList){ | |||
try{ | |||
for (ProjectStaging projectStaging : stagingList) { | |||
try { | |||
Project project = projectService.getById(projectStaging.getProjectId()); | |||
if(Objects.isNull(project)){ | |||
log.info("此项目 【{}】 不存在",projectStaging.getProjectId()); | |||
if (Objects.isNull(project)) { | |||
log.info("此项目 【{}】 不存在", projectStaging.getProjectId()); | |||
continue; | |||
} | |||
//2. 用函数map 定位到 状态流转的函数 | |||
Map<Integer, Function<Project, Boolean>> reStartProcessMap = | |||
projectStatusFlowMapUtil.statusFlowFunctionMap; | |||
if(!reStartProcessMap.containsKey(project.getStatus())){ | |||
log.info("此项目 【{}】 当前状态 【{}】,没有对应流转函数",projectStaging.getProjectId(),project.getStatus()); | |||
Function<Project, Boolean> flowFunction = ProjectStatusFlowMapUtil.getFlowFunction(project.getStatus()); | |||
if (flowFunction == null) { | |||
log.info("此项目 【{}】 当前状态 【{}】,没有对应流转函数", projectStaging.getProjectId(), project.getStatus()); | |||
continue; | |||
} | |||
Function<Project, Boolean> functionMap = reStartProcessMap.get(project.getStatus()); | |||
//执行对应的函数 | |||
if(functionMap.apply(project)){ | |||
if (flowFunction.apply(project)) { | |||
//执行成功了 删除暂存的数据 | |||
projectStagingService.removeById(projectStaging); | |||
} | |||
}catch (Exception e){ | |||
} catch (Exception e) { | |||
log.error("项目流转 异常 projectId:【" + projectStaging.getProjectId() + "】 异常内容:" + e.getMessage()); | |||
}finally { | |||
} finally { | |||
//增加重试的次数 和下次扫描时间 | |||
projectStagingService.addRetryTimes(projectStaging); | |||
} | |||
@@ -94,11 +85,4 @@ public class ProjectStatusFlowTask { | |||
} | |||
} | |||
// @Scheduled(cron = "0 */1 * * * ?") | |||
public void nonUserFinishFlowToNext() throws UnknownHostException { | |||
//测试暂时用自己HOST | |||
if (TaskContant.Host.HOST_ZPF.equals(InetAddress.getLocalHost().getHostName())) { | |||
} | |||
} | |||
} |
@@ -1,5 +1,6 @@ | |||
package com.hz.pm.api.staging.utils; | |||
import cn.hutool.core.lang.func.Func; | |||
import com.google.common.collect.Maps; | |||
import com.hz.pm.api.projectdeclared.manage.ReviewByDeptJointManage; | |||
import com.hz.pm.api.projectdeclared.manage.ReviewByProvincialDeptManage; | |||
@@ -19,25 +20,27 @@ import java.util.function.Function; | |||
*/ | |||
@Component | |||
public class ProjectStatusFlowMapUtil { | |||
@Autowired | |||
private ReviewByProvincialDeptManage provincialDeptManage; | |||
@Autowired | |||
private ReviewByDeptJointManage reviewByDeptJointManage; | |||
private static final Map<Integer, Function<Project, Boolean>> STATUS_FLOW_FUNCTION_MAP = Maps.newHashMap(); | |||
public Map<Integer, Function<Project,Boolean>> statusFlowFunctionMap = Maps.newHashMap(); | |||
public static Function<Project, Boolean> getFlowFunction(Integer status){ | |||
return STATUS_FLOW_FUNCTION_MAP.get(status); | |||
} | |||
/** | |||
* 初始化业务分派逻辑,代替了if-else部分 | |||
* key: 枚举 状态值 | |||
* value: lambda表达式,最终会获取发起实例的函数 | |||
* 初始化业务分派逻辑,代替了if-else部分 | |||
* key: 枚举 状态值 | |||
* value: lambda表达式,最终会获取发起实例的函数 | |||
*/ | |||
public ProjectStatusFlowMapUtil(){ | |||
public ProjectStatusFlowMapUtil(ReviewByProvincialDeptManage provincialDeptManage, | |||
ReviewByDeptJointManage reviewByDeptJointManage) { | |||
//省级部门联审 | |||
statusFlowFunctionMap.put(ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS.getCode(), | |||
project->provincialDeptManage.startTheProcess(project)); | |||
STATUS_FLOW_FUNCTION_MAP.put(ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS.getCode(), | |||
provincialDeptManage::startTheProcess); | |||
//部门联审 | |||
statusFlowFunctionMap.put(ProjectStatusEnum.DEPARTMENT_JOINT_REVIEW.getCode(), | |||
project->reviewByDeptJointManage.startTheProcess(project)); | |||
STATUS_FLOW_FUNCTION_MAP.put(ProjectStatusEnum.DEPARTMENT_JOINT_REVIEW.getCode(), | |||
reviewByDeptJointManage::startTheProcess); | |||
} | |||
} |
@@ -1,12 +1,10 @@ | |||
package com.hz.pm.api.staging.utils; | |||
import java.util.Map; | |||
import javax.annotation.PostConstruct; | |||
import com.google.common.collect.Maps; | |||
import lombok.AllArgsConstructor; | |||
import org.springframework.stereotype.Component; | |||
import com.google.common.collect.Maps; | |||
import lombok.RequiredArgsConstructor; | |||
import java.util.Map; | |||
/** | |||
* 工作通知流转 事件函数MAP | |||
@@ -1,7 +1,6 @@ | |||
package com.hz.pm.api.sys.mapper; | |||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |||
import com.hz.pm.api.sys.model.entity.Notice; | |||
import com.hz.pm.api.sys.model.entity.Notify; | |||
/** | |||
@@ -1,5 +1,8 @@ | |||
package com.hz.pm.api.sys.model.dto; | |||
import lombok.Data; | |||
import lombok.EqualsAndHashCode; | |||
/** | |||
* <p> | |||
* MeetingReviewMsgExtraDTO | |||
@@ -8,6 +11,8 @@ package com.hz.pm.api.sys.model.dto; | |||
* @author WendyYang | |||
* @since 2023/4/12 | |||
**/ | |||
@Data | |||
@EqualsAndHashCode(callSuper = true) | |||
public class MeetingReviewMsgExtraDTO extends AbstractMsgExtraDTO { | |||
private Long meetingId; | |||
@@ -6,7 +6,6 @@ import io.swagger.annotations.ApiModelProperty; | |||
import lombok.*; | |||
import lombok.experimental.Accessors; | |||
import javax.validation.constraints.NotBlank; | |||
import javax.validation.constraints.NotEmpty; | |||
import javax.validation.constraints.NotNull; | |||
import java.io.Serializable; | |||
@@ -33,7 +33,7 @@ import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE; | |||
@TableName("nd_menu") | |||
@ApiModel(value = "Menu", description = "菜单") | |||
@AllArgsConstructor | |||
public class Menu extends MenuTreeEntity<Menu, Long> { | |||
public class Menu extends MenuTreeEntity<Menu> { | |||
private static final long serialVersionUID = 1L; | |||
@@ -24,7 +24,7 @@ import lombok.experimental.Accessors; | |||
@Accessors(chain = true) | |||
@ApiModel(value = "RoleMenuVO", description = "菜单") | |||
@AllArgsConstructor | |||
public class MenuRoleVO extends MenuTreeEntity<MenuRoleVO, Long> { | |||
public class MenuRoleVO extends MenuTreeEntity<MenuRoleVO> { | |||
private static final long serialVersionUID = 1L; | |||
@@ -16,7 +16,6 @@ import lombok.NoArgsConstructor; | |||
*/ | |||
@Getter | |||
@AllArgsConstructor | |||
@NoArgsConstructor | |||
@ApiModel(value = "IsOrNotEnum", description = "是否-枚举") | |||
public enum IsOrNotEnum { | |||
/** | |||
@@ -30,16 +29,8 @@ public enum IsOrNotEnum { | |||
IS(1, "是"); | |||
private Integer code; | |||
private String desc; | |||
public String getDesc() { | |||
return desc; | |||
} | |||
public void setDesc(String desc) { | |||
this.desc = desc; | |||
} | |||
private final Integer code; | |||
private final String desc; | |||
public static String getDescByCode(Integer code) { | |||
if (Objects.isNull(code)) { | |||
@@ -38,7 +38,7 @@ import org.springframework.transaction.annotation.Transactional; | |||
import com.alibaba.fastjson.JSON; | |||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |||
import com.ningdatech.basic.exception.BizException; | |||
import com.hz.pm.api.common.statemachine.util.StateMachineUtils; | |||
import com.hz.pm.api.common.statemachine.util.StateMachineUtil; | |||
import com.hz.pm.api.projectdeclared.manage.DeclaredProjectManage; | |||
import com.hz.pm.api.projectdeclared.model.dto.ProjectDraftSaveDTO; | |||
import com.hz.pm.api.projectlib.model.enumeration.ProjectStatusEnum; | |||
@@ -82,7 +82,7 @@ public class HandlerManage { | |||
private final TaskService taskService; | |||
private final HistoryService historyService; | |||
private final IProjectService projectService; | |||
private final StateMachineUtils stateMachineUtils; | |||
private final StateMachineUtil stateMachineUtil; | |||
private final ProcessInstanceService processInstanceService; | |||
private final IProjectApplicationService projectApplicationService; | |||
private final IProjectStagingService projectStagingService; | |||
@@ -102,10 +102,11 @@ public class HandlerManage { | |||
/** | |||
* 审核通过后 所处理的逻辑 | |||
* | |||
* @param declaredProject | |||
* @param instance | |||
*/ | |||
public void afterPassTodo(Project declaredProject, HistoricProcessInstance instance){ | |||
public void afterPassTodo(Project declaredProject, HistoricProcessInstance instance) { | |||
Long userId = LoginUserUtil.getUserId(); | |||
// 获取流程通过后的流程实例 | |||
HistoricProcessInstance newInstance = historyService.createHistoricProcessInstanceQuery() | |||
@@ -118,7 +119,7 @@ public class HandlerManage { | |||
.last(BizConst.LIMIT_1)); | |||
Integer instType = projectInst.getInstType(); | |||
InstTypeEnum instTypeEnum = InstTypeEnum.getByCode(instType); | |||
if (Objects.isNull(instTypeEnum)){ | |||
if (Objects.isNull(instTypeEnum)) { | |||
throw new BizException("当前审批流类型不存在,流程类型code:" + instType); | |||
} | |||
@@ -154,20 +155,20 @@ public class HandlerManage { | |||
// 并向流程发起人发送浙政钉工作通知:【项目名称】已通过【流程名称】,请及时开始下一步操作。 | |||
if (HisProInsEndActId.END.equals(newInstance.getEndActivityId())) { | |||
// 如果是申请延期和申请借阅审批流程,不走状态机 | |||
if (InstTypeEnum.APPLY_DELAY.getCode().equals(instType) || InstTypeEnum.APPLY_BORROW.getCode().equals(instType)){ | |||
if (InstTypeEnum.APPLY_DELAY.getCode().equals(instType) || InstTypeEnum.APPLY_BORROW.getCode().equals(instType)) { | |||
switch (instTypeEnum) { | |||
case APPLY_DELAY: | |||
// 保存延期申请记录,更新项目建设周期和计划验收时间 | |||
updateProjectDelayApplyInfo(declaredProject,instanceId); | |||
updateProjectDelayApplyInfo(declaredProject, instanceId); | |||
break; | |||
case APPLY_BORROW: | |||
// 更新申请借阅状态为成功 | |||
updateProjectApplyBorrowInfo(declaredProject,instanceId); | |||
updateProjectApplyBorrowInfo(declaredProject, instanceId); | |||
break; | |||
default: | |||
throw new BizException("传入实例类型错误: " + instTypeEnum); | |||
} | |||
}else { | |||
} else { | |||
switch (Objects.requireNonNull(ProjectStatusEnum.match(declaredProject.getStatus()))) { | |||
// 当前项目状态是预审中 | |||
case PRE_APPLYING: | |||
@@ -180,10 +181,10 @@ public class HandlerManage { | |||
case DEPARTMENT_JOINT_REVIEW: | |||
log.info("部门联审成功后 要判断是否是 区县重大项目"); | |||
Boolean isImport = !StateMachineUtils.isCityProject(declaredProject) && | |||
StateMachineUtils.judgeDeclareAmount(declaredProject, | |||
Boolean isImport = !StateMachineUtil.isCityProject(declaredProject) && | |||
StateMachineUtil.judgeDeclareAmount(declaredProject, | |||
ProjectDeclareConst.Number.DECLARE_COUNTY_AMOUNT_JUDGEMENT); | |||
log.info("isImport :{}",isImport); | |||
log.info("isImport :{}", isImport); | |||
//如果是 区县 并且 500万及以上要推送省局重大项目 | |||
if (isImport) { | |||
try { | |||
@@ -191,7 +192,7 @@ public class HandlerManage { | |||
.list(Wrappers.lambdaQuery(ProjectApplication.class) | |||
.eq(ProjectApplication::getProjectCode, declaredProject.getProjectCode())); | |||
joinReviewProvincialBureauService.pushImportProject( | |||
ApplicationConverter.convertProject(declaredProject, applications, fileService,active)); | |||
ApplicationConverter.convertProject(declaredProject, applications, fileService, active)); | |||
updatePassProjectStatus(userId, declaredProject); | |||
break; | |||
} catch (Exception e) { | |||
@@ -210,15 +211,15 @@ public class HandlerManage { | |||
// 当前项目状态是终验审核中 | |||
updatePassProjectStatus(userId, declaredProject); | |||
// 判断是否 保存建设建议信息 | |||
saveContructionSuggestionInfo(instance.getId(),declaredProject); | |||
saveContructionSuggestionInfo(instance.getId(), declaredProject); | |||
break; | |||
default: | |||
throw new BizException("传入项目状态错误: " + declaredProject.getStatus()); | |||
} | |||
} | |||
//发送消息 | |||
noticeManage.sendNotice(instance.getStartUserId(),userId,declaredProject,instance.getProcessDefinitionName(), | |||
PASS_MSG_TEMPLATE2,MsgTypeEnum.PROJECT_REVIEW_PASS); | |||
noticeManage.sendNotice(instance.getStartUserId(), userId, declaredProject, instance.getProcessDefinitionName(), | |||
PASS_MSG_TEMPLATE2, MsgTypeEnum.PROJECT_REVIEW_PASS); | |||
} else { | |||
// 若有下一个审核人(当前节点的用户),会签/或签会有多个 | |||
// 向其发送浙政钉工作通知:标题:审核任务 内容:【单位名称】的【项目名称】需要您审核。 | |||
@@ -228,14 +229,15 @@ public class HandlerManage { | |||
throw new BizException("审核人信息不存在!"); | |||
} | |||
//发送消息 | |||
noticeManage.sendNotice(currentEmployeeCode,userId,declaredProject,instance.getProcessDefinitionName(), | |||
PASS_MSG_TEMPLATE,MsgTypeEnum.PROJECT_REVIEW); | |||
noticeManage.sendNotice(currentEmployeeCode, userId, declaredProject, instance.getProcessDefinitionName(), | |||
PASS_MSG_TEMPLATE, MsgTypeEnum.PROJECT_REVIEW); | |||
} | |||
} | |||
} | |||
/** | |||
* 去保存 建设建议信息 | |||
* | |||
* @param instanceId | |||
* @param project | |||
*/ | |||
@@ -244,7 +246,7 @@ public class HandlerManage { | |||
.eq(ProjectConstructionSuggestions::getProjectCode, project.getProjectCode()) | |||
.eq(ProjectConstructionSuggestions::getInstanceId, instanceId) | |||
.last(BizConst.LIMIT_1)); | |||
if(Objects.isNull(pcs)){ | |||
if (Objects.isNull(pcs)) { | |||
log.info("没有该流程的 建设 建议信息"); | |||
return; | |||
} | |||
@@ -257,7 +259,7 @@ public class HandlerManage { | |||
public void updateProjectApplyBorrowInfo(Project declaredProject, String instanceId) { | |||
// 获取申请借阅信息 | |||
ProjectApplyBorrow projectApplyBorrow = projectApplyBorrowService.getOne(Wrappers.lambdaQuery(ProjectApplyBorrow.class) | |||
ProjectApplyBorrow projectApplyBorrow = projectApplyBorrowService.getOne(Wrappers.lambdaQuery(ProjectApplyBorrow.class) | |||
.eq(ProjectApplyBorrow::getProjectId, declaredProject.getId()) | |||
.eq(ProjectApplyBorrow::getInstanceId, instanceId)); | |||
// 更新项目借阅信息为成功 | |||
@@ -297,6 +299,7 @@ public class HandlerManage { | |||
/** | |||
* 驳回后 所处理的逻辑 | |||
* | |||
* @param declaredProject | |||
* @param instance | |||
*/ | |||
@@ -313,8 +316,8 @@ public class HandlerManage { | |||
updateRejectProjectStatus(userId, declaredProject, instType); | |||
} | |||
//发送消息 | |||
noticeManage.sendNotice(instance.getStartUserId(),userId,declaredProject,instance.getProcessDefinitionName(), | |||
REJECT_MSG_TEMPLATE,MsgTypeEnum.PROJECT_REVIEW_REJECT); | |||
noticeManage.sendNotice(instance.getStartUserId(), userId, declaredProject, instance.getProcessDefinitionName(), | |||
REJECT_MSG_TEMPLATE, MsgTypeEnum.PROJECT_REVIEW_REJECT); | |||
} | |||
/** | |||
@@ -352,7 +355,7 @@ public class HandlerManage { | |||
private void saveToDraft(Project declaredProject) { | |||
ProjectDraftSaveDTO draftSaveDto = new ProjectDraftSaveDTO(); | |||
ProjectDTO projectInfo = new ProjectDTO(); | |||
BeanUtils.copyProperties(declaredProject,projectInfo); | |||
BeanUtils.copyProperties(declaredProject, projectInfo); | |||
// 查询出项目关联的应用信息 | |||
List<ProjectApplication> applicationList = projectApplicationService.list(Wrappers.lambdaQuery(ProjectApplication.class) | |||
.eq(ProjectApplication::getProjectId, declaredProject.getId())); | |||
@@ -362,7 +365,7 @@ public class HandlerManage { | |||
return applicationDTO; | |||
}).collect(Collectors.toList()); | |||
projectInfo.setApplicationList(applicationDTOList); | |||
HashMap<String,Object> dynamicMap = JSON.parseObject(declaredProject.getDynamicForm(), HashMap.class); | |||
HashMap<String, Object> dynamicMap = JSON.parseObject(declaredProject.getDynamicForm(), HashMap.class); | |||
projectInfo.setDynamicForm(dynamicMap); | |||
draftSaveDto.setProjectInfo(projectInfo); | |||
declaredProjectManage.saveToDraft(draftSaveDto); | |||
@@ -370,6 +373,7 @@ public class HandlerManage { | |||
/** | |||
* 删除项目的所有信息 | |||
* | |||
* @param declaredProject | |||
*/ | |||
public void deleteProjectRelated(Project declaredProject) { | |||
@@ -377,11 +381,12 @@ public class HandlerManage { | |||
projectService.removeById(declaredProject); | |||
//删除app信息 | |||
projectApplicationService.remove(Wrappers.lambdaQuery(ProjectApplication.class) | |||
.eq(ProjectApplication::getProjectId,declaredProject.getId())); | |||
.eq(ProjectApplication::getProjectId, declaredProject.getId())); | |||
} | |||
/** | |||
* 退回审核后 所处理的逻辑 | |||
* | |||
* @param declaredProject | |||
* @param instance | |||
*/ | |||
@@ -394,21 +399,21 @@ public class HandlerManage { | |||
Integer instType = projectInst.getInstType(); | |||
LambdaUpdateWrapper<Project> updateWrapper = Wrappers.lambdaUpdate(); | |||
// 如果是预审审批或建设方案退回,需要重新盖章,原来盖过章的文件要清空 | |||
if (InstTypeEnum.PRELIMINARY_PREVIEW.getCode().equals(instType)){ | |||
updateWrapper.set(Project::getPretrialFileId,null) | |||
.set(Project::getPretrialFileName,null) | |||
.eq(Project::getId,declaredProject.getId()); | |||
if (InstTypeEnum.PRELIMINARY_PREVIEW.getCode().equals(instType)) { | |||
updateWrapper.set(Project::getPretrialFileId, null) | |||
.set(Project::getPretrialFileName, null) | |||
.eq(Project::getId, declaredProject.getId()); | |||
projectService.update(updateWrapper); | |||
} else if (InstTypeEnum.CONSTRUCTION_PLAN_REVIEW.getCode().equals(instType)) { | |||
updateWrapper.set(Project::getConstructFileId,null) | |||
.set(Project::getConstructFileName,null) | |||
.eq(Project::getId,declaredProject.getId()); | |||
updateWrapper.set(Project::getConstructFileId, null) | |||
.set(Project::getConstructFileName, null) | |||
.eq(Project::getId, declaredProject.getId()); | |||
projectService.update(updateWrapper); | |||
} | |||
// 给项目创建人、流程发起人发送浙政钉工作通知:【项目名称】的【流程名称】被退回,请及时处理。 | |||
//发送消息 | |||
noticeManage.sendNotice(instance.getStartUserId(),userId,declaredProject,instance.getProcessDefinitionName(), | |||
BACK_MSG_TEMPLATE,MsgTypeEnum.PROJECT_REVIEW_BACK); | |||
noticeManage.sendNotice(instance.getStartUserId(), userId, declaredProject, instance.getProcessDefinitionName(), | |||
BACK_MSG_TEMPLATE, MsgTypeEnum.PROJECT_REVIEW_BACK); | |||
} | |||
@@ -423,12 +428,12 @@ public class HandlerManage { | |||
*/ | |||
public void updatePassProjectStatus(Long userId, Project declaredProject) { | |||
try { | |||
stateMachineUtils.pass(declaredProject); | |||
stateMachineUtil.pass(declaredProject); | |||
declaredProject.setUpdateOn(LocalDateTime.now()); | |||
declaredProject.setUpdateBy(userId); | |||
projectService.updateById(declaredProject); | |||
} catch (Exception e) { | |||
log.error("状态机执行失败",e); | |||
log.error("状态机执行失败", e); | |||
throw new BizException("状态机执行失败!"); | |||
} | |||
} | |||
@@ -444,21 +449,21 @@ public class HandlerManage { | |||
* @since 2023/02/08 | |||
*/ | |||
private void updateRejectProjectStatus(Long userId, Project declaredProject, Integer instType) { | |||
stateMachineUtils.reject(declaredProject); | |||
stateMachineUtil.reject(declaredProject); | |||
LambdaUpdateWrapper<Project> updateWrapper = Wrappers.lambdaUpdate(); | |||
declaredProject.setUpdateOn(LocalDateTime.now()); | |||
declaredProject.setUpdateBy(userId); | |||
projectService.updateById(declaredProject); | |||
// 如果是预审审批驳回,需要重新盖章,原来盖过章的文件要清空 | |||
if (InstTypeEnum.PRELIMINARY_PREVIEW.getCode().equals(instType)){ | |||
updateWrapper.set(Project::getPretrialFileId,null) | |||
.set(Project::getPretrialFileName,null) | |||
.eq(Project::getId,declaredProject.getId()); | |||
if (InstTypeEnum.PRELIMINARY_PREVIEW.getCode().equals(instType)) { | |||
updateWrapper.set(Project::getPretrialFileId, null) | |||
.set(Project::getPretrialFileName, null) | |||
.eq(Project::getId, declaredProject.getId()); | |||
projectService.update(updateWrapper); | |||
}else if (InstTypeEnum.CONSTRUCTION_PLAN_REVIEW.getCode().equals(instType)) { | |||
updateWrapper.set(Project::getConstructFileId,null) | |||
.set(Project::getConstructFileName,null) | |||
.eq(Project::getId,declaredProject.getId()); | |||
} else if (InstTypeEnum.CONSTRUCTION_PLAN_REVIEW.getCode().equals(instType)) { | |||
updateWrapper.set(Project::getConstructFileId, null) | |||
.set(Project::getConstructFileName, null) | |||
.eq(Project::getId, declaredProject.getId()); | |||
projectService.update(updateWrapper); | |||
} | |||
} | |||
@@ -476,12 +481,12 @@ public class HandlerManage { | |||
public void updateWithdrawProjectStatus(Long userId, Project declaredProject) { | |||
// 删除关联表信息 | |||
projectInstService.remove(Wrappers.lambdaQuery(ProjectInst.class) | |||
.eq(ProjectInst::getProjectId,declaredProject.getId()) | |||
.eq(ProjectInst::getInstCode,declaredProject.getInstCode())); | |||
.eq(ProjectInst::getProjectId, declaredProject.getId()) | |||
.eq(ProjectInst::getInstCode, declaredProject.getInstCode())); | |||
//删除项目的实例信息 | |||
historyService.deleteHistoricProcessInstance(declaredProject.getInstCode()); | |||
stateMachineUtils.withDraw(declaredProject); | |||
stateMachineUtil.withDraw(declaredProject); | |||
declaredProject.setUpdateOn(LocalDateTime.now()); | |||
declaredProject.setUpdateBy(userId); | |||
declaredProject.setInstCode(TodoCenterConstant.Declared.NULL_INST_CODE); | |||
@@ -489,22 +494,21 @@ public class HandlerManage { | |||
} | |||
public void deleteBackComments(List<HistoricVariableInstance> approves) { | |||
if(CollUtil.isNotEmpty(approves)){ | |||
for(HistoricVariableInstance approve : approves){ | |||
if(approve.getValue() instanceof ProcessHandlerEnum){ | |||
if(ProcessHandlerEnum.BACK.equals(ProcessHandlerEnum.getEnumByName(String.valueOf(approve.getValue())))){ | |||
runtimeService.removeVariable(approve.getProcessInstanceId(),approve.getVariableName()); | |||
if (CollUtil.isNotEmpty(approves)) { | |||
for (HistoricVariableInstance approve : approves) { | |||
if (approve.getValue() instanceof ProcessHandlerEnum) { | |||
if (ProcessHandlerEnum.BACK.equals(ProcessHandlerEnum.getEnumByName(String.valueOf(approve.getValue())))) { | |||
runtimeService.removeVariable(approve.getProcessInstanceId(), approve.getVariableName()); | |||
Comment comment; | |||
Optional<Comment> first = taskService.getProcessInstanceComments(approve.getProcessInstanceId()) | |||
.stream() | |||
.filter(c -> c.getTaskId().equals(approve.getVariableName().replace("approve_", StringUtils.EMPTY))) | |||
.findFirst(); | |||
if (first.isPresent()){ | |||
if (first.isPresent()) { | |||
comment = first.get(); | |||
taskService.deleteComment(comment.getId()); | |||
} | |||
break; | |||
} | |||
} | |||
@@ -514,27 +518,25 @@ public class HandlerManage { | |||
/** | |||
* 判断是否包含 此任务 | |||
* @param progressNodes | |||
* @param taskId | |||
* @return | |||
* | |||
* @param progressNodes \ | |||
* @param taskId \ | |||
* @return \ | |||
*/ | |||
public static Boolean checkIsContainsTask(List<ProgressNode> progressNodes, String taskId) { | |||
if(CollUtil.isEmpty(progressNodes)){ | |||
public static boolean checkIsContainsTask(List<ProgressNode> progressNodes, String taskId) { | |||
if (CollUtil.isEmpty(progressNodes)) { | |||
return Boolean.FALSE; | |||
} | |||
final Boolean[] res = {Boolean.FALSE}; | |||
progressNodes.forEach(p -> { | |||
if(p.getTaskId().equals(taskId)){ | |||
res[0] = Boolean.TRUE; | |||
return; | |||
for (ProgressNode node : progressNodes) { | |||
if (node.getTaskId().equals(taskId)) { | |||
return Boolean.TRUE; | |||
} | |||
if(CollUtil.isNotEmpty(p.getChildren()) && | |||
(checkIsContainsTask(p.getChildren(),taskId))){ | |||
res[0] = Boolean.TRUE; | |||
return; | |||
if (CollUtil.isNotEmpty(node.getChildren()) && | |||
(checkIsContainsTask(node.getChildren(), taskId))) { | |||
return Boolean.TRUE; | |||
} | |||
}); | |||
return res[0]; | |||
} | |||
return Boolean.FALSE; | |||
} | |||
} |
@@ -17,5 +17,5 @@ public interface ITodoService { | |||
*/ | |||
ProcessProgressDetailVO getProcessDetail(ProcessDetailReq request) ; | |||
Boolean isChangeRecord(Long projectId) ; | |||
boolean isChangeRecord(Long projectId) ; | |||
} |
@@ -98,7 +98,7 @@ public class TodoServiceImpl implements ITodoService { | |||
* @param user | |||
* @return | |||
*/ | |||
private Boolean checkHighLine(List<ProgressNode> progressInfo, String taskId, UserInfoDetails user) { | |||
private boolean checkHighLine(List<ProgressNode> progressInfo, String taskId, UserInfoDetails user) { | |||
if(CollUtil.isEmpty(progressInfo)){ | |||
return Boolean.FALSE; | |||
} | |||
@@ -122,7 +122,7 @@ public class TodoServiceImpl implements ITodoService { | |||
.equals(userFullInfoDTO.getEmpPosUnitCode())){ | |||
//说明是此单位的人 | |||
//那么要去看 taskId 是不是 在这个单位内的任务 | |||
Boolean isContainsTask = HandlerManage.checkIsContainsTask(children,taskId); | |||
boolean isContainsTask = HandlerManage.checkIsContainsTask(children,taskId); | |||
if(isContainsTask){ | |||
res[0] = Boolean.TRUE; | |||
return; | |||
@@ -139,7 +139,7 @@ public class TodoServiceImpl implements ITodoService { | |||
* @return | |||
*/ | |||
@Override | |||
public Boolean isChangeRecord(Long projectId) { | |||
public boolean isChangeRecord(Long projectId) { | |||
//1.先判断下 项目存不存在 | |||
Project project = projectService.getById(projectId); | |||
if(Objects.isNull(project)){ | |||
@@ -1,25 +1,22 @@ | |||
package com.hz.pm.api.todocenter.utils; | |||
import cn.hutool.core.io.IoUtil; | |||
import com.itextpdf.text.DocumentException; | |||
import com.itextpdf.text.pdf.BaseFont; | |||
import com.ningdatech.basic.exception.BizException; | |||
import lombok.extern.slf4j.Slf4j; | |||
import org.springframework.stereotype.Component; | |||
import org.xhtmlrenderer.pdf.ITextFontResolver; | |||
import org.xhtmlrenderer.pdf.ITextRenderer; | |||
import java.io.*; | |||
import java.nio.charset.StandardCharsets; | |||
import java.nio.file.Files; | |||
import java.nio.file.Paths; | |||
import java.util.Iterator; | |||
import java.util.Map; | |||
import java.util.UUID; | |||
import cn.hutool.core.io.IoUtil; | |||
import org.springframework.stereotype.Component; | |||
import org.xhtmlrenderer.pdf.ITextFontResolver; | |||
import org.xhtmlrenderer.pdf.ITextRenderer; | |||
import com.itextpdf.text.DocumentException; | |||
import com.itextpdf.text.pdf.BaseFont; | |||
import com.ningdatech.basic.exception.BizException; | |||
import lombok.extern.slf4j.Slf4j; | |||
/** | |||
* pdf生成工具类 | |||
* | |||
@@ -50,7 +47,6 @@ public class PdfUtils { | |||
new File(filePath).mkdir(); | |||
} | |||
StringBuilder stringBuilder = new StringBuilder(); | |||
; | |||
String line; | |||
while ((line = bufferedReader.readLine()) != null) { | |||
stringBuilder.append(line); | |||
@@ -3,14 +3,12 @@ package com.hz.pm.api.user.entity; | |||
import com.baomidou.mybatisplus.annotation.IdType; | |||
import com.baomidou.mybatisplus.annotation.TableId; | |||
import com.baomidou.mybatisplus.annotation.TableName; | |||
import io.swagger.annotations.ApiModel; | |||
import lombok.Data; | |||
import java.io.Serializable; | |||
import java.time.LocalDateTime; | |||
import io.swagger.annotations.ApiModel; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Data; | |||
/** | |||
* <p> | |||
* 组织表 | |||