feat: optimize permission control and parameter sorting
This commit is contained in:
parent
e6a58a0633
commit
1776c8ee61
3
.arts/build.settings
Normal file
3
.arts/build.settings
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"buildWith" : "Maven"
|
||||
}
|
||||
34
.arts/launch.json
Normal file
34
.arts/launch.json
Normal file
@ -0,0 +1,34 @@
|
||||
{
|
||||
"configurations": [
|
||||
{
|
||||
"request": "launch",
|
||||
"type": "javadbg",
|
||||
"name": "MainApplication",
|
||||
"__internal_id": "13aea8e3-f808-42f0-8e56-5bb0efb7e3f2",
|
||||
"temporary": false,
|
||||
"verbose": false,
|
||||
"allowMany": false,
|
||||
"mainClass": {
|
||||
"name": "com.xdap.self_development.MainApplication",
|
||||
"sourcePath": "${workspaceFolder}/src/main/java/com/xdap/self_development/MainApplication.java",
|
||||
"shell": "internal-console",
|
||||
"skipBuild": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"request": "launch",
|
||||
"type": "javadbg",
|
||||
"name": "MainApplication",
|
||||
"__internal_id": "50484e34-898c-4ed1-aa39-8b8ffee574f0",
|
||||
"temporary": false,
|
||||
"verbose": false,
|
||||
"allowMany": false,
|
||||
"mainClass": {
|
||||
"name": "com.xdap.self_development.MainApplication",
|
||||
"sourcePath": "${workspaceFolder}/src/main/java/com/xdap/self_development/MainApplication.java",
|
||||
"shell": "internal-console",
|
||||
"skipBuild": false
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
5
.arts/settings.json
Normal file
5
.arts/settings.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"clawMode.mode": "editor",
|
||||
"workbench.activityBar.location": "default",
|
||||
"debug.internalConsoleOptions": "neverOpen"
|
||||
}
|
||||
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
.preferences
|
||||
10
.idea/.gitignore
generated
vendored
Normal file
10
.idea/.gitignore
generated
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
# 默认忽略的文件
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# 基于编辑器的 HTTP 客户端请求
|
||||
/httpRequests/
|
||||
# 依赖于环境的 Maven 主目录路径
|
||||
/mavenHomeManager.xml
|
||||
# Datasource local storage ignored files
|
||||
/dataSources/
|
||||
/dataSources.local.xml
|
||||
19
.idea/compiler.xml
generated
Normal file
19
.idea/compiler.xml
generated
Normal file
@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="CompilerConfiguration">
|
||||
<annotationProcessing>
|
||||
<profile default="true" name="Default" enabled="true" />
|
||||
<profile name="Maven default annotation processors profile" enabled="true">
|
||||
<sourceOutputDir name="target/generated-sources/annotations" />
|
||||
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
|
||||
<outputRelativeToContentRoot value="true" />
|
||||
<module name="self_development" />
|
||||
</profile>
|
||||
</annotationProcessing>
|
||||
</component>
|
||||
<component name="JavacSettings">
|
||||
<option name="ADDITIONAL_OPTIONS_OVERRIDE">
|
||||
<module name="self_development" options="-parameters" />
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
||||
17
.idea/dataSources.xml
generated
Normal file
17
.idea/dataSources.xml
generated
Normal file
@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="DataSourceManagerImpl" format="xml" multifile-model="true">
|
||||
<data-source source="LOCAL" name="test@localhost" uuid="8be6503d-ae6d-499c-a10f-516d1b8c96bc">
|
||||
<driver-ref>mysql_aurora.aws_wrapper</driver-ref>
|
||||
<synchronize>true</synchronize>
|
||||
<jdbc-driver>software.amazon.jdbc.Driver</jdbc-driver>
|
||||
<jdbc-url>jdbc:aws-wrapper:mysql://localhost:3306/test</jdbc-url>
|
||||
<jdbc-additional-properties>
|
||||
<property name="com.intellij.clouds.kubernetes.db.host.port" />
|
||||
<property name="com.intellij.clouds.kubernetes.db.enabled" value="false" />
|
||||
<property name="com.intellij.clouds.kubernetes.db.container.port" />
|
||||
</jdbc-additional-properties>
|
||||
<working-dir>$ProjectFileDir$</working-dir>
|
||||
</data-source>
|
||||
</component>
|
||||
</project>
|
||||
6
.idea/encodings.xml
generated
Normal file
6
.idea/encodings.xml
generated
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Encoding">
|
||||
<file url="file://$PROJECT_DIR$/src/main/java" charset="UTF-8" />
|
||||
</component>
|
||||
</project>
|
||||
30
.idea/jarRepositories.xml
generated
Normal file
30
.idea/jarRepositories.xml
generated
Normal file
@ -0,0 +1,30 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="RemoteRepositoriesConfiguration">
|
||||
<remote-repository>
|
||||
<option name="id" value="central" />
|
||||
<option name="name" value="Central Repository" />
|
||||
<option name="url" value="http://maven.aliyun.com/nexus/content/groups/public/" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="dcloud-public" />
|
||||
<option name="name" value="dcloud-public" />
|
||||
<option name="url" value="https://registry.dfy.definesys.cn/repository/maven-public/" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="central" />
|
||||
<option name="name" value="Maven Central repository" />
|
||||
<option name="url" value="https://repo1.maven.org/maven2" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="jboss.community" />
|
||||
<option name="name" value="JBoss Community repository" />
|
||||
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="nexus" />
|
||||
<option name="name" value="nexus" />
|
||||
<option name="url" value="http://172.16.135.10:9081/repository/maven-public/" />
|
||||
</remote-repository>
|
||||
</component>
|
||||
</project>
|
||||
12
.idea/misc.xml
generated
Normal file
12
.idea/misc.xml
generated
Normal file
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||
<component name="MavenProjectsManager">
|
||||
<option name="originalFiles">
|
||||
<list>
|
||||
<option value="$PROJECT_DIR$/pom.xml" />
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK" />
|
||||
</project>
|
||||
6
.idea/vcs.xml
generated
Normal file
6
.idea/vcs.xml
generated
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
1
.jlsp/debugger/breakpoints.json
Normal file
1
.jlsp/debugger/breakpoints.json
Normal file
@ -0,0 +1 @@
|
||||
{"version":1,"breakpoints":[]}
|
||||
1
.jlsp/debugger/expressions.json
Normal file
1
.jlsp/debugger/expressions.json
Normal file
@ -0,0 +1 @@
|
||||
{"version":1}
|
||||
1
.jlsp/debugger/type_renderers.json
Normal file
1
.jlsp/debugger/type_renderers.json
Normal file
@ -0,0 +1 @@
|
||||
{"version":4,"renderers":[]}
|
||||
1
.jlsp/debugger/views_state.json
Normal file
1
.jlsp/debugger/views_state.json
Normal file
@ -0,0 +1 @@
|
||||
{"version":1}
|
||||
1
.jlsp/debugger/watches.json
Normal file
1
.jlsp/debugger/watches.json
Normal file
@ -0,0 +1 @@
|
||||
{"version":1}
|
||||
13888
.project-meta/project-java-metadata.xml
Normal file
13888
.project-meta/project-java-metadata.xml
Normal file
File diff suppressed because it is too large
Load Diff
6279
.project-meta/project-maven-metadata.xml
Normal file
6279
.project-meta/project-maven-metadata.xml
Normal file
File diff suppressed because it is too large
Load Diff
4
pom.xml
4
pom.xml
@ -29,7 +29,7 @@
|
||||
<groovy.eclipse.batch.version>2.4.3-01</groovy.eclipse.batch.version>
|
||||
<papaas.version>4.0.7-rc</papaas.version>
|
||||
<mpaas.version>apaas-1.1.18.4-RELEASE</mpaas.version>
|
||||
<lombok.version>1.18.12</lombok.version>
|
||||
<lombok.version>1.18.34</lombok.version>
|
||||
<plugins.version>2.0.0</plugins.version>
|
||||
</properties>
|
||||
|
||||
@ -61,7 +61,7 @@
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<version>1.18.20</version>
|
||||
<version>1.18.34</version>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
|
||||
|
||||
@ -218,7 +218,7 @@ public class ActivitiProcessController {
|
||||
*/
|
||||
@GetMapping("/getReturnNodes")
|
||||
public Response getReturnNodes(
|
||||
@NotBlank String flowId
|
||||
@NotBlank @RequestParam String flowId
|
||||
) {
|
||||
List<String> result = activitiProcessService.getReturnNodes(flowId);
|
||||
return Response.ok().data(result);
|
||||
|
||||
@ -227,7 +227,7 @@ public class BenchmarkingReportController {
|
||||
* @return 操作结果响应
|
||||
*/
|
||||
@PostMapping("/updateReport")
|
||||
public Response restartReportApproval(
|
||||
public Response updateReport(
|
||||
@Valid @RequestBody UpdateBenchmarkingReportForm form,
|
||||
BindingResult bindingResult
|
||||
) {
|
||||
@ -290,7 +290,7 @@ public class BenchmarkingReportController {
|
||||
*/
|
||||
@GetMapping("/getReportDetail")
|
||||
public Response getReportDetail(
|
||||
@NotBlank String reportId
|
||||
@NotBlank @RequestParam String reportId
|
||||
) {
|
||||
BenchmarkingReportPojo report = benchmarkingReportService
|
||||
.getReportDetail(reportId);
|
||||
@ -305,7 +305,7 @@ public class BenchmarkingReportController {
|
||||
*/
|
||||
@GetMapping("/getReportProcess")
|
||||
public Response getReportProcess(
|
||||
@NotBlank String flowId
|
||||
@NotBlank @RequestParam String flowId
|
||||
) {
|
||||
ApprovalFlowNodeView approvalFlowView = benchmarkingReportService.getReportProcess(flowId);
|
||||
return Response.ok().data(approvalFlowView);
|
||||
|
||||
@ -78,7 +78,7 @@ public class EngineParamDetailController {
|
||||
*/
|
||||
@GetMapping("/selectParamListAndModel")
|
||||
public Response selectParamListAndModel(
|
||||
@RequestParam(value = "modelID"/*, required = false*/) String modelID,
|
||||
@RequestParam(value = "modelID") String modelID,
|
||||
@RequestParam(required = false) Integer parameterVersion,
|
||||
@RequestParam(required = false) String userID
|
||||
) {
|
||||
@ -86,6 +86,26 @@ public class EngineParamDetailController {
|
||||
return Response.ok().data(list);
|
||||
}
|
||||
|
||||
@GetMapping("/selectParamListAndModelForFilledBy")
|
||||
public Response selectParamListAndModelForFilledBy(
|
||||
@RequestParam(value = "modelID") String modelID,
|
||||
@RequestParam(required = false) Integer parameterVersion,
|
||||
@RequestParam(value = "userID") String userID
|
||||
) {
|
||||
Map<String, Map<String, Set<String>>> list = engineParamDetailService.selectParamListAndModelForFilledBy(modelID, parameterVersion, userID);
|
||||
return Response.ok().data(list);
|
||||
}
|
||||
|
||||
@GetMapping("/selectParamListAndModelForFilledByHistory")
|
||||
public Response selectParamListAndModelForFilledByHistory(
|
||||
@RequestParam(value = "modelID") String modelID,
|
||||
@RequestParam(required = false) Integer parameterVersion,
|
||||
@RequestParam(value = "userID") String userID
|
||||
) {
|
||||
Map<String, Map<String, Set<String>>> list = engineParamDetailService.selectParamListAndModelForFilledByHistory(modelID, parameterVersion, userID);
|
||||
return Response.ok().data(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 参数值查询(一般不用)
|
||||
*
|
||||
@ -151,10 +171,11 @@ public class EngineParamDetailController {
|
||||
public Response excelExport(
|
||||
HttpServletResponse response,
|
||||
@RequestParam String engineModelID,
|
||||
@RequestParam String userId
|
||||
@RequestParam String userId,
|
||||
@RequestParam(required = false) java.util.List<String> subsystemParts
|
||||
) {
|
||||
try {
|
||||
engineParamDetailService.excelExport(response, engineModelID, userId);
|
||||
engineParamDetailService.excelExport(response, engineModelID, userId, subsystemParts);
|
||||
} catch (Exception e) {
|
||||
return Response.error("导出失败" + e.getMessage());
|
||||
}
|
||||
|
||||
@ -224,7 +224,7 @@ public class TemplateApprovalController {
|
||||
*/
|
||||
@GetMapping("/getReturnNodes")
|
||||
public Response getReturnNodes(
|
||||
@NotBlank String flowId
|
||||
@NotBlank @RequestParam String flowId
|
||||
) {
|
||||
List<String> result = templateApprovalService.getReturnNodes(flowId);
|
||||
return Response.ok().data(result);
|
||||
|
||||
@ -8,7 +8,7 @@ import lombok.Getter;
|
||||
public enum AuthorizationClassEnum {
|
||||
TEMPLATE_VIEW("1", "参数模板管理"),
|
||||
TEMPLATE_EDIT("2", "参数模板管理"),
|
||||
TEMPLATE_APPROVAL("1", "参数模板流程"),
|
||||
TEMPLATE_APPROVAL("1", "参数模板管理"),
|
||||
|
||||
ENGINE_VIEW("1", "发动机数据"),
|
||||
ENGINE_EDIT("2", "发动机数据"),
|
||||
|
||||
@ -11,8 +11,11 @@ import org.springframework.web.servlet.HandlerInterceptor;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
@Component
|
||||
public class AuthorizationInterceptor implements HandlerInterceptor {
|
||||
@ -23,6 +26,30 @@ public class AuthorizationInterceptor implements HandlerInterceptor {
|
||||
@Autowired
|
||||
private RuntimeAppContextService runtimeAppContextService;
|
||||
|
||||
private static final Set<String> WHITE_LIST = new HashSet<>(Arrays.asList(
|
||||
"/custom/activiti/getIsDirect",
|
||||
"/custom/engineParamDetailPojo/updateParamValue",
|
||||
"/custom/activiti/initiateApproval",
|
||||
"/custom/activiti/startActiviti",
|
||||
"/custom/activiti/directSendingApproval",
|
||||
"/custom/activiti/getApprovalUsers",
|
||||
"/custom/activiti/continueApproval",
|
||||
"/custom/activiti/handleApproval",
|
||||
"/custom/activiti/showActiviti",
|
||||
"/custom/permission/selectPersByUser",
|
||||
"/custom/approval/handleApproval",
|
||||
"/custom/approval/handleReturnToNode",
|
||||
"/custom/activiti/handleReturnToNode",
|
||||
"/custom/approval/handleReturn",
|
||||
"/custom/activiti/getReturnNodes",
|
||||
"/custom/approval/getReturnNodes",
|
||||
"/custom/engineParamDetailPojo/selectParamListAndModelForFilledBy",
|
||||
"/custom/engineParamDetailPojo/selectParamListAndModelForFilledByHistory",
|
||||
"/custom/YcTaskResult/getCompletedById",
|
||||
"/custom/YcTaskResult/getTodoById",
|
||||
"/custom/YcTaskResult/getInitiatorById"
|
||||
));
|
||||
|
||||
// 请求路径与权限枚举的映射关系
|
||||
private static final Map<String, AuthorizationClassEnum> PATH_PERMISSION_MAP = new HashMap<>();
|
||||
|
||||
@ -72,6 +99,11 @@ public class AuthorizationInterceptor implements HandlerInterceptor {
|
||||
if (userId == null || userId.isEmpty()) {
|
||||
throw new CommonException("用户未登录或登录已过期");
|
||||
}
|
||||
|
||||
if (WHITE_LIST.contains(servletPath)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
AuthorizationClassEnum requiredPermission = findRequiredPermission(servletPath);
|
||||
if (requiredPermission == null) {
|
||||
return true;
|
||||
|
||||
@ -1,9 +1,12 @@
|
||||
package com.xdap.self_development.job;
|
||||
|
||||
import com.xdap.self_development.common.BusinessDatabase;
|
||||
import com.xdap.self_development.domain.pojo.ClassificationAttributePojo;
|
||||
import com.xdap.self_development.domain.pojo.EnginePartsCollectionPojo;
|
||||
import com.xdap.self_development.domain.view.CalculationParameterView;
|
||||
import com.xdap.self_development.exception.CommonException;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@ -54,6 +57,227 @@ public class ParameterValueCalculationTimer {
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* 定时任务:凌晨1点执行
|
||||
* 1. 查询来源为TC分类表且平台上为空的数据
|
||||
* 2. 从TC分类表更新数据到平台
|
||||
* 3. 执行公式计算
|
||||
* 4. 批量保存到数据库
|
||||
*/
|
||||
@Scheduled(cron = "0 0 1 * * ?")
|
||||
@Transactional
|
||||
public void scheduledParameterCalculation() {
|
||||
log.info("========== 开始执行定时任务:参数值计算 ==========");
|
||||
log.info("执行时间:{}", LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
|
||||
|
||||
try {
|
||||
// 步骤1:查询所有参数配置
|
||||
List<CalculationParameterView> parameterValues = bd.getBusinessDatabase()
|
||||
.viewQueryMode(true)
|
||||
.view("getModelParameterValue")
|
||||
.doQuery(CalculationParameterView.class);
|
||||
|
||||
log.info("共查询到{}个参数配置", parameterValues.size());
|
||||
|
||||
if (parameterValues.isEmpty()) {
|
||||
log.info("无参数配置,跳过计算");
|
||||
return;
|
||||
}
|
||||
|
||||
// 步骤2:从TC分类表更新参数值
|
||||
int tcUpdatedCount = updateParametersFromTC(parameterValues);
|
||||
log.info("TC分类表参数更新完成,成功更新{}个参数", tcUpdatedCount);
|
||||
|
||||
// 步骤3:构建初始值映射
|
||||
Map<String, Map<String, String>> currentValues = convertMap(parameterValues);
|
||||
|
||||
// 步骤4:执行公式计算
|
||||
List<CalculationParameterView> toUpdate = executeFormulaCalculation(parameterValues, currentValues);
|
||||
|
||||
// 步骤5:批量更新数据库
|
||||
batchUpdateDatabase(toUpdate);
|
||||
|
||||
log.info("========== 定时任务执行完成 ==========");
|
||||
|
||||
} catch (Exception e) {
|
||||
log.error("定时任务执行失败:{}", e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 从TC分类表更新参数值
|
||||
* 查询来源为TC分类表且平台上为空的数据
|
||||
*/
|
||||
private int updateParametersFromTC(List<CalculationParameterView> parameterValues) {
|
||||
int updatedCount = 0;
|
||||
int skippedCount = 0;
|
||||
|
||||
for (CalculationParameterView parameter : parameterValues) {
|
||||
if (!Objects.equals(parameter.getParameterSource(), "TC分类表")) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (parameter.getParameterValue() != null && !parameter.getParameterValue().trim().isEmpty()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
try {
|
||||
EnginePartsCollectionPojo enginePartsCollection = bd.getTCDatabase()
|
||||
.eq("ztj", parameter.getProductNumber())
|
||||
.eq("lbjmc", parameter.getPartsName())
|
||||
.doQueryFirst(EnginePartsCollectionPojo.class);
|
||||
|
||||
if (enginePartsCollection == null || enginePartsCollection.getLbjth() == null) {
|
||||
log.debug("机型【{}】的参数【{}】在TC分类表中未找到对应零部件,零部件名:{}",
|
||||
parameter.getProductNumber(), parameter.getParameterName(), parameter.getPartsName());
|
||||
skippedCount++;
|
||||
continue;
|
||||
}
|
||||
|
||||
ClassificationAttributePojo classificationAttribute = bd.getTCDatabase()
|
||||
.eq("pitemId", enginePartsCollection.getLbjth())
|
||||
.eq("idattrtbutehame", parameter.getParameterName())
|
||||
.doQueryFirst(ClassificationAttributePojo.class);
|
||||
|
||||
if (classificationAttribute != null && classificationAttribute.getFieldvalue() != null) {
|
||||
parameter.setParameterValue(classificationAttribute.getFieldvalue());
|
||||
log.info("机型【{}】的参数【{}】从TC更新值:{}",
|
||||
parameter.getProductNumber(), parameter.getParameterName(), classificationAttribute.getFieldvalue());
|
||||
updatedCount++;
|
||||
} else {
|
||||
log.debug("机型【{}】的参数【{}】在TC分类表中未找到对应值",
|
||||
parameter.getProductNumber(), parameter.getParameterName());
|
||||
skippedCount++;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("机型【{}】的参数【{}】从TC更新失败:{}",
|
||||
parameter.getProductNumber(), parameter.getParameterName(), e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
log.info("TC参数处理完成:成功更新{}个,跳过{}个", updatedCount, skippedCount);
|
||||
return updatedCount;
|
||||
}
|
||||
|
||||
/**
|
||||
* 执行公式计算
|
||||
*/
|
||||
private List<CalculationParameterView> executeFormulaCalculation(
|
||||
List<CalculationParameterView> parameterValues,
|
||||
Map<String, Map<String, String>> currentValues) {
|
||||
|
||||
List<CalculationParameterView> toUpdate = new ArrayList<>();
|
||||
|
||||
List<CalculationParameterView> formulaParamsList = parameterValues.stream()
|
||||
.filter(p -> "公式计算".equals(p.getParameterSource()))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
log.info("开始执行公式计算,共{}个公式参数", formulaParamsList.size());
|
||||
|
||||
int round = 0;
|
||||
final int MAX_ROUNDS = 5;
|
||||
boolean changed;
|
||||
Set<String> computedKeys = new HashSet<>();
|
||||
Map<String, String> errors = new HashMap<>();
|
||||
int successCount = 0;
|
||||
int failureCount = 0;
|
||||
|
||||
do {
|
||||
changed = false;
|
||||
round++;
|
||||
|
||||
for (CalculationParameterView param : formulaParamsList) {
|
||||
String modelId = param.getModelId();
|
||||
String paramName = param.getParameterName();
|
||||
String paramId = param.getParameterId();
|
||||
String key = modelId + "|" + paramId + "|" + paramName;
|
||||
|
||||
if (computedKeys.contains(key)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
try {
|
||||
String replacedFormula = replaceParametersInFormula(
|
||||
param.getNumberOrFormula(),
|
||||
currentValues,
|
||||
modelId,
|
||||
paramName
|
||||
);
|
||||
|
||||
Double result = calculateExpression(replacedFormula);
|
||||
if (result == null) {
|
||||
errors.put(key, "替换公式:'" + replacedFormula + "'无法计算" + ",原公式为:'" + param.getNumberOrFormula() + "'");
|
||||
continue;
|
||||
}
|
||||
String formattedResult = String.format("%.2f", result);
|
||||
|
||||
currentValues.computeIfAbsent(paramName, k -> new HashMap<>()).put(modelId, formattedResult);
|
||||
param.setParameterValue(formattedResult);
|
||||
|
||||
computedKeys.add(key);
|
||||
changed = true;
|
||||
|
||||
} catch (Exception e) {
|
||||
}
|
||||
}
|
||||
|
||||
} while (changed && round < MAX_ROUNDS);
|
||||
|
||||
for (CalculationParameterView param : formulaParamsList) {
|
||||
String key = param.getModelId() + "|" + param.getParameterId() + "|" + param.getParameterName();
|
||||
if (computedKeys.contains(key)) {
|
||||
successCount++;
|
||||
toUpdate.add(param);
|
||||
} else {
|
||||
String err = errors.get(key);
|
||||
if (err != null) {
|
||||
log.error("机型【{}】的参数【{}】公式计算失败,{}",
|
||||
param.getProductNumber(), param.getParameterName(), err);
|
||||
} else {
|
||||
log.error("机型【{}】的参数【{}】公式计算失败",
|
||||
param.getProductNumber(), param.getParameterName());
|
||||
}
|
||||
param.setParameterValue(null);
|
||||
toUpdate.add(param);
|
||||
failureCount++;
|
||||
}
|
||||
}
|
||||
|
||||
log.info("公式计算完成:成功{}个,失败{}个", successCount, failureCount);
|
||||
return toUpdate;
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量更新数据库
|
||||
*/
|
||||
private void batchUpdateDatabase(List<CalculationParameterView> toUpdate) {
|
||||
if (toUpdate.isEmpty()) {
|
||||
log.info("无需更新数据库");
|
||||
return;
|
||||
}
|
||||
|
||||
int updatedCount = 0;
|
||||
int failureCount = 0;
|
||||
|
||||
for (CalculationParameterView param : toUpdate) {
|
||||
try {
|
||||
if (param.getParameterValue() != null) {
|
||||
bd.getBusinessDatabase()
|
||||
.table("engine_param_detail")
|
||||
.eq("id", param.getId())
|
||||
.update("parameter_value", param.getParameterValue())
|
||||
.doUpdate();
|
||||
updatedCount++;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("参数【{}】更新数据库失败:{}", param.getParameterName(), e.getMessage());
|
||||
failureCount++;
|
||||
}
|
||||
}
|
||||
|
||||
log.info("数据库更新完成:成功{}个,失败{}个", updatedCount, failureCount);
|
||||
}
|
||||
|
||||
// 每天凌晨执行一次
|
||||
// @Scheduled(cron = "0 0 0 * * ?")
|
||||
@Transactional
|
||||
@ -127,7 +351,7 @@ public class ParameterValueCalculationTimer {
|
||||
// 3.构建初始值映射 —— 仅包含非公式参数
|
||||
Map<String, Map<String, String>> currentValues = convertMap(parameterValues);
|
||||
|
||||
// 4. 分离出所有“公式计算”类型的参数
|
||||
// 4. 分离出所有"公式计算"类型的参数
|
||||
List<CalculationParameterView> formulaParamsList = parameterValues.stream()
|
||||
.filter(p -> "公式计算".equals(p.getParameterSource()))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
@ -138,10 +138,17 @@ public class EngineModelListener implements ReadListener<DataEntryEngineModelExc
|
||||
|
||||
//为每个机型绑定参数
|
||||
private void saveDataParamDetail(ArrayList<DataEntryEngineModelPojo> modelPojos, List<ParameterPojo> parameters) {
|
||||
Map<String, ParameterPojo> uniqueParamsMap = new LinkedHashMap<>();
|
||||
for (ParameterPojo parameter : parameters) {
|
||||
String key = parameter.getParameterName() + "_" + parameter.getPartsName() + "_" + parameter.getSubsystemName();
|
||||
uniqueParamsMap.putIfAbsent(key, parameter);
|
||||
}
|
||||
List<ParameterPojo> uniqueParameters = new ArrayList<>(uniqueParamsMap.values());
|
||||
|
||||
List<EngineParamDetailPojo> engineParamDetailPojos = new ArrayList<>();
|
||||
for (DataEntryEngineModelPojo modelPojo : modelPojos) {
|
||||
if (Objects.equals(modelPojo.getYcOrOth(), "玉柴")) {
|
||||
for (ParameterPojo parameter : parameters) {
|
||||
for (ParameterPojo parameter : uniqueParameters) {
|
||||
EngineParamDetailPojo engineParamDetailPojo = new EngineParamDetailPojo();
|
||||
engineParamDetailPojo.setEngineModelId(modelPojo.getId());
|
||||
engineParamDetailPojo.setParameterId(parameter.getId());
|
||||
@ -162,7 +169,7 @@ public class EngineModelListener implements ReadListener<DataEntryEngineModelExc
|
||||
engineParamDetailPojos.add(engineParamDetailPojo);
|
||||
}
|
||||
} else {
|
||||
for (ParameterPojo parameter : parameters) {
|
||||
for (ParameterPojo parameter : uniqueParameters) {
|
||||
EngineParamDetailPojo engineParamDetailPojo = new EngineParamDetailPojo();
|
||||
engineParamDetailPojo.setEngineModelId(modelPojo.getId());
|
||||
engineParamDetailPojo.setParameterId(parameter.getId());
|
||||
|
||||
@ -29,7 +29,7 @@ public interface EngineParamDetailService {
|
||||
|
||||
void excelImport(MultipartFile file,String modelId, String userId);
|
||||
|
||||
void excelExport(HttpServletResponse response, String modelId, String userId);
|
||||
void excelExport(HttpServletResponse response, String modelId, String userId, java.util.List<String> subsystemParts);
|
||||
|
||||
List<EngineParamDetailDTO> selectValueByParam(EngineParamDetailRequest engineParamDetailRequest);
|
||||
|
||||
@ -57,6 +57,10 @@ public interface EngineParamDetailService {
|
||||
|
||||
Map<String, Map<String, Set<String>>> selectParamListAndModel(String modelID, Integer parameterVersion, String userId);
|
||||
|
||||
Map<String, Map<String, Set<String>>> selectParamListAndModelForFilledBy(String modelID, Integer parameterVersion, String userId);
|
||||
|
||||
Map<String, Map<String, Set<String>>> selectParamListAndModelForFilledByHistory(String modelID, Integer parameterVersion, String userId);
|
||||
|
||||
List<ParameterPojo> selectParamByIsUserId(List<ParameterPojo> list, String userId);
|
||||
|
||||
List<EngineParamDetailPojo> selectModelParamByIsUserId(List<EngineParamDetailPojo> list, String userId);
|
||||
|
||||
@ -54,10 +54,25 @@ public class ActivitiProcessServiceImpl implements ActivitiProcessService {
|
||||
private RedisLockUtils redisLockUtil;
|
||||
@Resource
|
||||
private ActivitiProcessService myself;
|
||||
@Resource
|
||||
private com.xdap.runtime.service.RuntimeAppContextService runtimeAppContextService;
|
||||
|
||||
private static final String FLOW_LOCK_PREFIX = "data:lock:";
|
||||
private static final int FLOW_LOCK_EXPIRE_SECONDS = 5;
|
||||
|
||||
private Comparator<String> getPartsNameComparator() {
|
||||
Collator collator = Collator.getInstance(Locale.CHINA);
|
||||
return (a, b) -> {
|
||||
if ("/".equals(a) && !"/".equals(b)) {
|
||||
return -1;
|
||||
}
|
||||
if (!"/".equals(a) && "/".equals(b)) {
|
||||
return 1;
|
||||
}
|
||||
return collator.compare(a, b);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
private static List<String> getStrings(EngineReviewListPojo reviewListPojo) {
|
||||
if (reviewListPojo == null || Objects.equals(reviewListPojo.getStatusCode(), ParamValueVersionEnum.REFUSE.getCode())
|
||||
@ -183,9 +198,19 @@ public class ActivitiProcessServiceImpl implements ActivitiProcessService {
|
||||
.eq("major_version", model.getVersionNumber())
|
||||
.eq("filled_by", userId)
|
||||
.isNull("minor_version")
|
||||
.in("version_status", Arrays.asList(1, null))
|
||||
.doQuery(EngineParamDetailPojo.class);
|
||||
if (!ObjectUtils.isEmpty(toBeFilledParams)) {
|
||||
throw new CommonException("填写人在当前机型的参数未全部填写完成,请检查");
|
||||
StringBuilder errorMsg = new StringBuilder("填写人在当前机型的参数未全部填写完成,请检查:\n");
|
||||
for (EngineParamDetailPojo param : toBeFilledParams) {
|
||||
errorMsg.append(param.getSubsystemName())
|
||||
.append("-")
|
||||
.append(param.getPartsName())
|
||||
.append("-")
|
||||
.append(param.getParameterName())
|
||||
.append("\n");
|
||||
}
|
||||
throw new CommonException(errorMsg.toString());
|
||||
}
|
||||
}
|
||||
|
||||
@ -1208,13 +1233,30 @@ public class ActivitiProcessServiceImpl implements ActivitiProcessService {
|
||||
*/
|
||||
@Override
|
||||
public List<String> getReturnNodes(String flowId) {
|
||||
String userId = runtimeAppContextService.getCurrentUserId();
|
||||
|
||||
EngineReviewListPojo flow = bd.getBusinessDatabase()
|
||||
.eq("id", flowId)
|
||||
.doQueryFirst(EngineReviewListPojo.class);
|
||||
|
||||
if (flow == null) {
|
||||
throw new CommonException("流程不存在");
|
||||
}
|
||||
|
||||
boolean isParticipant = isFlowParticipant(flow, userId);
|
||||
if (!isParticipant) {
|
||||
throw new CommonException("无权限查看退回节点");
|
||||
}
|
||||
|
||||
ApprovalConfigPojo approvalConfigPojo = bd.getBusinessDatabase()
|
||||
.eq("approval_id", flow.getId())
|
||||
.eq("node_name", flow.getNodeName())
|
||||
.doQueryFirst(ApprovalConfigPojo.class);
|
||||
|
||||
if (approvalConfigPojo == null) {
|
||||
throw new CommonException("当前节点配置不存在");
|
||||
}
|
||||
|
||||
return bd.getBusinessDatabase()
|
||||
.eq("approval_id", flowId)
|
||||
.lt("node_order", approvalConfigPojo.getNodeOrder())
|
||||
@ -1389,6 +1431,16 @@ public class ActivitiProcessServiceImpl implements ActivitiProcessService {
|
||||
if (engineFlow == null || showActivitiDTO.getApprovalId() == null) {
|
||||
throw new CommonException("无效的审批记录");
|
||||
}
|
||||
|
||||
// 验证用户是否是流程参与人
|
||||
String userId = showActivitiDTO.getUserID();
|
||||
if (userId != null && !userId.isEmpty()) {
|
||||
boolean isParticipant = isFlowParticipant(engineFlow, userId);
|
||||
if (!isParticipant) {
|
||||
throw new CommonException("您不是该流程的参与人,无权查看");
|
||||
}
|
||||
}
|
||||
|
||||
String approvalId = engineFlow.getId();
|
||||
ActivitiDataAndRecordDTO activitiDataAndRecordDTO = new ActivitiDataAndRecordDTO();
|
||||
// 获取机型
|
||||
@ -1529,6 +1581,54 @@ public class ActivitiProcessServiceImpl implements ActivitiProcessService {
|
||||
return activitiDataAndRecordDTO;
|
||||
}
|
||||
|
||||
/**
|
||||
* 验证用户是否是流程参与人
|
||||
* 参与人包括:发起人、当前审批人、已审批过的人
|
||||
*
|
||||
* @param flow 流程对象
|
||||
* @param userId 用户ID
|
||||
* @return 是否是参与人
|
||||
*/
|
||||
private boolean isFlowParticipant(EngineReviewListPojo flow, String userId) {
|
||||
// 1. 检查是否是发起人
|
||||
if (userId.equals(flow.getCreatedBy())) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// 2. 检查是否是申请人(可能是多人,用逗号分隔)
|
||||
if (flow.getApplicant() != null) {
|
||||
List<String> applicants = Arrays.asList(flow.getApplicant().split(","));
|
||||
if (applicants.contains(userId)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// 3. 检查是否是当前审批人
|
||||
ApprovalConfigPojo currentNode = bd.getBusinessDatabase()
|
||||
.eq("approval_id", flow.getId())
|
||||
.eq("node_name", flow.getNodeName())
|
||||
.doQueryFirst(ApprovalConfigPojo.class);
|
||||
|
||||
if (currentNode != null && currentNode.getAssignees() != null) {
|
||||
List<String> assignees = Arrays.asList(currentNode.getAssignees().split(","));
|
||||
if (assignees.contains(userId)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// 4. 检查是否已审批过
|
||||
List<ParamApprovalRecordPojo> records = bd.getBusinessDatabase()
|
||||
.eq("approval_id", flow.getId())
|
||||
.eq("operator_id", userId)
|
||||
.doQuery(ParamApprovalRecordPojo.class);
|
||||
|
||||
if (!records.isEmpty()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private FlowNode getFlowNodeView(
|
||||
ApprovalConfigPojo node,
|
||||
String flowId,
|
||||
@ -1609,10 +1709,14 @@ public class ActivitiProcessServiceImpl implements ActivitiProcessService {
|
||||
}
|
||||
|
||||
private List<ActivitiDataDTO> sortValueChange(List<ActivitiDataDTO> changeList) {
|
||||
Collator collator = Collator.getInstance(Locale.CHINA);
|
||||
Comparator<String> partsComparator = getPartsNameComparator();
|
||||
|
||||
return changeList.stream()
|
||||
.sorted(Comparator
|
||||
.comparing(ActivitiDataDTO::getSubsystemName, Collator.getInstance(Locale.CHINA))
|
||||
.thenComparing(ActivitiDataDTO::getParameterName, Collator.getInstance(Locale.CHINA))
|
||||
.comparing(ActivitiDataDTO::getSubsystemName, collator)
|
||||
.thenComparing(ActivitiDataDTO::getPartsName, partsComparator)
|
||||
.thenComparing(ActivitiDataDTO::getParameterName, collator)
|
||||
)
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@ -40,13 +40,34 @@ public class AuthServiceImpl implements AuthService {
|
||||
String viewPer = view.getParameterPer();
|
||||
String requirePer = classEnum.getPermissionPer();
|
||||
String requirePath = classEnum.getPermissionPath();
|
||||
|
||||
int viewPerLevel = convertPermissionLevel(viewPer);
|
||||
int requirePerLevel = convertPermissionLevel(requirePer);
|
||||
|
||||
return firstPath.endsWith(requirePath)
|
||||
&& viewPer.compareTo(requirePer) >= 0;
|
||||
&& viewPerLevel >= requirePerLevel;
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
|
||||
if (collected.isEmpty()) {
|
||||
throw new CommonException("您没有" + classEnum.getPermissionPath() + "的操作权限");
|
||||
throw new CommonException("权限不足,无法执行此操作");
|
||||
}
|
||||
}
|
||||
|
||||
private int convertPermissionLevel(String per) {
|
||||
if (per == null || per.isEmpty()) {
|
||||
return 0;
|
||||
}
|
||||
if ("查看".equals(per) || "1".equals(per)) {
|
||||
return 1;
|
||||
}
|
||||
if ("编辑".equals(per) || "2".equals(per)) {
|
||||
return 2;
|
||||
}
|
||||
try {
|
||||
return Integer.parseInt(per);
|
||||
} catch (NumberFormatException e) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -564,13 +564,20 @@ public class DataEntryEngineModelServiceImpl implements DataEntryEngineModelServ
|
||||
throw new CommonException("当前版本机型参数已同步最新模板参数");
|
||||
}
|
||||
|
||||
Map<String, ParameterPojo> uniqueParamsMap = new LinkedHashMap<>();
|
||||
for (ParameterPojo parameter : parameters) {
|
||||
String key = parameter.getParameterName() + "_" + parameter.getPartsName() + "_" + parameter.getSubsystemName();
|
||||
uniqueParamsMap.putIfAbsent(key, parameter);
|
||||
}
|
||||
List<ParameterPojo> uniqueParameters = new ArrayList<>(uniqueParamsMap.values());
|
||||
|
||||
// 过滤新批次模板的参数,更新到机型参数中
|
||||
// 统计需要插入的参数
|
||||
List<EngineParamDetailPojo> toInsertParams = new ArrayList<>();
|
||||
// 更新机型版本
|
||||
model.setVersionNumber(model.getVersionNumber() + 1);
|
||||
if (Objects.equals(model.getYcOrOth(), "玉柴")) {
|
||||
parameters.forEach(parameter -> {
|
||||
uniqueParameters.forEach(parameter -> {
|
||||
// 检查老机型参数中是否存在新版本参数
|
||||
// 存在则更新
|
||||
if (modelParamIds.contains(parameter.getId())) {
|
||||
@ -596,7 +603,7 @@ public class DataEntryEngineModelServiceImpl implements DataEntryEngineModelServ
|
||||
}
|
||||
});
|
||||
} else {
|
||||
parameters.forEach(parameter -> {
|
||||
uniqueParameters.forEach(parameter -> {
|
||||
// 检查老机型参数中是否存在新版本参数
|
||||
// 存在则更新
|
||||
if (modelParamIds.contains(parameter.getId())) {
|
||||
@ -627,7 +634,7 @@ public class DataEntryEngineModelServiceImpl implements DataEntryEngineModelServ
|
||||
bd.getBusinessDatabase()
|
||||
.eq("id", model.getId())
|
||||
.update("version_number", model.getVersionNumber())
|
||||
.update("parameter_num", parameters.size())
|
||||
.update("parameter_num", uniqueParameters.size())
|
||||
.doUpdate(DataEntryEngineModelPojo.class);
|
||||
|
||||
// 更新新版本机型的参数
|
||||
|
||||
@ -78,6 +78,19 @@ public class EngineParamDetailServiceImpl implements EngineParamDetailService {
|
||||
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||
|
||||
private Comparator<String> getPartsNameComparator() {
|
||||
Collator collator = Collator.getInstance(Locale.CHINA);
|
||||
return (a, b) -> {
|
||||
if ("/".equals(a) && !"/".equals(b)) {
|
||||
return -1;
|
||||
}
|
||||
if (!"/".equals(a) && "/".equals(b)) {
|
||||
return 1;
|
||||
}
|
||||
return collator.compare(a, b);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
@ -207,27 +220,39 @@ public class EngineParamDetailServiceImpl implements EngineParamDetailService {
|
||||
|
||||
List<EngineParamDetailPojo> pojoList = selectByIsUserId(modelID, parameterVersion, userId);
|
||||
|
||||
log.info("selectParamListByDetails - modelID: {}, parameterVersion: {}, userId: {}, pojoList size: {}",
|
||||
modelID, parameterVersion, userId, pojoList.size());
|
||||
|
||||
Collator collator = Collator.getInstance(Locale.CHINA);
|
||||
Comparator<String> partsComparator = getPartsNameComparator();
|
||||
|
||||
AtomicInteger seq = new AtomicInteger(1);
|
||||
LinkedHashMap<String, Integer> subsystemOrderMap = pojoList.stream()
|
||||
.sorted(Comparator
|
||||
.comparing(EngineParamDetailPojo::getSubsystemName, Collator.getInstance(Locale.CHINA))
|
||||
.thenComparing(EngineParamDetailPojo::getParameterName, Collator.getInstance(Locale.CHINA))
|
||||
.comparing(EngineParamDetailPojo::getSubsystemName, collator)
|
||||
.thenComparing(EngineParamDetailPojo::getPartsName, partsComparator)
|
||||
.thenComparing(EngineParamDetailPojo::getParameterName, collator)
|
||||
)
|
||||
.map(EngineParamDetailPojo::getSubsystemName)
|
||||
.distinct()
|
||||
.collect(Collectors.toMap(
|
||||
s -> s,
|
||||
s -> seq.getAndIncrement(), // 每次获取当前值,再自增(从1开始)
|
||||
s -> seq.getAndIncrement(),
|
||||
(o, n) -> o,
|
||||
LinkedHashMap::new
|
||||
));
|
||||
|
||||
Map<String, Set<String>> collect = pojoList.stream()
|
||||
.sorted(Comparator
|
||||
.comparing(EngineParamDetailPojo::getSubsystemName, collator)
|
||||
.thenComparing(EngineParamDetailPojo::getPartsName, partsComparator)
|
||||
)
|
||||
.collect(Collectors.groupingBy(
|
||||
EngineParamDetailPojo::getSubsystemName,
|
||||
LinkedHashMap::new,
|
||||
Collectors.mapping(
|
||||
EngineParamDetailPojo::getPartsName, // 提取 零部件名称字段
|
||||
Collectors.toSet()
|
||||
EngineParamDetailPojo::getPartsName,
|
||||
Collectors.toCollection(LinkedHashSet::new)
|
||||
)
|
||||
));
|
||||
if (ObjectUtils.isNotEmpty(modelID)) {
|
||||
@ -298,7 +323,150 @@ public class EngineParamDetailServiceImpl implements EngineParamDetailService {
|
||||
Map.Entry::getKey,
|
||||
Map.Entry::getValue,
|
||||
(oldValue, newValue) -> oldValue,
|
||||
LinkedHashMap::new // 保持顺序
|
||||
LinkedHashMap::new
|
||||
));
|
||||
}
|
||||
|
||||
private Map<String, Set<String>> selectParamListByDetailsForFilledBy(String modelID, Integer parameterVersion, String userId) {
|
||||
if (parameterVersion == null) {
|
||||
DataEntryEngineModelPojo engineModel = bd.getBusinessDatabase()
|
||||
.eq("id", modelID)
|
||||
.doQueryFirst(DataEntryEngineModelPojo.class);
|
||||
if (engineModel == null) {
|
||||
throw new CommonException("未找到该型号的参数");
|
||||
}
|
||||
parameterVersion = engineModel.getVersionNumber();
|
||||
}
|
||||
|
||||
List<EngineParamDetailPojo> pojoList = bd.getBusinessDatabase()
|
||||
.eq("engine_model_id", modelID)
|
||||
.eq("major_version", parameterVersion)
|
||||
.eq("filled_by", userId)
|
||||
.eq("is_distributed_filled", 1)
|
||||
.in("version_status", Arrays.asList(1, null))
|
||||
.doQuery(EngineParamDetailPojo.class);
|
||||
|
||||
return buildParamListMap(pojoList, modelID);
|
||||
}
|
||||
|
||||
private Map<String, Set<String>> selectParamListByDetailsForFilledByHistory(String modelID, Integer parameterVersion, String userId) {
|
||||
if (parameterVersion == null) {
|
||||
DataEntryEngineModelPojo engineModel = bd.getBusinessDatabase()
|
||||
.eq("id", modelID)
|
||||
.doQueryFirst(DataEntryEngineModelPojo.class);
|
||||
if (engineModel == null) {
|
||||
throw new CommonException("未找到该型号的参数");
|
||||
}
|
||||
parameterVersion = engineModel.getVersionNumber();
|
||||
}
|
||||
|
||||
List<EngineParamDetailPojo> pojoList = bd.getBusinessDatabase()
|
||||
.eq("engine_model_id", modelID)
|
||||
.eq("major_version", parameterVersion)
|
||||
.eq("filled_by", userId)
|
||||
.eq("is_distributed_filled", 1)
|
||||
.in("version_status", Arrays.asList(0, 2, 4))
|
||||
.doQuery(EngineParamDetailPojo.class);
|
||||
|
||||
return buildParamListMap(pojoList, modelID);
|
||||
}
|
||||
|
||||
private Map<String, Set<String>> buildParamListMap(List<EngineParamDetailPojo> pojoList, String modelID) {
|
||||
Collator collator = Collator.getInstance(Locale.CHINA);
|
||||
Comparator<String> partsComparator = getPartsNameComparator();
|
||||
|
||||
AtomicInteger seq = new AtomicInteger(1);
|
||||
LinkedHashMap<String, Integer> subsystemOrderMap = pojoList.stream()
|
||||
.sorted(Comparator
|
||||
.comparing(EngineParamDetailPojo::getSubsystemName, collator)
|
||||
.thenComparing(EngineParamDetailPojo::getPartsName, partsComparator)
|
||||
.thenComparing(EngineParamDetailPojo::getParameterName, collator)
|
||||
)
|
||||
.map(EngineParamDetailPojo::getSubsystemName)
|
||||
.distinct()
|
||||
.collect(Collectors.toMap(
|
||||
s -> s,
|
||||
s -> seq.getAndIncrement(),
|
||||
(o, n) -> o,
|
||||
LinkedHashMap::new
|
||||
));
|
||||
|
||||
Map<String, Set<String>> collect = pojoList.stream()
|
||||
.sorted(Comparator
|
||||
.comparing(EngineParamDetailPojo::getSubsystemName, collator)
|
||||
.thenComparing(EngineParamDetailPojo::getPartsName, partsComparator)
|
||||
)
|
||||
.collect(Collectors.groupingBy(
|
||||
EngineParamDetailPojo::getSubsystemName,
|
||||
LinkedHashMap::new,
|
||||
Collectors.mapping(
|
||||
EngineParamDetailPojo::getPartsName,
|
||||
Collectors.toCollection(LinkedHashSet::new)
|
||||
)
|
||||
));
|
||||
|
||||
if (ObjectUtils.isNotEmpty(modelID)) {
|
||||
subsystemOrderMap.put("整车参数", 0);
|
||||
DataEntryEngineModelPojo dataEntryEngineModelPojo = bd.getBusinessDatabase()
|
||||
.eq("id", modelID)
|
||||
.doQueryFirst(DataEntryEngineModelPojo.class);
|
||||
if (dataEntryEngineModelPojo == null) {
|
||||
throw new CommonException("未找到机型的数据");
|
||||
}
|
||||
|
||||
String productNumber = nvl(dataEntryEngineModelPojo.getProductNumber());
|
||||
String plate = nvl(dataEntryEngineModelPojo.getPlate());
|
||||
String platform = nvl(dataEntryEngineModelPojo.getPlatform());
|
||||
String series = nvl(dataEntryEngineModelPojo.getSeries());
|
||||
String marketSegment = nvl(dataEntryEngineModelPojo.getMarketSegment());
|
||||
String projectName = nvl(dataEntryEngineModelPojo.getProjectName());
|
||||
String projectNumber = nvl(dataEntryEngineModelPojo.getProjectNumber());
|
||||
String brand = nvl(dataEntryEngineModelPojo.getBrand());
|
||||
String emission = nvl(dataEntryEngineModelPojo.getEmission());
|
||||
String burnType = nvl(dataEntryEngineModelPojo.getBurnType());
|
||||
String engineCapacity = nvl(dataEntryEngineModelPojo.getEngineCapacity());
|
||||
String productionDateStr;
|
||||
if (dataEntryEngineModelPojo.getProductionDate() != null) {
|
||||
productionDateStr = new SimpleDateFormat("yyyy-MM-dd").format(dataEntryEngineModelPojo.getProductionDate());
|
||||
} else {
|
||||
productionDateStr = "";
|
||||
}
|
||||
String manufacturerName = nvl(dataEntryEngineModelPojo.getManufacturerName());
|
||||
String manufacturerAbbreviation = nvl(dataEntryEngineModelPojo.getManufacturerAbbreviation());
|
||||
|
||||
Set<String> strings = new HashSet<>();
|
||||
if ("玉柴".equals(dataEntryEngineModelPojo.getYcOrOth())) {
|
||||
strings.add("状态代号:" + productNumber);
|
||||
} else {
|
||||
strings.add("产品编号:" + productNumber);
|
||||
strings.add("品牌:" + brand);
|
||||
strings.add("厂家全称:" + manufacturerName);
|
||||
strings.add("厂家简称:" + manufacturerAbbreviation);
|
||||
strings.add("生产日期:" + productionDateStr);
|
||||
}
|
||||
strings.add("产品型号:" + dataEntryEngineModelPojo.getModelName());
|
||||
strings.add("板块:" + plate);
|
||||
strings.add("平台:" + platform);
|
||||
strings.add("系列:" + series);
|
||||
strings.add("细分市场:" + marketSegment);
|
||||
strings.add("项目名称:" + projectName);
|
||||
strings.add("项目编号:" + projectNumber);
|
||||
strings.add("排放:" + emission);
|
||||
strings.add("燃烧类型:" + burnType);
|
||||
strings.add("排量:" + engineCapacity);
|
||||
|
||||
collect.put("整车参数", strings);
|
||||
}
|
||||
|
||||
return collect.entrySet().stream()
|
||||
.sorted(Comparator.comparing(entry ->
|
||||
subsystemOrderMap.getOrDefault(entry.getKey(), Integer.MAX_VALUE)
|
||||
))
|
||||
.collect(Collectors.toMap(
|
||||
Map.Entry::getKey,
|
||||
Map.Entry::getValue,
|
||||
(oldValue, newValue) -> oldValue,
|
||||
LinkedHashMap::new
|
||||
));
|
||||
}
|
||||
|
||||
@ -359,6 +527,32 @@ public class EngineParamDetailServiceImpl implements EngineParamDetailService {
|
||||
return map;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Map<String, Set<String>>> selectParamListAndModelForFilledBy(String modelID, Integer parameterVersion, String userId) {
|
||||
HashMap<String, Map<String, Set<String>>> map = new HashMap<>();
|
||||
DataEntryEngineModelPojo dataEntryEngineModelPojo = dataEntryEngineModelService.selectBymodelId(modelID);
|
||||
if (ObjectUtils.isEmpty(dataEntryEngineModelPojo)) {
|
||||
throw new CommonException("未找到该机型");
|
||||
}
|
||||
String s = dataEntryEngineModelPojo.getProductNumber();
|
||||
Map<String, Set<String>> stringListMap = selectParamListByDetailsForFilledBy(modelID, parameterVersion, userId);
|
||||
map.put(s, stringListMap);
|
||||
return map;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Map<String, Set<String>>> selectParamListAndModelForFilledByHistory(String modelID, Integer parameterVersion, String userId) {
|
||||
HashMap<String, Map<String, Set<String>>> map = new HashMap<>();
|
||||
DataEntryEngineModelPojo dataEntryEngineModelPojo = dataEntryEngineModelService.selectBymodelId(modelID);
|
||||
if (ObjectUtils.isEmpty(dataEntryEngineModelPojo)) {
|
||||
throw new CommonException("未找到该机型");
|
||||
}
|
||||
String s = dataEntryEngineModelPojo.getProductNumber();
|
||||
Map<String, Set<String>> stringListMap = selectParamListByDetailsForFilledByHistory(modelID, parameterVersion, userId);
|
||||
map.put(s, stringListMap);
|
||||
return map;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Excel导入
|
||||
@ -407,43 +601,124 @@ public class EngineParamDetailServiceImpl implements EngineParamDetailService {
|
||||
public void excelExport(
|
||||
HttpServletResponse response,
|
||||
String modelId,
|
||||
String userId
|
||||
String userId,
|
||||
java.util.List<String> subsystemParts
|
||||
) {
|
||||
// 定义Sheet名称集合
|
||||
List<EngineParamDetailPojo> engineParams = bd.getBusinessDatabase()
|
||||
.eq("engine_model_id", modelId)
|
||||
.eq("filled_by", userId)
|
||||
.doQuery(EngineParamDetailPojo.class);
|
||||
DataEntryEngineModelPojo model = bd.getBusinessDatabase()
|
||||
.eq("id", modelId)
|
||||
.doQueryFirst(DataEntryEngineModelPojo.class);
|
||||
if (ObjectUtils.isEmpty(model)) {
|
||||
throw new CommonException("机型不存在,请检查");
|
||||
}
|
||||
|
||||
Set<String> subsystemSet = new HashSet<>();
|
||||
Set<String> typeSet = new HashSet<>();
|
||||
|
||||
if (subsystemParts != null && !subsystemParts.isEmpty()) {
|
||||
for (String subsystemType : subsystemParts) {
|
||||
if (subsystemType.split("-").length != 2) {
|
||||
throw new CommonException("查询条件异常,需子系统-零部件名称,若零部件为空则传入\"/\"");
|
||||
}
|
||||
String subsystem = subsystemType.split("-")[0];
|
||||
String type = subsystemType.split("-")[1];
|
||||
subsystemSet.add(subsystem);
|
||||
typeSet.add(type);
|
||||
}
|
||||
}
|
||||
|
||||
MpaasQuery query = bd.getBusinessDatabase()
|
||||
.eq("engine_model_id", model.getId());
|
||||
|
||||
if (!subsystemSet.isEmpty()) {
|
||||
query.in("subsystem_name", subsystemSet);
|
||||
}
|
||||
if (!typeSet.isEmpty()) {
|
||||
query.in("parts_name", typeSet);
|
||||
}
|
||||
|
||||
query.eq("last_updated_by", userId);
|
||||
query.eq("major_version", model.getVersionNumber());
|
||||
|
||||
List<EngineParamDetailPojo> engineParams = query.doQuery(EngineParamDetailPojo.class);
|
||||
|
||||
if (ObjectUtils.isEmpty(engineParams)) {
|
||||
query = bd.getBusinessDatabase()
|
||||
.eq("engine_model_id", model.getId());
|
||||
|
||||
if (!subsystemSet.isEmpty()) {
|
||||
query.in("subsystem_name", subsystemSet);
|
||||
}
|
||||
if (!typeSet.isEmpty()) {
|
||||
query.in("parts_name", typeSet);
|
||||
}
|
||||
|
||||
query.eq("filled_by", userId);
|
||||
query.eq("major_version", model.getVersionNumber());
|
||||
|
||||
engineParams = query.doQuery(EngineParamDetailPojo.class);
|
||||
}
|
||||
|
||||
if (ObjectUtils.isEmpty(engineParams)) {
|
||||
log.error("模板参数为空");
|
||||
throw new ExcelImportException(
|
||||
"模板参数未配置"
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, EngineParamDetailPojo> uniqueParamsMap = new LinkedHashMap<>();
|
||||
for (EngineParamDetailPojo param : engineParams) {
|
||||
String key = param.getParameterName() + "_" + param.getPartsName();
|
||||
EngineParamDetailPojo existing = uniqueParamsMap.get(key);
|
||||
|
||||
if (existing == null) {
|
||||
uniqueParamsMap.put(key, param);
|
||||
} else {
|
||||
boolean shouldReplace = false;
|
||||
|
||||
if (param.getLastUpdateDate() != null && existing.getLastUpdateDate() != null) {
|
||||
if (param.getLastUpdateDate().after(existing.getLastUpdateDate())) {
|
||||
shouldReplace = true;
|
||||
}
|
||||
} else if (param.getLastUpdateDate() != null) {
|
||||
shouldReplace = true;
|
||||
}
|
||||
|
||||
if (shouldReplace) {
|
||||
uniqueParamsMap.put(key, param);
|
||||
}
|
||||
}
|
||||
}
|
||||
List<EngineParamDetailPojo> uniqueParams = new ArrayList<>(uniqueParamsMap.values());
|
||||
|
||||
Collator collator = Collator.getInstance(Locale.CHINA);
|
||||
Comparator<String> partsComparator = getPartsNameComparator();
|
||||
|
||||
WriteCellStyle headWriteCellStyle = new WriteCellStyle();
|
||||
// 设置背景色为灰色
|
||||
headWriteCellStyle.setFillForegroundColor(IndexedColors.GREY_25_PERCENT.getIndex());
|
||||
// 设置字体
|
||||
WriteFont headWriteFont = new WriteFont();
|
||||
headWriteFont.setFontHeightInPoints((short) 12); // 字体大小
|
||||
headWriteFont.setBold(true); // 加粗
|
||||
headWriteFont.setFontHeightInPoints((short) 12);
|
||||
headWriteFont.setBold(true);
|
||||
headWriteCellStyle.setWriteFont(headWriteFont);
|
||||
|
||||
// 创建表头策略
|
||||
HorizontalCellStyleStrategy horizontalCellStyleStrategy =
|
||||
new HorizontalCellStyleStrategy(headWriteCellStyle, new WriteCellStyle());
|
||||
|
||||
List<String> sheetNames = engineParams.stream()
|
||||
List<String> sheetNames = uniqueParams.stream()
|
||||
.map(EngineParamDetailPojo::getSubsystemName)
|
||||
.distinct().collect(Collectors.toList());
|
||||
.distinct()
|
||||
.sorted(collator)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
try (ExcelWriter excelWriter = EasyExcel.write(response.getOutputStream()).build()) {
|
||||
setupResponse(response, "参数值导入模板" + (formatter.format(LocalDateTime.now())));
|
||||
// 循环创建Sheet
|
||||
for (int i = 0; i < sheetNames.size(); i++) {
|
||||
String sheetName = sheetNames.get(i);
|
||||
List<EngineParamDetailPojo> parameterList = engineParams.stream()
|
||||
List<EngineParamDetailPojo> parameterList = uniqueParams.stream()
|
||||
.filter(x -> x.getSubsystemName().equals(sheetName))
|
||||
.sorted(Comparator
|
||||
.comparing(EngineParamDetailPojo::getPartsName, partsComparator)
|
||||
.thenComparing(EngineParamDetailPojo::getParameterName, collator)
|
||||
)
|
||||
.collect(Collectors.toList());
|
||||
List<EngineParamDetailExcel> engineParamDetailExcels = new ArrayList<>();
|
||||
for (EngineParamDetailPojo parameter : parameterList) {
|
||||
@ -455,9 +730,9 @@ public class EngineParamDetailServiceImpl implements EngineParamDetailService {
|
||||
WriteSheet sheet = EasyExcel.writerSheet(i, sheetNames.get(i))
|
||||
.registerWriteHandler(new LongestMatchColumnWidthStyleStrategy())
|
||||
.registerWriteHandler(horizontalCellStyleStrategy)
|
||||
.head(EngineParamDetailExcel.class) // 所有Sheet使用相同的表头
|
||||
.head(EngineParamDetailExcel.class)
|
||||
.build();
|
||||
excelWriter.write(engineParamDetailExcels, sheet); // 写入数据,只生成表头
|
||||
excelWriter.write(engineParamDetailExcels, sheet);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
throw new CommonException("导出Excel文件异常");
|
||||
@ -618,10 +893,14 @@ public class EngineParamDetailServiceImpl implements EngineParamDetailService {
|
||||
}
|
||||
|
||||
// 排序返回
|
||||
Collator collator = Collator.getInstance(Locale.CHINA);
|
||||
Comparator<String> partsComparator = getPartsNameComparator();
|
||||
|
||||
List<EngineParamDetailDTO> detailDTOList = engineParamDetailDTOS.stream()
|
||||
.sorted(Comparator
|
||||
.comparing(EngineParamDetailDTO::getSubsystemName, Collator.getInstance(Locale.CHINA))
|
||||
.thenComparing(EngineParamDetailDTO::getParameterName, Collator.getInstance(Locale.CHINA))
|
||||
.comparing(EngineParamDetailDTO::getSubsystemName, collator)
|
||||
.thenComparing(EngineParamDetailDTO::getPartsName, partsComparator)
|
||||
.thenComparing(EngineParamDetailDTO::getParameterName, collator)
|
||||
)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
|
||||
@ -188,6 +188,8 @@ public class ModelRoleServiceImpl implements ModelRoleService {
|
||||
*/
|
||||
@Override
|
||||
public List<MenuParamView> selectPersByUser(String userOrDepID) {
|
||||
log.info("开始查询用户权限 - 用户ID: {}", userOrDepID);
|
||||
|
||||
if (ObjectUtils.isEmpty(userOrDepID)) {
|
||||
throw new CommonException("用户或部门ID为空");
|
||||
}
|
||||
@ -195,13 +197,20 @@ public class ModelRoleServiceImpl implements ModelRoleService {
|
||||
.eq("user_or_dep", userOrDepID)
|
||||
.eq("is_enable", 1)
|
||||
.doQuery(ModelDepUserRolePojo.class);
|
||||
|
||||
log.info("用户绑定的角色数量: {}", userOrDeps.size());
|
||||
|
||||
List<MenuParamView> paramViews = new ArrayList<>();
|
||||
for (ModelDepUserRolePojo userOrDep : userOrDeps) {
|
||||
log.info("查询角色权限 - 角色ID: {}", userOrDep.getRoleId());
|
||||
List<MenuParamView> views = selectPersByRole(userOrDep.getRoleId());
|
||||
log.info("角色 {} 的权限数量: {}", userOrDep.getRoleId(), views.size());
|
||||
if (ObjectUtils.isNotEmpty(views)) {
|
||||
paramViews.addAll(views);
|
||||
}
|
||||
}
|
||||
|
||||
log.info("用户总权限数量: {}", paramViews.size());
|
||||
return paramViews;
|
||||
}
|
||||
|
||||
@ -214,6 +223,8 @@ public class ModelRoleServiceImpl implements ModelRoleService {
|
||||
*/
|
||||
@Override
|
||||
public List<MenuParamView> selectPersByRole(String roleID) {
|
||||
log.info("查询角色权限 - 角色ID: {}", roleID);
|
||||
|
||||
if (ObjectUtils.isEmpty(roleID)) {
|
||||
throw new CommonException("角色为空");
|
||||
}
|
||||
@ -221,42 +232,60 @@ public class ModelRoleServiceImpl implements ModelRoleService {
|
||||
.eq("is_enabled", 1)
|
||||
.eq("id", roleID)
|
||||
.doQueryFirst(ModelRolesPojo.class);
|
||||
if (ObjectUtils.isNotEmpty(modelRolesPojos) && ("super_admin".equals(modelRolesPojos.getRoleCode()))) {
|
||||
|
||||
if (ObjectUtils.isEmpty(modelRolesPojos)) {
|
||||
log.warn("角色不存在或未启用 - 角色ID: {}", roleID);
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
if ("super_admin".equals(modelRolesPojos.getRoleCode())) {
|
||||
log.info("角色是超级管理员 - 角色ID: {}", roleID);
|
||||
return Collections.singletonList(new MenuParamView(roleID, "", "", "", "", 1));
|
||||
}
|
||||
|
||||
ArrayList<MenuParamView> menuParamViews = new ArrayList<>();
|
||||
List<ModelRolePermissionPojo> role = businessDatabase.getBusinessDatabase()
|
||||
.eq("role_id", roleID)
|
||||
.eq("is_enable", 1)
|
||||
.doQuery(ModelRolePermissionPojo.class);
|
||||
|
||||
if (ObjectUtils.isEmpty(role)) {
|
||||
log.warn("该角色没有权限");
|
||||
log.warn("角色没有配置权限 - 角色ID: {}", roleID);
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
log.info("角色配置的权限数量: {}", role.size());
|
||||
|
||||
try {
|
||||
List<String> perids = role.stream().map(ModelRolePermissionPojo::getPerId).distinct().collect(Collectors.toList());
|
||||
List<ModelMenuParameterPojo> menuParameters = businessDatabase.getBusinessDatabase()
|
||||
.in("id", perids)
|
||||
.doQuery(ModelMenuParameterPojo.class);
|
||||
|
||||
log.info("查询到的权限配置数量: {}", menuParameters.size());
|
||||
|
||||
//获取权限
|
||||
for (ModelMenuParameterPojo menuParameter : menuParameters) {
|
||||
|
||||
|
||||
ParamPermissionEnum byCode = ParamPermissionEnum.getByCode(menuParameter.getParameterPer());
|
||||
if (byCode == null) {
|
||||
throw new CommonException("权限异常");
|
||||
log.warn("权限配置异常 - 权限ID: {}, 权限等级: {}, 跳过该权限",
|
||||
menuParameter.getId(), menuParameter.getParameterPer());
|
||||
continue;
|
||||
}
|
||||
MenuParamView menuParamView = new MenuParamView();
|
||||
menuParamView.setId(menuParameter.getId());
|
||||
|
||||
menuParamView.setPermissionPath(menuParameter.getPermissionPath());
|
||||
menuParamView.setParameterPer(byCode.getDesc());
|
||||
menuParamViews.add(menuParamView);
|
||||
|
||||
log.debug("添加权限 - 路径: {}, 等级: {}", menuParameter.getPermissionPath(), byCode.getDesc());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("查询角色权限异常: {}", e.getMessage(), e);
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
log.info("角色有效权限数量: {}", menuParamViews.size());
|
||||
return menuParamViews;
|
||||
}
|
||||
|
||||
|
||||
@ -346,12 +346,15 @@ public class TcDataQueryServiceImpl implements TcDataQueryService {
|
||||
|
||||
@Override
|
||||
/**
|
||||
* 根据版本查询TC数据
|
||||
* 根据版本查询TC数据(优化版)
|
||||
*
|
||||
* @param analysisRequest 版本分析请求对象
|
||||
* @return 引擎参数详情映射
|
||||
*/
|
||||
public Map<String, List<EngineParamDetailPojo>> tcDataSelectByVersion(AnalysisVerRequest analysisRequest) {
|
||||
long startTime = System.currentTimeMillis();
|
||||
log.info("开始执行tcDataSelectByVersion查询");
|
||||
|
||||
DataEntryEngineModelPojo dataEntryEngineModelPojo = engineModelService.selectBymodelId(analysisRequest.getEngineModelID());
|
||||
if (dataEntryEngineModelPojo == null) {
|
||||
throw new CommonException("查询失败:机型不存在");
|
||||
@ -370,25 +373,43 @@ public class TcDataQueryServiceImpl implements TcDataQueryService {
|
||||
partsNameSet.add(partsName);
|
||||
});
|
||||
|
||||
//批量查询所有系统数据
|
||||
List<EngineParamDetailPojo> systemDataList = new ArrayList<>(
|
||||
bd.getBusinessDatabase()
|
||||
//批量查询所有系统数据(优化:一次查询,内存过滤)
|
||||
long queryStartTime = System.currentTimeMillis();
|
||||
List<EngineParamDetailPojo> allParamList = bd.getBusinessDatabase()
|
||||
.eq("engine_model_id", analysisRequest.getEngineModelID())
|
||||
.eq("major_version", analysisRequest.getParameterVersion())
|
||||
.in("subsystem_name", subsystemSet)
|
||||
.in("parts_name", partsNameSet)
|
||||
.ne("parameter_source", "TC分类表")
|
||||
.doQuery(EngineParamDetailPojo.class)
|
||||
);
|
||||
List<EngineParamDetailPojo> tcPojos = new ArrayList<>(
|
||||
bd.getBusinessDatabase()
|
||||
.eq("engine_model_id", analysisRequest.getEngineModelID())
|
||||
.eq("major_version", analysisRequest.getParameterVersion())
|
||||
.in("subsystem_name", subsystemSet)
|
||||
.in("parts_name", partsNameSet)
|
||||
.eq("parameter_source", "TC分类表")
|
||||
.doQuery(EngineParamDetailPojo.class)
|
||||
);
|
||||
.doQuery(EngineParamDetailPojo.class);
|
||||
log.info("查询所有参数数据耗时: {}ms, 数据量: {}", System.currentTimeMillis() - queryStartTime, allParamList.size());
|
||||
|
||||
List<EngineParamDetailPojo> systemDataList = allParamList.stream()
|
||||
.filter(p -> !"TC分类表".equals(p.getParameterSource()))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
List<EngineParamDetailPojo> tcPojos = allParamList.stream()
|
||||
.filter(p -> "TC分类表".equals(p.getParameterSource()))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
// 批量查询所有系统数据(优化前代码 - 已屏蔽)
|
||||
// List<EngineParamDetailPojo> systemDataList = new ArrayList<>(
|
||||
// bd.getBusinessDatabase()
|
||||
// .eq("engine_model_id", analysisRequest.getEngineModelID())
|
||||
// .eq("major_version", analysisRequest.getParameterVersion())
|
||||
// .in("subsystem_name", subsystemSet)
|
||||
// .in("parts_name", partsNameSet)
|
||||
// .ne("parameter_source", "TC分类表")
|
||||
// .doQuery(EngineParamDetailPojo.class)
|
||||
// );
|
||||
// List<EngineParamDetailPojo> tcPojos = new ArrayList<>(
|
||||
// bd.getBusinessDatabase()
|
||||
// .eq("engine_model_id", analysisRequest.getEngineModelID())
|
||||
// .eq("major_version", analysisRequest.getParameterVersion())
|
||||
// .in("subsystem_name", subsystemSet)
|
||||
// .in("parts_name", partsNameSet)
|
||||
// .eq("parameter_source", "TC分类表")
|
||||
// .doQuery(EngineParamDetailPojo.class)
|
||||
// );
|
||||
|
||||
//批量查询所有TC数据
|
||||
Map<String, List<EngineParamDetailPojo>> parameterMapTc = tcPojos.stream()
|
||||
@ -410,19 +431,33 @@ public class TcDataQueryServiceImpl implements TcDataQueryService {
|
||||
systemDataList.addAll(convertedTcPojos);
|
||||
|
||||
// 按权限过滤返回数据
|
||||
long authStartTime = System.currentTimeMillis();
|
||||
List<EngineParamDetailPojo> filerData = engineParamDetailService.selectModelParamByIsUserId(systemDataList, analysisRequest.getUserID());
|
||||
log.info("权限过滤耗时: {}ms, 过滤后数据量: {}", System.currentTimeMillis() - authStartTime, filerData.size());
|
||||
|
||||
//将allPojos存到Redis,KEY为userID+engineModelID+预操作,过期时间24小时
|
||||
try {
|
||||
//将allPojos存到Redis(异步执行,不阻塞主流程)
|
||||
String redisKey = analysisRequest.getUserID() + ":" + analysisRequest.getEngineModelID() + ":" + analysisRequest.getParameterVersion() + ":" + "ComparisonExport";
|
||||
java.util.concurrent.CompletableFuture.runAsync(() -> {
|
||||
try {
|
||||
String jsonValue = objectMapper.writeValueAsString(filerData);
|
||||
redisTemplate.opsForValue().set(redisKey, jsonValue, 24, java.util.concurrent.TimeUnit.HOURS);
|
||||
log.info("成功将数据存储到Redis,KEY: {}", redisKey);
|
||||
log.info("异步存储数据到Redis成功,KEY: {}", redisKey);
|
||||
} catch (Exception e) {
|
||||
log.error("存储数据到Redis失败: {}", e.getMessage());
|
||||
log.error("异步存储数据到Redis失败: {}", e.getMessage());
|
||||
}
|
||||
});
|
||||
|
||||
// 将allPojos存到Redis(优化前代码 - 已屏蔽)
|
||||
// try {
|
||||
// String redisKey = analysisRequest.getUserID() + ":" + analysisRequest.getEngineModelID() + ":" + analysisRequest.getParameterVersion() + ":" + "ComparisonExport";
|
||||
// String jsonValue = objectMapper.writeValueAsString(filerData);
|
||||
// redisTemplate.opsForValue().set(redisKey, jsonValue, 24, java.util.concurrent.TimeUnit.HOURS);
|
||||
// log.info("成功将数据存储到Redis,KEY: {}", redisKey);
|
||||
// } catch (Exception e) {
|
||||
// log.error("存储数据到Redis失败: {}", e.getMessage());
|
||||
// }
|
||||
|
||||
log.info("tcDataSelectByVersion总耗时: {}ms", System.currentTimeMillis() - startTime);
|
||||
return filerData.stream().collect(Collectors.groupingBy(EngineParamDetailPojo::getSubsystemName));
|
||||
}
|
||||
|
||||
|
||||
@ -43,6 +43,8 @@ public class YcTaskResultServiceImpl implements YcTaskResultService {
|
||||
private BusinessDatabase bd;
|
||||
@Resource
|
||||
private XdapDeptUsersService xdapDeptUsersService;
|
||||
@Resource
|
||||
private com.xdap.runtime.service.RuntimeAppContextService runtimeAppContextService;
|
||||
@Value("${apaas.app.url}")
|
||||
private String frontUrl;
|
||||
@Value("${apaas.single.tenantId}")
|
||||
@ -247,23 +249,64 @@ public class YcTaskResultServiceImpl implements YcTaskResultService {
|
||||
|
||||
@Override
|
||||
public TodoTaskPojo getTodoById(String flowId) {
|
||||
return bd.getBusinessDatabase()
|
||||
TodoTaskPojo task = bd.getBusinessDatabase()
|
||||
.eq("id", flowId)
|
||||
.doQueryFirst(TodoTaskPojo.class);
|
||||
|
||||
if (task == null) {
|
||||
throw new CommonException("任务不存在");
|
||||
}
|
||||
|
||||
String currentUserId = runtimeAppContextService.getCurrentUserId();
|
||||
boolean isOwner = currentUserId.equals(task.getOwnerId());
|
||||
boolean isCreator = currentUserId.equals(task.getCreatedById());
|
||||
|
||||
if (!isOwner && !isCreator) {
|
||||
throw new CommonException("无权限查看此任务");
|
||||
}
|
||||
|
||||
return task;
|
||||
}
|
||||
|
||||
@Override
|
||||
public InitiatedTaskPojo getInitiatorById(String flowId) {
|
||||
return bd.getBusinessDatabase()
|
||||
InitiatedTaskPojo task = bd.getBusinessDatabase()
|
||||
.eq("id", flowId)
|
||||
.doQueryFirst(InitiatedTaskPojo.class);
|
||||
|
||||
if (task == null) {
|
||||
throw new CommonException("任务不存在");
|
||||
}
|
||||
|
||||
String currentUserId = runtimeAppContextService.getCurrentUserId();
|
||||
boolean isCreator = currentUserId.equals(task.getCreatedById());
|
||||
|
||||
if (!isCreator) {
|
||||
throw new CommonException("无权限查看此任务");
|
||||
}
|
||||
|
||||
return task;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CompletedTaskPojo getCompletedById(String flowId) {
|
||||
return bd.getBusinessDatabase()
|
||||
CompletedTaskPojo task = bd.getBusinessDatabase()
|
||||
.eq("id", flowId)
|
||||
.doQueryFirst(CompletedTaskPojo.class);
|
||||
|
||||
if (task == null) {
|
||||
throw new CommonException("任务不存在");
|
||||
}
|
||||
|
||||
String currentUserId = runtimeAppContextService.getCurrentUserId();
|
||||
boolean isOwner = currentUserId.equals(task.getOwnerId());
|
||||
boolean isCreator = currentUserId.equals(task.getCreatedById());
|
||||
|
||||
if (!isOwner && !isCreator) {
|
||||
throw new CommonException("无权限查看此任务");
|
||||
}
|
||||
|
||||
return task;
|
||||
}
|
||||
|
||||
private Date safeParseDateParam(String dateStr, Date defaultValue) {
|
||||
|
||||
@ -3,12 +3,12 @@ package com.xdap.self_development.utils;
|
||||
import com.alibaba.excel.write.handler.SheetWriteHandler;
|
||||
import com.alibaba.excel.write.metadata.holder.WriteSheetHolder;
|
||||
import com.alibaba.excel.write.metadata.holder.WriteWorkbookHolder;
|
||||
import jdk.nashorn.internal.runtime.logging.Logger;
|
||||
// import jdk.nashorn.internal.runtime.logging.Logger;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.poi.ss.usermodel.*;
|
||||
|
||||
@Slf4j
|
||||
@Logger
|
||||
// @Logger
|
||||
public class DescriptionWriteUtils implements SheetWriteHandler {
|
||||
// 字段说明数组
|
||||
private final String[] descriptions;
|
||||
|
||||
@ -24,6 +24,8 @@ apaas.admin.datasource.username=root
|
||||
apaas.admin.datasource.url=jdbc:mysql://127.0.0.1:3306/test?serverTimezone=GMT%2B8&characterEncoding=utf-8
|
||||
apaas.admin.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
|
||||
apaas.admin.datasource.password=qwer12
|
||||
#????????????
|
||||
#apaas.admin.datasource.password=qwer12
|
||||
|
||||
# APAAS ??????MongoDB?
|
||||
apaas.single.datasource.mongoDbName=xdap_app_223770822127386625
|
||||
@ -63,7 +65,7 @@ mpaas.datasource[0].type=mysql
|
||||
mpaas.datasource[0].url=jdbc:mysql://127.0.0.1:3306/test?serverTimezone=GMT%2B8&characterEncoding=utf-8
|
||||
mpaas.datasource[0].driver-class-name=com.mysql.cj.jdbc.Driver
|
||||
mpaas.datasource[0].username=root
|
||||
mpaas.datasource[0].password=qwer12
|
||||
mpaas.datasource[0].password=root
|
||||
mpaas.datasource[0].minPoolSize=50
|
||||
mpaas.datasource[0].maxPoolSize=1000
|
||||
mpaas.datasource[1].name=yc_lrs_test_relsult
|
||||
@ -71,7 +73,7 @@ mpaas.datasource[1].type=mysql
|
||||
mpaas.datasource[1].url=jdbc:mysql://127.0.0.1:3306/yc_lrs_test_relsult?serverTimezone=GMT%2B8&characterEncoding=utf-8
|
||||
mpaas.datasource[1].driver-class-name=com.mysql.cj.jdbc.Driver
|
||||
mpaas.datasource[1].username=root
|
||||
mpaas.datasource[1].password=qwer12
|
||||
mpaas.datasource[1].password=root
|
||||
mpaas.datasource[1].minPoolSize=50
|
||||
mpaas.datasource[1].maxPoolSize=1000
|
||||
mpaas.datasource[2].name=qygs
|
||||
@ -79,7 +81,7 @@ mpaas.datasource[2].type=mysql
|
||||
mpaas.datasource[2].url=jdbc:mysql://127.0.0.1:3306/test?serverTimezone=GMT%2B8&characterEncoding=utf-8
|
||||
mpaas.datasource[2].driver-class-name=com.mysql.cj.jdbc.Driver
|
||||
mpaas.datasource[2].username=root
|
||||
mpaas.datasource[2].password=qwer12
|
||||
mpaas.datasource[2].password=root
|
||||
mpaas.datasource[2].minPoolSize=50
|
||||
mpaas.datasource[2].maxPoolSize=1000
|
||||
|
||||
@ -95,7 +97,7 @@ mpaas.mode=DEV
|
||||
activiti.datasource.driverClassName=com.mysql.cj.jdbc.Driver
|
||||
activiti.datasource.url=jdbc:mysql://127.0.0.1:3306/activiti_demo?serverTimezone=Asia/Shanghai&characterEncoding=utf-8
|
||||
activiti.datasource.username=root
|
||||
activiti.datasource.password=qwer12
|
||||
activiti.datasource.password=root
|
||||
activiti.datasource.maxActive=50
|
||||
activiti.datasource.inIdle=5
|
||||
activiti.datasource.initialSize=5
|
||||
@ -103,12 +105,13 @@ spring.activiti.process-definition-location-prefix=classpath:/processes/
|
||||
spring.activiti.check-process-definitions=true
|
||||
spring.activiti.database-schema-update=true
|
||||
spring.activiti.deployment-mode=default
|
||||
activiti.databaseSchemaUpdate=true
|
||||
|
||||
# ====================== Spring ??????? ======================
|
||||
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
|
||||
spring.datasource.url=jdbc:mysql://127.0.0.1:3306/test?serverTimezone=Asia/Shanghai&characterEncoding=utf-8
|
||||
spring.datasource.username=root
|
||||
spring.datasource.password=qwer12
|
||||
spring.datasource.password=root
|
||||
|
||||
# ====================== ??/?????? ======================
|
||||
# Redis ??
|
||||
|
||||
330
target/classes/application.properties
Normal file
330
target/classes/application.properties
Normal file
@ -0,0 +1,330 @@
|
||||
# ====================== APAAS ???? ======================
|
||||
apaas.app.url=https://apaas-meim.app.yuchai.com/app/a5e8e08/ycgf-yf-rddata
|
||||
apaas.token.url=http://asdasd
|
||||
apaas.token.clientId=2b5b3de8-e7fd-406a-a59a-d5568457b1f4
|
||||
apaas.token.clientSecred=94bddc6a-27a4-4204-885b-b075812ec535
|
||||
apaas.single.tenantId=223770822127386625
|
||||
apaas.single.appId=771297120740179968
|
||||
apaas.single.app-group-app-ids=2b5b3de8-e7fd-406a-a59a-d5568457b1f4
|
||||
apaas.single.private=true
|
||||
apaas.oauth.app.appOauthTokenUrl=http://mpaas.app.yuchai.com/oauth2/oauth/token
|
||||
apaas.oauth.app.appOauthUserSchemaJsonPath=$.userName
|
||||
apaas.oauth.app.appOauthOAuthUserUrl=http://mpaas.app.yuchai.com/oauth2/oauth/user
|
||||
apaas.tenant.init.db.initial-pool-size=30
|
||||
apaas.tenant.init.db.max-pool-size=1000
|
||||
apaas.tenant.initDataModel=true
|
||||
apaas.hikariConfig.maxLifetimeMs=28800000
|
||||
apaas.cache.usemq=true
|
||||
apaas.bizevent.async=false
|
||||
apaas.deploy.type=null
|
||||
|
||||
# APAAS ??????MySQL?
|
||||
apaas.admin.datasource.type=mysql
|
||||
apaas.admin.datasource.username=root
|
||||
apaas.admin.datasource.url=jdbc:mysql://127.0.0.1:3306/test?serverTimezone=GMT%2B8&characterEncoding=utf-8
|
||||
apaas.admin.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
|
||||
apaas.admin.datasource.password=qwer12
|
||||
#????????????
|
||||
#apaas.admin.datasource.password=qwer12
|
||||
|
||||
# APAAS ??????MongoDB?
|
||||
apaas.single.datasource.mongoDbName=xdap_app_223770822127386625
|
||||
apaas.single.datasource.mongoUrl=mongodb://localhost:27017/xdap_app_223770822127386625
|
||||
apaas.single.datasource.mongoPoolConfig.minSize=0
|
||||
apaas.single.datasource.mongoPoolConfig.maxSize=100
|
||||
apaas.single.datasource.mongoPoolConfig.maxConnectionLifeTime=3600
|
||||
apaas.single.datasource.mongoPoolConfig.maxConnectionIdleTime=3600
|
||||
apaas.single.datasource.mongoPoolConfig.maintenanceFrequency=600
|
||||
apaas.single.datasource.mongoPoolConfig.maintenanceInitialDelay=240
|
||||
apaas.single.datasource.mongoPoolConfig.maxWaitQueueSize=500
|
||||
apaas.single.datasource.mongoPoolConfig.maxWaitTime=120
|
||||
|
||||
# ====================== ?????? ======================
|
||||
deploy.backend.platform.port=30607
|
||||
deploy.backend.platform.host=10.20.52.11
|
||||
deploy.backend.singleapp.host=apaas-meim.app.yuchai.com
|
||||
deploy.front.workbench.port=443
|
||||
deploy.front.workbench.host=apaas-meim.app.yuchai.com
|
||||
deploy.front.platform.port=443
|
||||
deploy.front.platform.host=apaas-meim.app.yuchai.com
|
||||
deploy.front.singleapp.host=apaas-meim.app.yuchai.com
|
||||
deploy.front.singleapp.app.prefix=app/a5e8e08/ycgf-yf-rddata
|
||||
deploy.front.singleapp.m.prefix=m/a5e8e08/ycgf-yf-rddata
|
||||
deploy.rabbit.host=127.0.0.1
|
||||
deploy.rabbit.port=5672
|
||||
deploy.rabbit.username=guest
|
||||
deploy.rabbit.password=guest
|
||||
deploy.redis.host=127.0.0.1
|
||||
deploy.redis.port=6379
|
||||
deploy.redis.password=xdapredis
|
||||
deploy.powerjob.address=127.0.0.1:7700
|
||||
|
||||
# ====================== ??????MPAAS? ======================
|
||||
mpaas.datasource[0].name=xdap_app_223770822127386625
|
||||
mpaas.datasource[0].type=mysql
|
||||
mpaas.datasource[0].url=jdbc:mysql://127.0.0.1:3306/test?serverTimezone=GMT%2B8&characterEncoding=utf-8
|
||||
mpaas.datasource[0].driver-class-name=com.mysql.cj.jdbc.Driver
|
||||
mpaas.datasource[0].username=root
|
||||
mpaas.datasource[0].password=root
|
||||
mpaas.datasource[0].minPoolSize=50
|
||||
mpaas.datasource[0].maxPoolSize=1000
|
||||
mpaas.datasource[1].name=yc_lrs_test_relsult
|
||||
mpaas.datasource[1].type=mysql
|
||||
mpaas.datasource[1].url=jdbc:mysql://127.0.0.1:3306/yc_lrs_test_relsult?serverTimezone=GMT%2B8&characterEncoding=utf-8
|
||||
mpaas.datasource[1].driver-class-name=com.mysql.cj.jdbc.Driver
|
||||
mpaas.datasource[1].username=root
|
||||
mpaas.datasource[1].password=root
|
||||
mpaas.datasource[1].minPoolSize=50
|
||||
mpaas.datasource[1].maxPoolSize=1000
|
||||
mpaas.datasource[2].name=qygs
|
||||
mpaas.datasource[2].type=mysql
|
||||
mpaas.datasource[2].url=jdbc:mysql://127.0.0.1:3306/test?serverTimezone=GMT%2B8&characterEncoding=utf-8
|
||||
mpaas.datasource[2].driver-class-name=com.mysql.cj.jdbc.Driver
|
||||
mpaas.datasource[2].username=root
|
||||
mpaas.datasource[2].password=root
|
||||
mpaas.datasource[2].minPoolSize=50
|
||||
mpaas.datasource[2].maxPoolSize=1000
|
||||
|
||||
mpaas.security=false
|
||||
mpaas.query.dbadatper=mysql
|
||||
mpaas.query.security.mode=custom
|
||||
mpaas.query.dbvendor=mysql
|
||||
mpaas.query.bigdatathresholdvalue=100000
|
||||
|
||||
mpaas.mode=DEV
|
||||
|
||||
# ====================== Activiti ????? ======================
|
||||
activiti.datasource.driverClassName=com.mysql.cj.jdbc.Driver
|
||||
activiti.datasource.url=jdbc:mysql://127.0.0.1:3306/activiti_demo?serverTimezone=Asia/Shanghai&characterEncoding=utf-8
|
||||
activiti.datasource.username=root
|
||||
activiti.datasource.password=root
|
||||
activiti.datasource.maxActive=50
|
||||
activiti.datasource.inIdle=5
|
||||
activiti.datasource.initialSize=5
|
||||
spring.activiti.process-definition-location-prefix=classpath:/processes/
|
||||
spring.activiti.check-process-definitions=true
|
||||
spring.activiti.database-schema-update=true
|
||||
spring.activiti.deployment-mode=default
|
||||
activiti.databaseSchemaUpdate=true
|
||||
|
||||
# ====================== Spring ??????? ======================
|
||||
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
|
||||
spring.datasource.url=jdbc:mysql://127.0.0.1:3306/test?serverTimezone=Asia/Shanghai&characterEncoding=utf-8
|
||||
spring.datasource.username=root
|
||||
spring.datasource.password=root
|
||||
|
||||
# ====================== ??/?????? ======================
|
||||
# Redis ??
|
||||
spring.redis.host=127.0.0.1
|
||||
spring.redis.port=6379
|
||||
spring.redis.database=0
|
||||
spring.redis.timeout=10000
|
||||
spring.redis.jedis.pool.min-idle=0
|
||||
spring.redis.jedis.pool.max-idle=8
|
||||
spring.redis.jedis.pool.max-wait=-1
|
||||
spring.redis.jedis.pool.max-active=20
|
||||
|
||||
# RabbitMQ ??
|
||||
spring.rabbitmq.host=127.0.0.1
|
||||
spring.rabbitmq.port=5672
|
||||
spring.rabbitmq.username=guest
|
||||
spring.rabbitmq.password=guest
|
||||
|
||||
# ====================== PowerJob ?????? ======================
|
||||
powerjob.akka-port=27777
|
||||
powerjob.server-address=127.0.0.1:7700
|
||||
powerjob.app-name=49b90be5-eebe-4359-a
|
||||
powerjob.store-strategy=disk
|
||||
powerjob.enable-test-mode=false
|
||||
powerjob.worker.akka-port=27777
|
||||
powerjob.worker.server-address=127.0.0.1:7700
|
||||
powerjob.worker.app-name=49b90be5-eebe-4359-a
|
||||
powerjob.worker.store-strategy=disk
|
||||
powerjob.worker.enabled=false
|
||||
powerjob.worker.enable-test-mode=true
|
||||
|
||||
# ====================== ????? ======================
|
||||
server.port=9091
|
||||
server.compression.enabled=true
|
||||
server.compression.mime-types=application/json,application/xml,text/html,text/xml,text/plain,application/javascript,text/css
|
||||
server.compression.min-response-size=2048
|
||||
spring.servlet.multipart.max-file-size=150MB
|
||||
spring.servlet.multipart.max-request-size=200MB
|
||||
spring.jackson.default-property-inclusion=non_null
|
||||
|
||||
# ====================== ??/???? ======================
|
||||
token.ttlMillis=7200000
|
||||
token.refreshTtlMillis=1209600000
|
||||
token.openTokenTtlMillis=7200000
|
||||
token.openTokenRefreshTtlMillis=1209600000
|
||||
standard.plan.appTtlMillis=3600000
|
||||
standard.plan.userTtlMillis=7200000
|
||||
|
||||
# ====================== ???? ======================
|
||||
logging.file=log/xdap-app.log
|
||||
logging.config=classpath:logback-spring.xml
|
||||
|
||||
# ====================== ??????? ======================
|
||||
# ??OCR??
|
||||
baidu.ocr.vatInvoiceUrl=https://aip.baidubce.com/rest/2.0/ocr/v1/vat_invoice
|
||||
baidu.ocr.basicGeneralUrl=https://aip.baidubce.com/rest/2.0/ocr/v1/accurate_basic
|
||||
baidu.ocr.businessCardUrl=https://aip.baidubce.com/rest/2.0/ocr/v1/business_card
|
||||
baidu.ocr.accessTokenUrl=https://aip.baidubce.com/oauth/2.0/token?
|
||||
baidu.ocr.accessTokenKey=BAIDU_OCR_KEY
|
||||
baidu.ocr.appId=23499932
|
||||
baidu.ocr.apiKey=HHRFL3VPtnj7Nle60ytbGMls
|
||||
baidu.ocr.secretKey=VTvrrMjZZC1xtYfu82cfUhjeYgNTRIHe
|
||||
|
||||
# ???OSS??
|
||||
aliyun.oss.accessKeyId=LTAI4GEC6ssfFDuVDUL3TbLp
|
||||
aliyun.oss.accessKeySecret=ZpbgWTt2qfK68lQILqj0H3EdIun1Qf
|
||||
aliyun.oss.endpoint=http://oss-cn-shanghai.aliyuncs.com
|
||||
|
||||
# ????
|
||||
dingding.redirectUri=redirect_uri=https%3A%2F%2Fapaas-meim.app.yuchai.com%2Fapp%2Fa5e8e08%2Fycgf-yf-rddata%2Fcallback%2Fdingding%2Findex.html&response_type=code&prompt=consent&scope=openid
|
||||
dingding.pageLink=null
|
||||
dingding.userIdByMobileUrl=https://oapi.dingtalk.com/topapi/v2/user/getbymobile
|
||||
dingding.userAccessTokenUrl=https://api.dingtalk.com/v1.0/oauth2/userAccessToken
|
||||
dingding.sendMessageUrl=https://api.dingtalk.com/v1.0/robot/oToMessages/batchSend
|
||||
dingding.authUrlPre=https://login.dingtalk.com/oauth2/auth?
|
||||
dingding.userInfoUrl=https://api.dingtalk.com/v1.0/contact/users/me
|
||||
dingding.appAccessTokenUrl=https://oapi.dingtalk.com/gettoken
|
||||
|
||||
# ????
|
||||
feishu.feiShuUrlPre=https://open.feishu.cn/open-apis/authen/v1/index?
|
||||
feishu.getOpenIdUrl=https://open.feishu.cn/open-apis/user/v1/batch_get_id?mobiles=
|
||||
feishu.getTokenUrl=https://open.feishu.cn/open-apis/auth/v3/app_access_token/internal/
|
||||
feishu.feiShuRedirectUri=redirect_uri=https%3A%2F%2Fapaas-meim.app.yuchai.com%2Fapp%2Fa5e8e08%2Fycgf-yf-rddata%2Fcallback%2Ffeishu%2Findex.html
|
||||
|
||||
# ??????
|
||||
apaasworkwechat.message.wxOAuth2url=https://open.weixin.qq.com/connect/oauth2/authorize?appid=${CORPID!""}&redirect_uri=${URL!""}callback%2Fwe-com%2Findex.html&response_type=code&scope=snsapi_privateinfo&state=${STATE!""}&agentid=${AGENTID!""}#wechat_redirect
|
||||
apaasworkwechat.message.workWechatUrlPre=null
|
||||
|
||||
# ====================== XDAP ???? ======================
|
||||
xdap.jobServerUrl=http://localhost:7700
|
||||
xdap.adminUrl=gateway.yctp.yuchaidev.com/apaas/xdap-admin
|
||||
xdap.gatewayUrl=gateway.yctp.yuchaidev.com/apaas/gateway
|
||||
xdap.jobUrl=http://127.0.0.1:${server.port:9091}/xdap-job
|
||||
xdap.openappUrl=http://127.0.0.1:${server.port:9091}/xdap-app
|
||||
xdap.appUrl=http://127.0.0.1:${server.port:9091}/xdap-app
|
||||
#xdap.singleAdminAppUrl=http://10.20.52.58:30607/xdap-app
|
||||
xdap.snow.data-center-id=0
|
||||
xdap.snow.workId=192
|
||||
xdap.avatar.prefix=/xdap-app/attachments/downloadFile?file=
|
||||
xdap.avatar.path=/resource/head_portrait/
|
||||
xdap.avatar.adminBucketName=xdap-admin-dev
|
||||
xdap.avatar.bucketName=xdap-app-dev
|
||||
xdap.avatar.localPath=/data/resources/attachments/
|
||||
xdap.avatar.enableDynamicsPrefix=false
|
||||
xdap.avatar.adminPrefix=https://apaas-meim.app.yuchai.com/apaas/platform/xdap-admin/attachments/downloadFile?file=
|
||||
xdap.share.frontSingleAppHost=https://apaas-meim.app.yuchai.com/app/a5e8e08/ycgf-yf-rddata/
|
||||
xdap.share.frontSingleMobileHost=https://apaas-meim.app.yuchai.com/m/a5e8e08/ycgf-yf-rddata/
|
||||
xdap.share.pcSkipUrl=blank/public-form?shareId=
|
||||
xdap.share.mobileSkipUrl=blank/public-form?shareId=
|
||||
xdap.share.editAfterShareUrl=/xdap-app/formShareSkip/skip/shareUrl?shareId=
|
||||
xdap.invitation.prefix=http://k8s.definesys.com:31005/x-project-app/blank/invite?inviteCode=
|
||||
xdap.skipurl=https://apaas-meim.app.yuchai.com/app/a5e8e08/ycgf-yf-rddata/%s/app/app-page?appId=%s&formId=%s&title=%s¤tMenu=%s
|
||||
xdap.skipDetailurl=https://apaas-meim.app.yuchai.com/app/a5e8e08/ycgf-yf-rddata/%s/app/app-page?appId=%s&formId=%s&title=%s¤tMenu=%s&documentId=%s
|
||||
xdap.todourl=https://apaas-meim.app.yuchai.com/workbench/app/%s/todoCenter/myTodo/?formId=%s&documentId=%s&processId=%s
|
||||
xdap.todocenter=https://apaas-meim.app.yuchai.com/workbench/app/%s/todoCenter/myTodo
|
||||
xdap.resource.path=i18n/platform/platform_en_US.properties,i18n/platform/platform_zh_CN.properties,i18n/workbench/workbench_en_US.properties,i18n/workbench/workbench_zh_CN.properties,i18n/app/app_en_US.properties,i18n/app/app_zh_CN.properties,i18n/app/app_ja_JP.properties
|
||||
xdap.apaas.dbselectPriv=false
|
||||
xdap.apaas.private=true
|
||||
xdap.apaas.cache.run.init=true
|
||||
xdap.apaas.interface.encrypt.appEncryptionForceOpen=DISABLE
|
||||
xdap.apaas.interface.encrypt.appEncryptionType=SM2
|
||||
xdap.apaas.interface.encrypt.appEncryptionStatus=DISABLE
|
||||
xdap.apaas.interface.encrypt.encryptType=DISABLE
|
||||
xdap.apaas.decryptProperties=DO_ENCRYPT
|
||||
xdap.apaas.interface.encrypt.privateKeyHex=4b6b9fa1be0757bf4977344c634c4ac2b0c907cd3b225ea16b674b8348ffdcde
|
||||
xdap.apaas.interface.encrypt.publicKeyHex=04919f2130b035e29f079b4dace907e3cad716556f93574f1f2d61685f6a5ac251cba81822062353a07fd69f2c544f2263f217e04b3af327453c1f9157a434e0de
|
||||
xdap.apaas.zuc.iv=null
|
||||
xdap.apaas.zuc.k=null
|
||||
xdap.password.forceModify=DISABLE
|
||||
xdap.password.passwordValidateMessage=\u5bc6\u7801\u9700\u5305\u542b\u6570\u5b57\u3001\u5b57\u6bcd\u5927\u5c0f\u5199\u548c\u7279\u6b8a\u5b57\u7b26\uff0c\u4e0d\u5c11\u4e8e8\u4f4d
|
||||
xdap.password.passwordValidateRule=^.*(?=.{8,32})(?=.*\d)(?=.*[A-Z])(?=.*[a-z])(?=.*[!@#$%^&*?.() +-_~,=]).*$
|
||||
xdap.header.accessControlAllowOrigin[0]=*
|
||||
xdap.process.suspendTimeFlag=ENABLE
|
||||
xdap.process.batchOption=20
|
||||
|
||||
# ====================== ????? ======================
|
||||
license.path=/data/resources/license.lic
|
||||
license.publicKeyStorePath=/data/resources/publicCerts.keystore
|
||||
|
||||
# ====================== Feign ?????? ======================
|
||||
feign.hystrix.enabled=false
|
||||
feign.client.config.default.read-timeout=50000
|
||||
feign.client.config.default.connect-timeout=20000
|
||||
|
||||
# ====================== Nacos ?? ======================
|
||||
spring.cloud.nacos.discovery.enabled=false
|
||||
spring.cloud.nacos.config.refresh-enabled=false
|
||||
spring.cloud.nacos.discovery.instance-enabled=false
|
||||
spring.cloud.nacos.config.enabled=false
|
||||
|
||||
# ====================== ????????? ======================
|
||||
fileformat.whiteList[0]=.jpg
|
||||
fileformat.whiteList[1]=.jpeg
|
||||
fileformat.whiteList[2]=.jfif
|
||||
fileformat.whiteList[3]=.png
|
||||
fileformat.whiteList[4]=.xls
|
||||
fileformat.whiteList[5]=.xlsx
|
||||
fileformat.whiteList[6]=.doc
|
||||
fileformat.whiteList[7]=.docx
|
||||
fileformat.whiteList[8]=.ppt
|
||||
fileformat.whiteList[9]=.pptx
|
||||
fileformat.whiteList[10]=.gif
|
||||
fileformat.whiteList[11]=.pdf
|
||||
fileformat.whiteList[12]=.txt
|
||||
fileformat.whiteList[13]=.zip
|
||||
fileformat.whiteList[14]=.rar
|
||||
fileformat.whiteList[15]=.mp3
|
||||
fileformat.whiteList[16]=.mp4
|
||||
fileformat.whiteList[17]=.avi
|
||||
fileformat.whiteList[18]=.mov
|
||||
fileformat.whiteList[19]=.md
|
||||
fileformat.whiteList[20]=.json
|
||||
fileformat.whiteList[21]=.7z
|
||||
fileformat.whiteList[22]=.tar
|
||||
fileformat.whiteList[23]=.gz
|
||||
fileformat.whiteList[24]=.csv
|
||||
fileformat.whiteList[25]=.xml
|
||||
fileformat.whiteList[26]=.jar
|
||||
fileformat.whiteList[27]=.log
|
||||
fileformat.whiteList[28]=.keystore
|
||||
fileformat.whiteList[29]=.xlsm
|
||||
fileformat.whiteList[30]=.yml
|
||||
fileformat.whiteList[31]=.yaml
|
||||
fileformat.whiteList[32]=.properties
|
||||
fileformat.whiteList[33]=.xml
|
||||
fileformat.whiteList[34]=.dfy
|
||||
fileformat.whiteList[35]=.dfyx
|
||||
fileformat.whiteList[36]=.svg
|
||||
fileformat.whiteList[37]=.hex
|
||||
|
||||
# ====================== ???? ======================
|
||||
download.config.downloadType=PERMANENT
|
||||
download.config.effectiveTime=168
|
||||
download.config.publicKeyHex=04919f2130b035e29f079b4dace907e3cad716556f93574f1f2d61685f6a5ac251cba81822062353a07fd69f2c544f2263f217e04b3af327453c1f9157a434e0de
|
||||
download.config.privateKeyHex=4b6b9fa1be0757bf4977344c634c4ac2b0c907cd3b225ea16b674b8348ffdcde
|
||||
|
||||
# ====================== ????? ======================
|
||||
i18n.backendProjects[0]=app
|
||||
i18n.backendProjects[1]=platform
|
||||
i18n.backendProjects[2]=workbench
|
||||
i18n.frontProjects[0]=app
|
||||
i18n.frontProjects[1]=app-h5
|
||||
i18n.frontProjects[2]=common
|
||||
i18n.frontProjects[3]=platform-admin
|
||||
i18n.frontProjects[4]=workbench
|
||||
i18n.frontProjects[5]=workbench-h5
|
||||
i18n.frontProjects[6]=x-dcloud-business-event
|
||||
i18n.frontProjects[7]=x-dcloud-page-engine
|
||||
i18n.frontProjects[8]=x-dcloud-page-mobile
|
||||
i18n.frontProjects[9]=x-dcloud-page-web
|
||||
i18n.frontProjects[10]=xui
|
||||
|
||||
# ====================== ???? ======================
|
||||
management.endpoints.web.exposure.include=*
|
||||
management.endpoint.health.show-details=always
|
||||
management.health.db.enabled=false
|
||||
BIN
target/classes/com/xdap/self_development/MainApplication.class
Normal file
BIN
target/classes/com/xdap/self_development/MainApplication.class
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
target/classes/com/xdap/self_development/common/MyResponse.class
Normal file
BIN
target/classes/com/xdap/self_development/common/MyResponse.class
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user