@@ -1,166 +1,330 @@
// package com.sdm.project.schedule.lyric;
//
// import com.sdm.common.entity.enums.NodeTypeEnum ;
// import com.sdm.project .common.TaskExeStatusEnum ;
// import com.sdm.project.model.entity.SimulationNode ;
// import com.sdm.project.model.entity.SimulationTask ;
// import com.sdm.project.service.INodeService ;
// import com.sdm.project.service.ISimulationTaskService ;
// import com.xxl.job.core.handler.annotation.XxlJob ;
// import lombok.extern.slf4j.Slf4j ;
// import org.apache.commons.collections4.CollectionUtils ;
// import org.apache.commons.lang3.StringUtils ;
// import org.springframework.beans.factory.annotation.Value ;
// import org.springframework.stereotype.C omp onent ;
// import org.springframework.stereotype.Service ;
//
// import javax.annotation.Resource ;
// import java.time.LocalDateTime ;
// import java.time.format.DateTimeFormatter ;
// import java.time.temporal.ChronoUnit ;
// import java.util.* ;
// import java.util.stream.Collectors ;
//
// import static com.sdm.project.service.impl.NodeServiceImpl.SYNC_PROJECT_SOURCE ;
//
//@Slf4j
//@Component
//public class CommitmentDeadlineStatusScheduleExecutor{
//
// // 时间格式化器: 全局常量, 线程安全, 可复用( yyyy-MM-dd HH:mm:ss 固定格式)
// private static final DateTi meF ormatter DATE_TIME_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss") ;
//
// @Value("${commitmentDeadlineStatusTask.schedule.calculati onI nterval:5}")
// private int calculationInterval ;
//
// @ Resource
// private INodeService nodeService ;
//
// @Resource
// private ISimulationTaskService taskService ;
//
// @XxlJob("commitmentDeadlineStatusHandler")
// public void commitmentDeadlineStatusHandler() {
// log.info("定时任务执行") ;
// try {
// // 1. 获取所有节点(工位)
// List<SimulationNode> nodeList = nodeService.lambdaQuery().eq(SimulationNode::getNodeType, NodeTypeEnum.WORKSPACE)
// .eq(SimulationNode::getProjectSource, SYNC_PROJECT_SOURCE).isNotNull(SimulationNode::getCommitmentDeadline)
// .list();
// Map<String, String> nodeMap = new HashMap<>();
// if (CollectionUtils.isNotEmpty(nodeList)) {
package com.sdm.project.schedule.lyric ;
import com.alibaba.fastjson2.JSONObject ;
import com.sdm.common .common.ThreadLocalContext ;
import com.sdm.common.entity.enums.MessageTemplateEnum ;
import com.sdm.common.entity.enums.NodeTypeEnum ;
import com.sdm.common.entity.req.system.SendMsgReq ;
import com.sdm.common.entity.resp.system.CIDStaffResp ;
import com.sdm.common.feign.impl.system.MessageFeignClientImpl ;
import com.sdm.common.service.TagMapService ;
import com.sdm.common.service.TaskProgressService ;
import com.sdm.outbridge.entity.LyricVProjectToDM ;
import com.sdm.project.common.MemberTypeEnum ;
import com.sdm.project.c omm on.TaskExeStatusEnum ;
import com.sdm.project.dao.SimulationNodeMapper ;
import com.sdm.project.model.bo.TaskNodeTag ;
import com.sdm.project.model.entity.SimulationNode ;
import com.sdm.project.model.entity.SimulationTask ;
import com.sdm.project.model.entity.SimulationTaskExtra ;
import com.sdm.project.model.entity.SimulationTaskMember ;
import com.sdm.project.model.vo.SpdmNodeExtraVo ;
import com.sdm.project.service.INodeService ;
import com.sdm.project.service.ISimulationTaskExtraService ;
import com.sdm.project.service.ISimulationTaskMemberService ;
import com.sdm.project.service.ISimulationTaskService ;
import com.xxl.job.core.handler.annotation.XxlJob ;
import lombok.extern.slf4j.Slf4j ;
import org.apache.commons.collections4.CollectionUtils ;
import org.apache.commons.lang3.ObjectUtils ;
import org.apache.commons.lang3.StringUtils ;
import org.springfra mew ork.beans.factory.annotation.Autowired ;
import org.springframework.beans.factory.annotation.Value ;
import org.springframework.stereotype.Comp one nt;
import org.springframework.stereotype.Service ;
import javax.annotation. Resource;
import java.time.LocalDateTime ;
import java.time.format.DateTimeFormatter ;
import java.time.temporal.ChronoUnit ;
import java.util.* ;
import java.util.stream.Collectors ;
import static com.sdm.project.model.entity.SimulationTaskExtra.PROPERTY_NAME_ACTUAL_PROGRESS ;
import static com.sdm.project.service.impl.NodeServiceImpl.SYNC_PROJECT_SOURCE ;
@Slf4j
@Component
public class CommitmentDeadlineStatusScheduleExecutor {
// 时间格式化器: 全局常量, 线程安全, 可复用( yyyy-MM-dd HH:mm:ss 固定格式)
private static final DateTimeFormatter DATE_TIME_FORMATTER = DateTimeFormatter . ofPattern ( " yyyy-MM-dd HH:mm:ss " ) ;
@Value ( " ${commitmentDeadlineStatusTask.schedule.calculationInterval:5} " )
private int calculationInterval ;
@Resource
private INodeService nodeService ;
@Autowired
private SimulationNodeMapper nodeMapper ;
@Resource
private ISimulationTaskService taskService ;
@Resource
private ISimulationTaskMemberService taskMemberService ;
@Resource
private ISimulationTaskExtraService taskExtraService ;
@Autowired
private TaskProgressService taskProgressService ;
@Autowired
private MessageFeignClientImpl messageFeignClient ;
public static final String LIST_RELEASE_TIME = " listReleaseTime " ;
public static final String THREE_D_DESIGN = " 3D设计 " ;
@XxlJob ( " commitmentDeadlineStatusHandler " )
public void commitmentDeadlineStatusHandler ( ) {
log . info ( " 项目是否延期的定时任务执行中 " ) ;
try {
// 1. 获取所有节点(工位)
List < SimulationNode > nodeList = nodeService . lambdaQuery ( ) . eq ( SimulationNode : : getNodeType , NodeTypeEnum . WORKSPACE )
. eq ( SimulationNode : : getProjectSource , SYNC_PROJECT_SOURCE ) . isNotNull ( SimulationNode : : getCommitmentDeadline )
. list ( ) ;
Map < String , String > nodeMap = new HashMap < > ( ) ;
if ( CollectionUtils . isNotEmpty ( nodeList ) ) {
// nodeMap = nodeList.stream().filter(node -> StringUtils.isNotBlank(node.getCommitmentDeadline()))
// .collect(Collectors.toMap(SimulationNode::getUuid,SimulationNode::getCommitmentDeadline));
// }
// // 2. 获取所有任务
// List<SimulationTask> taskList = taskService.lambdaQuery()
// .in(SimulationTask::getExeStatus, Arrays.asList(TaskExeStatusEnum.NO_CONFIRM.getCode()
// , TaskExeStatusEnum.NO_STARTED.getCode(), TaskExeStatusEnum.IN_PROGRESS.getCode()))
// .list();
// // 3. 计算间隔时间(单位:天)
//// if ( CollectionUtils.isNotEmpty(nodeList)) {
//// List<SimulationNode> updateNodeList = handleNodeCommitmentDeadlineStatus(nodeList) ;
//// if (CollectionUtils.isNotEmpty(updateNodeList)) {
//// log.info("共有:{}个节点已延期", updateNodeList.size());
//// nodeService.updateBatchById(updateNodeList);
//// } else {
//// log.info("无节点延期");
//// }
//// } else {
//// log.info("无节点延期") ;
//// }
//
// if (CollectionUtils.isNotEmpty(taskList)) {
// for (SimulationTask simulationTask : taskList) {
// // 取工位的军令状时间
// String workspaceNodeId = simulationTask.getTag5();
// if (StringUtils.isBlank(workspaceNodeId)) {
// continue;
// }
// simulationTask.setCommitmentDeadline(nodeMap.get(workspaceNodeId));
// }
// taskList = taskList.stream().filter(task -> StringUtils.isNotBlank(task.getCommitmentDeadline())).toList() ;
// List<SimulationTask> updateTaskList = new ArrayList<>();
// if (CollectionUtils.isNotEmpty(taskList)) {
// updateTaskList = handleTaskCommitmentDeadlineStatus(taskList) ;
// }
// if (CollectionUtils.isNotEmpty(updateTaskList)) {
// log.info("共有:{}个任务已延期, 延期的任务id为: {}", updateTaskList.size(),updateTaskList.stream().map(SimulationTask::getId).toList());
// taskService.updateBatchById(updateTaskList);
// } else {
// log.info("无任务延期");
// }
// } else {
// log.info("无任务延期") ;
// }
// } catch (Exception ex) {
// log.error("定时任务执行异常", ex);
// }
//
// }
//
// /**
// * 核心方法: 根据截止时间和间隔天数, 判断并更新SimulationNode的exeStatus
// *
// * @param node 待处理的实体对象
// * @param calculationInterval 间隔天数( int, 单位: 天)
// */
// public static void updateNodeStatus(SimulationNode node, int calculationInterval) {
// // 1. 判空
// if (node.getCommitmentDeadline().trim().isEmpty()) {
// return;
// }
// // 2. 字符串转日期对象
// LocalDateTime deadlineTime = LocalDateTime.parse(node.getCommitmentDeadline().trim(), DATE_TIME_FORMATTER) ;
// LocalDateTime currentTime = LocalDateTime.now();
// // 3. 先计算两个时间的毫秒差值
// long diffMillis = ChronoUnit.MILLIS.between(currentTime, deadlineTime) ;
// // 1天 = 24*60*60*1000 毫秒 = 86400000L 毫秒,换算成带小数的天数
// double daysBetween = diffMillis / 86400000.0D ;
// // 4. 业务判断:精准天数 > 配置间隔天数 → 更新状态为:已延期
// if (daysBetween < calculationInterval) {
// node.setExeStatus(TaskExeStatusEnum.POSTPONED.getCode()) ;
// }
// }
//
// private List<SimulationNode> handleNodeCommitmentDeadlineStatus(List<SimulationNode> nodeList) {
// List<SimulationNode> updateNodeList = new ArrayList<>() ;
// for (SimulationNode simulationNode : nodeList) {
// updateNodeStatus(simulationNode, calculationInterval) ;
// if (TaskExeStatusEnum.POSTPONED.getCode().equals(simulationNode.getExeStatus())) {
// updateNodeList.add(simulationNode);
// }
// }
// return updateNodeList ;
// }
//
// public static void updateTaskStatus(SimulationTask task, int calculationInterval) {
// // 1. 判空
// if (task.getCommitmentDeadline().trim().isEmpty()) {
// return;
// }
// // 2. 字符串转日期对象
// LocalDateTime deadlineTime = LocalDateTime.parse(task.getCommitmentDeadline().trim(), DATE_TIME_FORMATTER) ;
// LocalDateTime currentTime = LocalDateTime.now();
// // 3. 先计算两个时间的毫秒差值
// long diffMillis = ChronoUnit.MILLIS.between(currentTime, deadlineTime) ;
// // 1天 = 24*60*60*1000 毫秒 = 86400000L 毫秒,换算成带小数的天数
// double daysBetween = diffMillis / 86400000.0D;
// // 4. 业务判断:精准天数 > 配置间隔天数 → 更新状态为:已延期
// if (daysBetween < calculationInterval) {
// task.setExeStatus(TaskExeStatusEnum.POSTPONED.getCode());
// }
// }
//
// private List<SimulationTask> handleTaskCommitmentDeadlineStatus(List<SimulationTask> taskList) {
// List<SimulationTask> updateTaskList = new ArrayList<>();
// for (SimulationTask simulationTask : taskList) {
// updateTaskStatus(simulationTask, calculationInterval);
// if (TaskExeStatusEnum.POSTPONED.getCode().equals(simulationTask.getExeStatus())) {
// updateTaskList.add(simulationTask) ;
// }
// }
// return updateTaskList ;
// }
//
//}
List < String > nodeIdList = nodeList . stream ( ) . map ( SimulationNode : : getUuid ) . toList ( ) ;
List < SpdmNodeExtraVo > nodeExtraList = nodeMapper . getNodeExtraListByNodeIdList ( nodeIdList ) ;
if ( CollectionUtils . isEmpty ( nodeExtraList ) ) {
log . info ( " 项目是否延期的定时任务中未查询到工位的拓展属性 " ) ;
return ;
}
List < SpdmNodeExtraVo > listReleaseTimeExtraList = nodeExtraList . stream ( ) . filter ( nodeExtra - > LIST_RELEASE_TIME . equals ( nodeExtra . getPropertyName ( ) ) ) . toList ( ) ;
if ( CollectionUtils. isEmpty ( listReleaseTimeExtraList ) ) {
log . info ( " 项目是否延期的定时任务中未查询到工位的军令状时间 " ) ;
return ;
}
nodeMap = listReleaseTimeExtraList . stream ( )
. collect ( Collectors . toMap (
SpdmNodeExtraVo : : getNodeId ,
SpdmNodeExtraVo : : getPropertyValue ,
( existing , replacement ) - > existing
) ) ;
for ( SimulationNode simulationNode : nodeList ) {
simulationNode . setCommitmentDeadline ( nodeMap . get ( simulationNode . getUuid ( ) ) ) ;
}
}
// 2. 获取所有任务
List < SimulationTask > taskList = taskService . lambdaQuery ( )
. in ( SimulationTask : : getExeStatus , Arrays . asList ( TaskExeStatusEnum . NO_CONFIRM . getCode ( )
, TaskExeStatusEnum . NO_STARTED . getCode ( ) , TaskExeStatusEnum . IN_PROGRESS . getCode ( ) ) )
. list ( ) ;
// 3. 计算间隔时间(单位:天)
if ( CollectionUtils . isNotEmpty ( nodeList ) ) {
List < SimulationNode > updateNodeList = handleNodeCommitmentDeadlineStatus ( nodeList ) ;
if ( CollectionUtils . isNotEmpty ( updateNodeList ) ) {
log . info ( " 共有:{}个节点已延期 " , updateNodeList . size ( ) ) ;
nodeService . updateBatchById ( updateNodeList ) ;
} else {
log . info ( " 无节点延期 " ) ;
}
} else {
log . info ( " 无节点延期 " ) ;
}
// 查询任务进度状态的字典
Map < String , String > taskProgressMap = taskProgressService . getMapName ( ) ;
// 若实际达成进度超过 3D设计, 则不发消息给提出人
int taskProgressValue = 0 ;
if ( isConvertibleToInt ( taskProgressMap . get ( THREE_D_DESIGN ) ) ) {
taskProgressValue = Integer . parseInt ( taskProgressMap . get ( THREE_D_DESIGN ) ) ;
} else {
log . error ( " 未查询到3D设计的字典值, 或字典值不为数字。{} " , taskProgressMap . get ( THREE_D_DESIGN ) ) ;
taskProgressValue = - 1 ;
}
log . info ( " taskProgressValue为: {} " , taskProgressValue ) ;
if ( CollectionUtils . isNotEmpty ( taskList ) ) {
for ( SimulationTask simulationTask : taskList ) {
// 取工位的军令状时间
String workspaceNodeId = simulationTask . getTag5 ( ) ;
if ( StringUtils . isBlank ( workspaceNodeId ) ) {
continue ;
}
simulationTask . setCommitmentDeadline ( nodeMap . get ( workspaceNodeId ) ) ;
}
taskList = taskList . stream ( ) . filter ( task - > StringUtils . isNotBlank ( task . getCommitmentDeadline ( ) ) ) . toList ( ) ;
List < SimulationTask > updateTaskList = new ArrayList < > ( ) ;
if ( CollectionUtils . isNotEmpty ( taskList ) ) {
updateTaskList = handleTaskCommitmentDeadlineStatus ( taskList ) ;
}
if ( CollectionUtils . isNotEmpty ( updateTaskList ) ) {
log . info ( " 共有:{}个任务已延期, 延期的任务id为: {} " , updateTaskList . size ( ) , updateTaskList . stream ( ) . map ( SimulationTask : : getId ) . toList ( ) ) ;
taskService . updateBatchById ( updateTaskList ) ;
// 查询任务的执行人
List < SimulationTaskMember > executorUserList = taskMemberService . lambdaQuery ( ) . in ( SimulationTaskMember : : getTaskId , updateTaskList . stream ( ) . map ( SimulationTask : : getUuid ) . toList ( ) )
. eq ( SimulationTaskMember : : getType , MemberTypeEnum . EXECUTOR ) . list ( ) ;
Map < String , List < SimulationTaskMember > > taskMemberMap = new HashMap < > ( ) ;
if ( CollectionUtils . isNotEmpty ( executorUserList ) ) {
taskMemberMap = executorUserList . stream ( ) . collect ( Collectors . groupingBy ( SimulationTaskMember : : getTaskId ) ) ;
}
// 查询任务的拓展属性(实际达成进度)
List < SimulationTaskExtra > actualProgressList = taskExtraService . lambdaQuery ( ) . in ( SimulationTaskExtra : : getTaskId , updateTaskList . stream ( ) . map ( SimulationTask : : getUuid ) . toList ( ) )
. eq ( SimulationTaskExtra : : getPropertyName , PROPERTY_NAME_ACTUAL_PROGRESS ) . list ( ) ;
Map < String , String > actualProgressMap = new HashMap < > ( ) ;
if ( CollectionUtils . isNotEmpty ( actualProgressList ) ) {
actualProgressMap = actualProgressList . stream ( )
. collect ( Collectors . toMap (
SimulationTaskExtra : : getTaskId ,
SimulationTaskExtra : : getPropertyValue ,
( oldValue , newValue ) - > oldValue
) ) ;
}
List < SimulationTaskMember > currentTaskMemberList ;
for ( SimulationTask simulationTask : updateTaskList ) {
// 若实际达成进度不超过 3D设计, 则发消息给提出人
String actualProgress = actualProgressMap . get ( simulationTask . getUuid ( ) ) ;
log . info ( " actualProgress为: {} " , actualProgress ) ;
if ( StringUtils . isNotBlank ( actualProgress ) ) {
String actualProgressValueStr = taskProgressMap . get ( actualProgress ) ;
log . info ( " actualProgressValueStr为: {} " , actualProgressValueStr ) ;
if ( StringUtils . isNotBlank ( actualProgressValueStr ) & & isConvertibleToInt ( actualProgressValueStr ) ) {
int actualProgressValue = Integer . parseInt ( actualProgressValueStr ) ;
if ( ( taskProgressValue = = - 1 | | actualProgressValue < = taskProgressValue )
& & ObjectUtils . isNotEmpty ( simulationTask . getCreator ( ) ) ) {
sendMessage ( MessageTemplateEnum . TASK_OVERDUE , simulationTask . getTaskName ( ) , String . valueOf ( simulationTask . getCreator ( ) ) , simulationTask . getUuid ( ) ) ;
}
}
}
// 发消息给执行人
currentTaskMemberList = taskMemberMap . get ( simulationTask . getUuid ( ) ) ;
if ( CollectionUtils . isEmpty ( currentTaskMemberList ) ) {
log . info ( " 未查询到任务:{}的执行人,无法发送消息 " , simulationTask . getUuid ( ) ) ;
continue ;
}
for ( SimulationTaskMember simulationTaskMember : currentTaskMemberList ) {
sendMessage ( MessageTemplateEnum . TASK_OVERDUE , simulationTask . getTaskName ( ) , String . valueOf ( simulationTaskMember . getUserId ( ) ) , simulationTask . getUuid ( ) ) ;
}
}
} else {
log . info ( " 无任务延期 " ) ;
}
} else {
log . info ( " 无任务延期 " ) ;
}
} catch ( Exception ex ) {
log . error ( " 定时任务执行异常 " , ex ) ;
}
}
/**
* 核心方法: 根据截止时间和间隔天数, 判断并更新SimulationNode的exeStatus
*
* @param node 待处理的实体对象
* @param calculationInterval 间隔天数( int, 单位: 天)
*/
public static void updateNodeStatus ( SimulationNode node , int calculationInterval ) {
// 1. 判空
if ( node . getCommitmentDeadline ( ) . trim ( ) . isEmpty ( ) ) {
return ;
}
// 2. 字符串转日期对象
LocalDateTime deadlineTime = LocalDateTime . parse ( node . getCommitmentDeadline ( ) . trim ( ) , DATE_TIME_FORMATTER ) ;
LocalDateTime currentTime = LocalDateTime . now ( ) ;
// 3. 先计算两个时间的毫秒差值
long diffMillis = ChronoUnit . MILLIS . between ( currentTime , deadlineTime ) ;
// 1天 = 24*60*60*1000 毫秒 = 86400000L 毫秒,换算成带小数的天数
double daysBetween = diffMillis / 86400000 . 0D ;
// 4. 业务判断:精准天数 > 配置间隔天数 → 更新状态为:已延期
if ( daysBetween < calculationInterval ) {
node . setExeStatus ( TaskExeStatusEnum . POSTPONED . getCode ( ) ) ;
}
}
private List < SimulationNode > handleNodeCommitmentDeadlineStatus ( List < SimulationNode > nodeList ) {
List < SimulationNode > updateNodeList = new ArrayList < > ( ) ;
for ( SimulationNode simulationNode : nodeList ) {
updateNodeStatus ( simulationNode , calculationInterval ) ;
if ( TaskExeStatusEnum . POSTPONED . getCode ( ) . equals ( simulationNode . getExeStatus ( ) ) ) {
updateNodeList . add ( simulationNode ) ;
}
}
return updateNodeList ;
}
public static void updateTaskStatus ( SimulationTask task , int calculationInterval ) {
// 1. 判空
if ( task . getCommitmentDeadline ( ) . trim ( ) . isEmpty ( ) ) {
return ;
}
// 2. 字符串转日期对象
LocalDateTime deadlineTime = LocalDateTime . parse ( task . getCommitmentDeadline ( ) . trim ( ) , DATE_TIME_FORMATTER ) ;
LocalDateTime currentTime = LocalDateTime . now ( ) ;
// 3. 先计算两个时间的毫秒差值
long diffMillis = ChronoUnit . MILLIS . between ( currentTime , deadlineTime ) ;
// 1天 = 24*60*60*1000 毫秒 = 86400000L 毫秒,换算成带小数的天数
double daysBetween = diffMillis / 86400000 . 0D ;
// 4. 业务判断:精准天数 > 配置间隔天数 → 更新状态为:已延期
if ( daysBetween < calculationInterval ) {
task . setExeStatus ( TaskExeStatusEnum . POSTPONED . getCode ( ) ) ;
}
}
private List < SimulationTask > handleTaskCommitmentDeadlineStatus ( List < SimulationTask > taskList ) {
List < SimulationTask > updateTaskList = new ArrayList < > ( ) ;
for ( SimulationTask simulationTask : taskList ) {
updateTaskStatus ( simulationTask , calculationInterval ) ;
if ( TaskExeStatusEnum . POSTPONED . getCode ( ) . equals ( simulationTask . getExeStatus ( ) ) ) {
updateTaskList . add ( simulationTask ) ;
}
}
return updateTaskList ;
}
private void sendMessage ( MessageTemplateEnum templateEnum , String taskName , String userId , String uuid ) {
SendMsgReq req = new SendMsgReq ( ) ;
req . setTitle ( templateEnum . getTitle ( ) ) ;
req . setContent ( templateEnum . getContent ( taskName ) ) ;
req . setTenantId ( ThreadLocalContext . getTenantId ( ) . toString ( ) ) ;
req . setUserId ( userId ) ;
JSONObject params = new JSONObject ( ) ;
params . put ( " taskId " , uuid ) ;
req . setParams ( JSONObject . toJSONString ( params ) ) ;
messageFeignClient . sendMessage ( req ) ;
}
/**
* 判断字符串是否可以安全转换为int类型
*
* @param str 待判断的字符串
* @return true-可以安全转换, false-不可以
*/
public static boolean isConvertibleToInt ( String str ) {
// 1. 处理null或空字符串
if ( str = = null | | str . trim ( ) . isEmpty ( ) ) {
return false ;
}
// 去除首尾空格
String trimmedStr = str . trim ( ) ;
// 2. 正则校验:匹配整数格式(可选的正负号 + 至少1位数字)
// 正则说明:^[-+]? 匹配开头的正负号(可选);\\d+ 匹配至少1位数字; $ 匹配字符串结尾
if ( ! trimmedStr . matches ( " ^[-+]? \\ d+$ " ) ) {
return false ;
}
try {
// 3. 先尝试转换为long( 避免int范围溢出) , 再判断是否在int范围内
long num = Long . parseLong ( trimmedStr ) ;
return num > = Integer . MIN_VALUE & & num < = Integer . MAX_VALUE ;
} catch ( NumberFormatException e ) {
// 理论上正则校验通过后不会走到这里,做兜底处理
return false ;
}
}
}