修改:小问题修改,参数计算逻辑优化日志,查询分析修改退回,模板修改节点

This commit is contained in:
zjh 2026-01-19 16:25:56 +08:00
parent fecf4c60fb
commit 1a8dbb0617
27 changed files with 348 additions and 536 deletions

View File

@ -1,4 +1,4 @@
package com.xdap.self_development.config; package com.xdap.self_development.common;
import com.definesys.mpaas.query.MpaasQuery; import com.definesys.mpaas.query.MpaasQuery;
import com.definesys.mpaas.query.MpaasQueryFactory; import com.definesys.mpaas.query.MpaasQueryFactory;

View File

@ -1,89 +0,0 @@
package com.xdap.self_development.common;
import com.xdap.jobworker.moudle.department.pojo.entity.XdapDeptUsers;
import com.xdap.runtime.service.RuntimeAppContextService;
import com.xdap.self_development.config.BusinessDatabase;
import com.xdap.self_development.pojo.view.MenuParamView;
import com.xdap.self_development.service.ModelRoleService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.util.*;
import java.util.stream.Collectors;
@Slf4j
@Component
public class UserPermissionGetter {
@Resource
private BusinessDatabase businessDatabase;
@Resource
private ModelRoleService modelRoleService;
@Resource
private RuntimeAppContextService runtimeAppContextService;
public String getUserId() {
return runtimeAppContextService.getCurrentUserId();
}
// 获取子系统下的零部件权限
public List<String> getParamPermissions(String subsystem, String userId) {
Set<String> result = new HashSet<>();
try {
// 获取用户所有权限
Map<String, List<MenuParamView>> collected = modelRoleService.selectPersByUser(userId)
.stream().collect(Collectors.groupingBy(MenuParamView::getSubsystem));
// 获取用户在当前子系统拥有的零部件权限
if (collected.containsKey(subsystem)) {
result.addAll(collected.get(subsystem)
.stream().map(MenuParamView::getPartsName).collect(Collectors.toSet()));
}
// 获取用户所在部门在当前子系统拥有的零部件权限
List<String> deptIds = businessDatabase.getBusinessDatabase()
.eq("user_id", userId).doQuery(XdapDeptUsers.class)
.stream().map(XdapDeptUsers::getDepartmentId).collect(Collectors.toList());
for (String deptId : deptIds) {
Map<String, List<MenuParamView>> collected1 = modelRoleService.selectPersByUser(deptId)
.stream().collect(Collectors.groupingBy(MenuParamView::getSubsystem));
if (collected1.containsKey(subsystem)) {
result.addAll(collected1.get(subsystem)
.stream().map(MenuParamView::getPartsName).collect(Collectors.toSet()));
}
}
} catch (Exception e) {
log.error(e.getMessage());
return new ArrayList<>();
}
return new ArrayList<>(result);
}
// 获取全部参数权限
public List<String> getParamPermissions(String userId) {
Set<String> result = new HashSet<>();
try {
// 获取用户权限
Map<String, List<MenuParamView>> collected = modelRoleService.selectPersByUser(userId)
.stream().collect(Collectors.groupingBy(MenuParamView::getSubsystem));
for (String subsystem : collected.keySet()) {
result.addAll(collected.get(subsystem)
.stream().map(MenuParamView::getPartsName).collect(Collectors.toSet()));
}
// 获取用户所在部门权限
List<String> deptIds = businessDatabase.getBusinessDatabase()
.eq("user_id", userId).doQuery(XdapDeptUsers.class)
.stream().map(XdapDeptUsers::getDepartmentId).collect(Collectors.toList());
for (String deptId : deptIds) {
Map<String, List<MenuParamView>> collected1 = modelRoleService.selectPersByUser(deptId)
.stream().collect(Collectors.groupingBy(MenuParamView::getSubsystem));
for (String subsystem : collected1.keySet()) {
result.addAll(collected1.get(subsystem)
.stream().map(MenuParamView::getPartsName).collect(Collectors.toSet()));
}
}
} catch (Exception e) {
log.error(e.getMessage());
return new ArrayList<>();
}
return new ArrayList<>(result);
}
}

View File

@ -27,6 +27,12 @@ public class AnalysisCommonController {
return Response.ok().data(lists); return Response.ok().data(lists);
} }
// 获取可用参数
@GetMapping("/getAvailableParameters")
public Response getAvailableParameters() {
List<String> lists = analysisCommonParametersService.getAvailableParameters();
return Response.ok().data(lists);
}
//统计分析图表 //统计分析图表
@PostMapping("/showReport") @PostMapping("/showReport")

View File

@ -63,6 +63,7 @@ public class CommonParameterController {
return Response.ok().setMessage("修改成功"); return Response.ok().setMessage("修改成功");
} }
/*-----------------------------------------------------------------*/
// 查询数据分析常用 // 查询数据分析常用
@GetMapping("/getAnalysisCommonParameter") @GetMapping("/getAnalysisCommonParameter")

View File

@ -1,123 +1,24 @@
package com.xdap.self_development.controller; package com.xdap.self_development.controller;
import com.alibaba.excel.EasyExcel;
import com.definesys.mpaas.common.http.Response; import com.definesys.mpaas.common.http.Response;
import com.definesys.mpaas.query.MpaasQueryFactory;
import com.xdap.motor.entity.SnowflakeIdWorker;
import com.xdap.runtime.service.RuntimeAppContextService;
import com.xdap.self_development.common.MyResponse; import com.xdap.self_development.common.MyResponse;
import com.xdap.self_development.common.UserPermissionGetter;
import com.xdap.self_development.config.BusinessDatabase;
import com.xdap.self_development.controller.request.ModelComparisonExportRequest;
import com.xdap.self_development.feign.ApaasMyTokenFeign;
import com.xdap.self_development.pojo.DataEntryEngineModelPojo;
import com.xdap.self_development.pojo.EngineParamDetailPojo;
import com.xdap.self_development.pojo.ModelDepUserRolePojo;
import com.xdap.self_development.pojo.view.MenuParamView;
import com.xdap.self_development.pojo.view.TcQueryView;
import com.xdap.self_development.schedule.ParameterValueCalculationTimer; import com.xdap.self_development.schedule.ParameterValueCalculationTimer;
import com.xdap.self_development.service.ModelRoleService;
import lombok.Data;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.io.IOException;
import java.io.InputStream;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@Slf4j @Slf4j
@RestController @RestController
@RequestMapping("/custom/delete") @RequestMapping("/custom/delete")
public class DeleteController { public class DeleteController {
@Resource @Resource
private BusinessDatabase yourDataService; private ParameterValueCalculationTimer parameterValueCalculationTimer;
@PostMapping("queryTc") @GetMapping("/testCalculate")
public Response queryTc( public Response testCalculate() {
@RequestBody List<String> models MyResponse myResponse = parameterValueCalculationTimer.dailyCalculate();
) { return Response.ok().data(myResponse);
try {
Map<String, DataEntryEngineModelPojo> engineModelPojoMap = yourDataService.getBusinessDatabase()
.in("id", models)
.doQuery(DataEntryEngineModelPojo.class).stream()
.collect(Collectors.toMap(DataEntryEngineModelPojo::getId, model -> model));
List<EngineParamDetailPojo> allEngineParamDetails = yourDataService.getBusinessDatabase()
.in("engine_model_id", models)
.doQuery(EngineParamDetailPojo.class);
Map<String, List<EngineParamDetailPojo>> engineParamDetailMap = allEngineParamDetails.stream()
.collect(Collectors.groupingBy(EngineParamDetailPojo::getEngineModelId));
List<QueryModel> queryModels = new ArrayList<>();
engineParamDetailMap.forEach((key, value) -> {
value.forEach(param -> {
QueryModel queryModel = new QueryModel();
queryModel.setZtj(engineModelPojoMap.get(key).getProductNumber());
queryModel.setIdattrtbutehame(param.getParameterName());
queryModel.setLbjmc(param.getPartsName());
queryModels.add(queryModel);
});
});
List<TcQueryView> queryTc = yourDataService.getBusinessDatabase()
.viewQueryMode(true)
.view("queryTc")
.setVar("queryModels", queryModels)
.doQuery(TcQueryView.class);
return Response.ok().data(queryTc);
} catch (Exception e) {
log.error("查询TC失败", e);
return Response.error("查询TC失败" + e.getMessage());
}
}
@Data
static class QueryModel implements Serializable {
private static final long serialVersionUID = 1L;
// 状态机
private String ztj;
// 零件名
private String lbjmc;
// 参数名
private String idattrtbutehame;
}
@PostMapping("/excel/import")
public String importExcel(@RequestParam("file") MultipartFile file) {
// 校验文件
if (file.isEmpty()) {
return "上传的文件为空,请选择有效文件!";
}
// 校验文件格式
String fileName = file.getOriginalFilename();
if (fileName == null || (!fileName.endsWith(".xlsx") && !fileName.endsWith(".xls"))) {
return "仅支持 .xlsx 和 .xls 格式的 Excel 文件!";
}
try (InputStream inputStream = file.getInputStream()) {
// 创建监听器注入你的 Service
ExcelImportListener listener = new ExcelImportListener(yourDataService);
// 执行 Excel 解析
EasyExcel.read(inputStream, ExcelImportEntity.class, listener)
// 忽略表头如果 Excel 第一行是表头这里设置为 1否则为 0
.sheet().headRowNumber(1)
.doRead();
return "Excel 导入成功!";
} catch (IOException e) {
log.error("Excel 导入失败", e);
return "Excel 导入失败:" + e.getMessage();
} catch (RuntimeException e) {
log.error("数据写入数据库失败", e);
return "数据写入失败:" + e.getMessage();
}
} }
} }

View File

@ -27,6 +27,17 @@ public class TemplateApprovalController {
@Resource @Resource
private RuntimeDatasourceService runtimeDatasourceService; private RuntimeDatasourceService runtimeDatasourceService;
// 修改后继续流程
@GetMapping("/continueApproval")
public Response continueApproval(
@NotBlank @RequestParam String flowId,
@NotBlank @RequestParam String userId
) {
templateApprovalService.continueApproval(flowId, userId);
return Response.ok();
}
// 获取可修改节点 // 获取可修改节点
@GetMapping("/getEditableNodes") @GetMapping("/getEditableNodes")
public Response getEditableNodes( public Response getEditableNodes(

View File

@ -3,7 +3,6 @@ package com.xdap.self_development.controller;
import com.definesys.mpaas.common.http.Response; import com.definesys.mpaas.common.http.Response;
import com.definesys.mpaas.query.db.PageQueryResult; import com.definesys.mpaas.query.db.PageQueryResult;
import com.xdap.self_development.common.MyResponse; import com.xdap.self_development.common.MyResponse;
import com.xdap.self_development.config.BusinessDatabase;
import com.xdap.self_development.controller.form.*; import com.xdap.self_development.controller.form.*;
import com.xdap.self_development.exception.CommonException; import com.xdap.self_development.exception.CommonException;
import com.xdap.self_development.pojo.Template; import com.xdap.self_development.pojo.Template;

View File

@ -13,7 +13,7 @@ public class ReportRequest {
private String platform; private String platform;
private String series; private String series;
private String projectName; private String projectName;
private String projectNumber; private String productNumber;
private String emission; private String emission;
private String burnType; private String burnType;
private Double engineCapacityMin; private Double engineCapacityMin;

View File

@ -1,12 +1,14 @@
package com.xdap.self_development.pojo; package com.xdap.self_development.pojo;
import com.definesys.mpaas.query.annotation.RowID; import com.definesys.mpaas.query.annotation.*;
import com.definesys.mpaas.query.annotation.RowIDType;
import com.definesys.mpaas.query.annotation.Table;
import com.definesys.mpaas.query.model.MpaasBasePojo; import com.definesys.mpaas.query.model.MpaasBasePojo;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
@SQLQuery(value = {
@SQL(view = "queryCommon",
sql = "select cp.*, c.common_name from yfsjglpt_common_parameter c left join yfsjglpt_analysis_common_parameters cp on c.id = cp.common_id where c.common_type = 2 and c.create_by = #userId")
})
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@Data @Data
@Table("yfsjglpt_analysis_common_parameters") @Table("yfsjglpt_analysis_common_parameters")
@ -26,4 +28,7 @@ public class AnalysisCommonParameters extends MpaasBasePojo {
private String combustionType; private String combustionType;
private String commonId; private String commonId;
@Column(type = ColumnType.CALCULATE)
private String commonName;
} }

View File

@ -9,6 +9,8 @@ import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
@SQLQuery(value = { @SQLQuery(value = {
@SQL(view = "selectAllParameters",
sql = "SELECT p.* FROM yfsjglpt_model_template t LEFT JOIN yfsjglpt_model_parameter_and_template pat ON t.id = pat.template_id LEFT JOIN yfsjglpt_model_parameter p ON pat.parameter_id = p.id WHERE t.status = 'COMPLETE'"),
@SQL(view = "selectTcParameter", @SQL(view = "selectTcParameter",
sql = "SELECT p.* FROM yfsjglpt_model_template t LEFT JOIN yfsjglpt_model_parameter_and_template pat ON t.id = pat.template_id LEFT JOIN yfsjglpt_model_parameter p ON pat.parameter_id = p.id WHERE t.status = 'COMPLETE' AND p.parameter_source = '数据平台手工录入'"), sql = "SELECT p.* FROM yfsjglpt_model_template t LEFT JOIN yfsjglpt_model_parameter_and_template pat ON t.id = pat.template_id LEFT JOIN yfsjglpt_model_parameter p ON pat.parameter_id = p.id WHERE t.status = 'COMPLETE' AND p.parameter_source = '数据平台手工录入'"),
@SQL(view = "selectParametersByTIdAndCreateBy", @SQL(view = "selectParametersByTIdAndCreateBy",

View File

@ -1,7 +1,7 @@
package com.xdap.self_development.schedule; package com.xdap.self_development.schedule;
import com.xdap.self_development.common.MyResponse; import com.xdap.self_development.common.MyResponse;
import com.xdap.self_development.config.BusinessDatabase; import com.xdap.self_development.common.BusinessDatabase;
import com.xdap.self_development.exception.CommonException; import com.xdap.self_development.exception.CommonException;
import com.xdap.self_development.pojo.ClassificationAttribute; import com.xdap.self_development.pojo.ClassificationAttribute;
import com.xdap.self_development.pojo.EnginePartsCollection; import com.xdap.self_development.pojo.EnginePartsCollection;
@ -80,9 +80,9 @@ public class ParameterValueCalculationTimer {
.eq("lbjmc", parameter.getPartsName()) .eq("lbjmc", parameter.getPartsName())
.doQueryFirst(EnginePartsCollection.class); .doQueryFirst(EnginePartsCollection.class);
if (enginePartsCollection == null || enginePartsCollection.getLbjth() == null) { if (enginePartsCollection == null || enginePartsCollection.getLbjth() == null) {
log.warn("参数【{}】在TC分类表中未找到对应零部件产品号:{}零部件名:{}", log.warn("机型【{}】的参数【{}】在TC分类表中未找到对应零部件零部件名{}",
parameter.getParameterName(), parameter.getProductNumber(), parameter.getPartsName()); parameter.getProductNumber(), parameter.getParameterName(), parameter.getPartsName());
myResponse.getErrors().add("参数【"+parameter.getParameterName()+"】在TC分类表中未找到对应零部件"); myResponse.getErrors().add("机型【"+parameter.getProductNumber()+"】的参数【"+parameter.getParameterName()+"】在TC分类表中未找到对应零部件");
failedToUpdateFromTC++; failedToUpdateFromTC++;
continue; continue;
} }
@ -93,16 +93,17 @@ public class ParameterValueCalculationTimer {
if (classificationAttribute != null && classificationAttribute.getFieldvalue() != null) { if (classificationAttribute != null && classificationAttribute.getFieldvalue() != null) {
String originalValue = parameter.getParameterValue(); String originalValue = parameter.getParameterValue();
parameter.setParameterValue(classificationAttribute.getFieldvalue()); parameter.setParameterValue(classificationAttribute.getFieldvalue());
log.debug("参数【{}】从中台更新值:{} -> {}", parameter.getParameterName(), originalValue, classificationAttribute.getFieldvalue()); log.debug("机型【{}】的参数【{}】从中台更新值:{} -> {}",parameter.getProductNumber(), parameter.getParameterName(), originalValue, classificationAttribute.getFieldvalue());
myResponse.getErrors().add("机型【"+parameter.getProductNumber()+"】的参数【"+parameter.getParameterName()+"】从中台更新值:"+ originalValue + " -> " + classificationAttribute.getFieldvalue());
updatedFromTC++; updatedFromTC++;
} else { } else {
log.warn("参数【{}】在TC分类表中未找到对应值", parameter.getParameterName()); log.warn("机型【{}】的参数【{}】在TC分类表中未找到对应值",parameter.getProductNumber(), parameter.getParameterName());
myResponse.getErrors().add("参数【"+parameter.getParameterName()+"】在TC分类表中未找到对应值"); myResponse.getErrors().add("机型【"+parameter.getProductNumber()+"】的参数【"+parameter.getParameterName()+"】在TC分类表中未找到对应值");
failedToUpdateFromTC++; failedToUpdateFromTC++;
} }
} catch (Exception e) { } catch (Exception e) {
log.error("参数【{}】从中台更新值失败:{}", parameter.getParameterName(), e.getMessage(), e); log.error("机型【{}】的参数【{}】从中台更新值失败:{}",parameter.getProductNumber(), parameter.getParameterName(), e.getMessage(), e);
myResponse.getErrors().add("参数【"+parameter.getParameterName()+"】从中台更新值失败:"+e.getMessage()); myResponse.getErrors().add("机型【"+parameter.getProductNumber()+"】的参数【"+parameter.getParameterName()+"】从中台更新值失败:"+e.getMessage());
failedToUpdateFromTC++; failedToUpdateFromTC++;
} }
} }
@ -129,18 +130,18 @@ public class ParameterValueCalculationTimer {
String modelId = parameterValue.getModelId(); String modelId = parameterValue.getModelId();
try { try {
String replacedFormula = replaceParametersInFormula(formula, parameterNames, originalValueMap, modelId); String replacedFormula = replaceParametersInFormula(formula, parameterNames, originalValueMap, modelId);
log.debug("参数【{}】替换公式:{} -> {}", parameterValue.getParameterName(), formula, replacedFormula); log.debug("机型【{}】的参数【{}】替换公式:{} -> {}",parameterValue.getProductNumber(), parameterValue.getParameterName(), formula, replacedFormula);
Double result = calculateExpression(replacedFormula); Double result = calculateExpression(replacedFormula);
String formattedResult = String.format("%.6f", result); String formattedResult = String.format("%.6f", result);
parameterValue.setParameterValue(formattedResult); parameterValue.setParameterValue(formattedResult);
toUpdate.add(parameterValue); toUpdate.add(parameterValue);
log.info("参数【{}】计算结果:{}", parameterValue.getParameterName(), formattedResult); log.info("机型【{}】的参数【{}】计算结果:{}",parameterValue.getProductNumber(), parameterValue.getParameterName(), formattedResult);
myResponse.getErrors().add("参数【"+parameterValue.getParameterName()+"】计算结果:"+formattedResult); myResponse.getErrors().add("机型【"+parameterValue.getProductNumber()+"】的参数【"+parameterValue.getParameterName()+"】计算结果:"+formattedResult);
successCount++; successCount++;
} catch (Exception e) { } catch (Exception e) {
log.error("参数【{}】计算失败:{},公式:{}模型ID{}", log.error("机型【{}】的参数【{}】计算失败:{},公式:{}模型ID{}",parameterValue.getProductNumber(),
parameterValue.getParameterName(), e.getMessage(), formula, modelId, e); parameterValue.getParameterName(), e.getMessage(), formula, modelId, e);
myResponse.getErrors().add("参数【"+parameterValue.getParameterName()+"】计算失败:"+e.getMessage()+",公式:"+formula+"模型ID"+modelId); myResponse.getErrors().add("机型【"+parameterValue.getProductNumber()+"】的参数【"+parameterValue.getParameterName()+"】计算失败:"+e.getMessage()+",公式:"+formula+"模型ID"+modelId);
parameterValue.setParameterValue(null); parameterValue.setParameterValue(null);
toUpdate.add(parameterValue); // 仍然添加到更新列表用于更新null值 toUpdate.add(parameterValue); // 仍然添加到更新列表用于更新null值
failureCount++; failureCount++;
@ -158,21 +159,20 @@ public class ParameterValueCalculationTimer {
for (CalculationParameterView parameterValue : toUpdate) { for (CalculationParameterView parameterValue : toUpdate) {
try { try {
if (parameterValue.getParameterValue() != null) { if (parameterValue.getParameterValue() != null) {
bd.getBusinessDatabase() // bd.getBusinessDatabase()
.table("engine_param_detail") // .table("engine_param_detail")
.eq("id", parameterValue.getId()) // .eq("id", parameterValue.getId())
.update("parameter_value", parameterValue.getParameterValue()) // .update("parameter_value", parameterValue.getParameterValue())
.doUpdate(); // .doUpdate();
updatedCount++;
} else { } else {
// 对于计算失败的参数也更新为null值 // 对于计算失败的参数也更新为null值
bd.getBusinessDatabase() // bd.getBusinessDatabase()
.table("engine_param_detail") // .table("engine_param_detail")
.eq("id", parameterValue.getId()) // .eq("id", parameterValue.getId())
.update("parameter_value", null) // .update("parameter_value", null)
.doUpdate(); // .doUpdate();
updatedCount++;
} }
updatedCount++;
} catch (Exception e) { } catch (Exception e) {
log.error("参数【{}】更新数据库失败:{}", parameterValue.getParameterName(), e.getMessage(), e); log.error("参数【{}】更新数据库失败:{}", parameterValue.getParameterName(), e.getMessage(), e);
myResponse.getErrors().add("参数【"+parameterValue.getParameterName()+"】更新数据库失败:"+e.getMessage()); myResponse.getErrors().add("参数【"+parameterValue.getParameterName()+"】更新数据库失败:"+e.getMessage());

View File

@ -19,4 +19,6 @@ public interface AnalysisCommonParametersService {
AnalysisModelParamterViewAndParam showReportParamList(ReportRequest analysisRequest); AnalysisModelParamterViewAndParam showReportParamList(ReportRequest analysisRequest);
List<DataEntryEngineModelPojo> selectModelByLike(ReportRequest request); List<DataEntryEngineModelPojo> selectModelByLike(ReportRequest request);
List<String> getAvailableParameters();
} }

View File

@ -19,6 +19,8 @@ import java.util.List;
public interface TemplateApprovalService { public interface TemplateApprovalService {
String startApproval(StartApprovalRequest request); String startApproval(StartApprovalRequest request);
void continueApproval(@NotBlank String flowId, @NotBlank String userId);
void directSendingApproval(@NotBlank String templateId, @NotBlank String userId); void directSendingApproval(@NotBlank String templateId, @NotBlank String userId);
PageQueryResult<TodoAndTemplateView> getApprovalList(ApprovalListForm form); PageQueryResult<TodoAndTemplateView> getApprovalList(ApprovalListForm form);

View File

@ -2,7 +2,7 @@ package com.xdap.self_development.service.impl;
import com.alibaba.fastjson2.JSON; import com.alibaba.fastjson2.JSON;
import com.xdap.api.moudle.user.pojo.XdapUsers; import com.xdap.api.moudle.user.pojo.XdapUsers;
import com.xdap.self_development.config.BusinessDatabase; import com.xdap.self_development.common.BusinessDatabase;
import com.xdap.self_development.controller.form.ApprovalUserNodeDTO; import com.xdap.self_development.controller.form.ApprovalUserNodeDTO;
import com.xdap.self_development.controller.form.HandleApprovalRequest; import com.xdap.self_development.controller.form.HandleApprovalRequest;
import com.xdap.self_development.controller.form.HandleReturnNodeForm; import com.xdap.self_development.controller.form.HandleReturnNodeForm;

View File

@ -4,7 +4,7 @@ package com.xdap.self_development.service.impl;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import com.alibaba.nacos.client.naming.utils.CollectionUtils; import com.alibaba.nacos.client.naming.utils.CollectionUtils;
import com.xdap.self_development.config.BusinessDatabase; import com.xdap.self_development.common.BusinessDatabase;
import com.xdap.self_development.controller.request.*; import com.xdap.self_development.controller.request.*;
import com.xdap.self_development.exception.CommonException; import com.xdap.self_development.exception.CommonException;
import com.xdap.self_development.pojo.*; import com.xdap.self_development.pojo.*;
@ -82,7 +82,7 @@ public class AnalysisCommonParametersServiceImpl implements AnalysisCommonParame
@Override @Override
public AnalysisModelParamterViewAndParam showReport(List<String> models) { public AnalysisModelParamterViewAndParam showReport(List<String> models) {
return showReport3(models); return showReport2(models);
} }
@ -98,7 +98,10 @@ public class AnalysisCommonParametersServiceImpl implements AnalysisCommonParame
@Override @Override
public List<DataEntryEngineModelPojo> selectModelByLike(ReportRequest request) { public List<DataEntryEngineModelPojo> selectModelByLike(ReportRequest request) {
if (request.getEngineCapacityMax() < request.getEngineCapacityMin()) { if (request.getEngineCapacityMax() != null &&
request.getEngineCapacityMin() != null &&
request.getEngineCapacityMax() < request.getEngineCapacityMin()
) {
throw new CommonException("排量范围设置错误"); throw new CommonException("排量范围设置错误");
} }
return new ArrayList<>(businessDatabase.getBusinessDatabase() return new ArrayList<>(businessDatabase.getBusinessDatabase()
@ -107,15 +110,23 @@ public class AnalysisCommonParametersServiceImpl implements AnalysisCommonParame
.like("platform", request.getPlatform()) .like("platform", request.getPlatform())
.like("series", request.getSeries()) .like("series", request.getSeries())
.like("project_name", request.getProjectName()) .like("project_name", request.getProjectName())
.like("project_number", request.getProjectNumber()) .like("product_number", request.getProductNumber())
.like("emission", request.getEmission()) .like("emission", request.getEmission())
.like("burn_type", request.getBurnType()) .like("burn_type", request.getBurnType())
.conjuctionOr() .conjuctionOr()
.lteq("engine_capacity", request.getEngineCapacityMax()) .lteq("engine_capacity", request.getEngineCapacityMax())
.and()
.gteq("engine_capacity", request.getEngineCapacityMin()) .gteq("engine_capacity", request.getEngineCapacityMin())
.doQuery(DataEntryEngineModelPojo.class)); .doQuery(DataEntryEngineModelPojo.class));
} }
@Override
public List<String> getAvailableParameters() {
List<Parameter> modelParams = businessDatabase.getBusinessDatabase()
.viewQueryMode(true)
.view("selectAllParameters")
.doQuery(Parameter.class);
return modelParams.stream().filter(x -> x.getUnit() != null && !x.getUnit().equals("/")).map(Parameter::getParameterName).distinct().collect(Collectors.toList());
}
/* /*
public AnalysisModelParamterViewAndParam showReport1(List<String> modelIds) { public AnalysisModelParamterViewAndParam showReport1(List<String> modelIds) {
long startTime = System.currentTimeMillis(); long startTime = System.currentTimeMillis();
@ -177,9 +188,12 @@ public class AnalysisCommonParametersServiceImpl implements AnalysisCommonParame
return andParam; return andParam;
} }
*/ */
public AnalysisModelParamterViewAndParam showReport2(ReportRequest request) { public AnalysisModelParamterViewAndParam showReport2(List<String> models) {
// 查询所有符合条件的机型 // 查询所有符合条件的机型
List<DataEntryEngineModelPojo> engineModelPojos = selectModelByLike(request); // List<DataEntryEngineModelPojo> engineModelPojos = selectModelByLike(request);
List<DataEntryEngineModelPojo> engineModelPojos = businessDatabase.getBusinessDatabase()
.in("id", models)
.doQuery(DataEntryEngineModelPojo.class);
if (engineModelPojos.isEmpty()) { if (engineModelPojos.isEmpty()) {
throw new CommonException("没有找到符合条件的机型"); throw new CommonException("没有找到符合条件的机型");
@ -259,81 +273,6 @@ public class AnalysisCommonParametersServiceImpl implements AnalysisCommonParame
return ALL_NUMBER_PATTERN.matcher(str.trim()).matches(); return ALL_NUMBER_PATTERN.matcher(str.trim()).matches();
} }
public AnalysisModelParamterViewAndParam showReport3(List<String> models) {
// 查询所有符合条件的机型
List<DataEntryEngineModelPojo> engineModelPojos = businessDatabase.getBusinessDatabase()
.in("id", models)
.doQuery(DataEntryEngineModelPojo.class);
if (CollectionUtils.isEmpty(engineModelPojos)) {
throw new CommonException("没有找到符合条件的机型");
}
List<List<DataEntryEngineModelPojo>> modelBatches = splitModelBatch(engineModelPojos, modelBatchSize);
// 最终结果容器
List<AnalysisModelParamterView> allAnalysisViews = new ArrayList<>();
Set<String> allParamNames = new HashSet<>();
for (List<DataEntryEngineModelPojo> batch : modelBatches) {
// 获取当前批次机型id列表
Set<String> batchModelIds = batch.stream()
.map(DataEntryEngineModelPojo::getId)
.collect(Collectors.toSet());
// 获取数据平台机型的参数
List<EngineParamDetailPojo> batchEngineParamDetails = businessDatabase.getBusinessDatabase()
.in("engine_model_id", batchModelIds)
.doQuery(EngineParamDetailPojo.class);
// modelId 分组
Map<String, List<EngineParamDetailPojo>> engineParamDetailMap = batchEngineParamDetails.stream()
.collect(Collectors.groupingBy(EngineParamDetailPojo::getEngineModelId));
// 批量查询 TC 数据当前批次
List<EngineParamDetailPojo> batchTcData = tcDataQueryService.tcDataSelectAllByproductNumberBatch(batch);
// modelId 分组
Map<String, List<EngineParamDetailPojo>> tcDataMap = batchTcData.stream()
.collect(Collectors.groupingBy(EngineParamDetailPojo::getEngineModelId));
// 处理当前批次机型
for (DataEntryEngineModelPojo engineModelPojo : batch) {
AnalysisModelParamterView analysisModelParamterView = new AnalysisModelParamterView();
analysisModelParamterView.setModelID(engineModelPojo.getId());
analysisModelParamterView.setModelName(engineModelPojo.getModelName());
BeanUtils.copyProperties(engineModelPojo, analysisModelParamterView);
// 获取 EngineParamDetailPojo 列表
List<EngineParamDetailPojo> pojoList = engineParamDetailMap.getOrDefault(engineModelPojo.getId(), Collections.emptyList());
Integer versionNumber = engineModelPojo.getVersionNumber();
List<EngineParamDetailPojo> tcData = tcDataMap.getOrDefault(engineModelPojo.getId(), Collections.emptyList());
pojoList = Stream.concat(pojoList.stream(), tcData.stream())
.filter(x -> Objects.equals(x.getMajorVersion(), versionNumber)) // 过滤版本号
.filter(x -> Objects.nonNull(x.getParameterValue()) && isNumber(x.getParameterValue())) // 过滤非数字
.collect(Collectors.toList());
analysisModelParamterView.setPojos(pojoList);
allAnalysisViews.add(analysisModelParamterView);
// 收集所有参数名
pojoList.stream()
.map(EngineParamDetailPojo::getParameterName)
.forEach(allParamNames::add);
}
batchEngineParamDetails.clear();
batchTcData.clear();
}
AnalysisModelParamterViewAndParam andParam = new AnalysisModelParamterViewAndParam();
andParam.setParamList(new ArrayList<>(allParamNames));
andParam.setPojos(allAnalysisViews);
return andParam;
}
// 分批处理机型 // 分批处理机型
private List<List<DataEntryEngineModelPojo>> splitModelBatch( private List<List<DataEntryEngineModelPojo>> splitModelBatch(
List<DataEntryEngineModelPojo> source, List<DataEntryEngineModelPojo> source,

View File

@ -6,7 +6,7 @@ import com.alibaba.fastjson2.JSON;
import com.definesys.mpaas.query.db.PageQueryResult; import com.definesys.mpaas.query.db.PageQueryResult;
import com.xdap.api.moudle.user.pojo.XdapUsers; import com.xdap.api.moudle.user.pojo.XdapUsers;
import com.xdap.runtime.service.RuntimeAppContextService; import com.xdap.runtime.service.RuntimeAppContextService;
import com.xdap.self_development.config.BusinessDatabase; import com.xdap.self_development.common.BusinessDatabase;
import com.xdap.self_development.controller.form.*; import com.xdap.self_development.controller.form.*;
import com.xdap.self_development.exception.CommonException; import com.xdap.self_development.exception.CommonException;
import com.xdap.self_development.feign.ApaasMyTokenFeign; import com.xdap.self_development.feign.ApaasMyTokenFeign;

View File

@ -1,7 +1,6 @@
package com.xdap.self_development.service.impl; package com.xdap.self_development.service.impl;
import com.xdap.self_development.common.UserPermissionGetter; import com.xdap.self_development.common.BusinessDatabase;
import com.xdap.self_development.config.BusinessDatabase;
import com.xdap.self_development.controller.form.*; import com.xdap.self_development.controller.form.*;
import com.xdap.self_development.exception.CommonException; import com.xdap.self_development.exception.CommonException;
import com.xdap.self_development.pojo.*; import com.xdap.self_development.pojo.*;
@ -103,19 +102,11 @@ public class CommonParameterServiceImpl implements CommonParameterService {
@Override @Override
public List<AnalysisCommonParameters> getAnalysisCommonParameter(String userId) { public List<AnalysisCommonParameters> getAnalysisCommonParameter(String userId) {
List<CommonParameter> commonParameters = bd.getBusinessDatabase() return bd.getBusinessDatabase()
.eq("create_by", userId) .viewQueryMode(true)
.eq("common_type", 2) .view("queryCommon")
.doQuery(CommonParameter.class); .setVar("user_id", userId)
List<String> ids = commonParameters.stream().map(CommonParameter::getId).collect(Collectors.toList()); .doQuery(AnalysisCommonParameters.class);
if (ids.isEmpty()) {
return Collections.emptyList();
}
// 数据处理
List<AnalysisCommonParameters> modelCommonParameters = bd.getBusinessDatabase()
.in("common_id", ids).doQuery(AnalysisCommonParameters.class);
return modelCommonParameters;
} }
@Override @Override

View File

@ -11,8 +11,6 @@ import com.alibaba.fastjson.JSON;
import com.definesys.mpaas.query.MpaasQueryFactory; import com.definesys.mpaas.query.MpaasQueryFactory;
import com.xdap.api.moudle.user.pojo.XdapUsers; import com.xdap.api.moudle.user.pojo.XdapUsers;
import com.xdap.runtime.service.RuntimeAppContextService; import com.xdap.runtime.service.RuntimeAppContextService;
import com.xdap.self_development.common.UserPermissionGetter;
import com.xdap.self_development.config.BusinessDatabase;
import com.xdap.self_development.controller.request.EngineParamDetailExcel; import com.xdap.self_development.controller.request.EngineParamDetailExcel;
import com.xdap.self_development.controller.request.EngineParamDetailRequest; import com.xdap.self_development.controller.request.EngineParamDetailRequest;
import com.xdap.self_development.enums.CurrentNodeEnum; import com.xdap.self_development.enums.CurrentNodeEnum;
@ -33,7 +31,6 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.IOException; import java.io.IOException;
import java.net.URLEncoder; import java.net.URLEncoder;
@ -66,10 +63,6 @@ public class EngineParamDetailServiceImpl implements EngineParamDetailService {
private XdapDeptUsersService xdapDeptUsersService; private XdapDeptUsersService xdapDeptUsersService;
@Autowired @Autowired
private ResponsiblePerService responsiblePerService; private ResponsiblePerService responsiblePerService;
@Autowired
UserPermissionGetter userPermissionGetter;
@Autowired
private RuntimeAppContextService runtimeAppContextService;
private Integer versionNumber = 0; private Integer versionNumber = 0;
private String createdBy = "Excel导入"; private String createdBy = "Excel导入";
@ -423,11 +416,26 @@ public class EngineParamDetailServiceImpl implements EngineParamDetailService {
engineParamDetailDTO.setApprovalId(detailPojo.getApprovalId()); engineParamDetailDTO.setApprovalId(detailPojo.getApprovalId());
engineParamDetailDTOS.add(engineParamDetailDTO); engineParamDetailDTOS.add(engineParamDetailDTO);
} }
// Map<String, List<EngineParamDetailDTO>> valueBySubSysName =
// engineParamDetailDTOS.stream()
// .sorted(Comparator.comparing(EngineParamDetailDTO::getParameterName))
// .collect(Collectors.groupingBy(
// EngineParamDetailDTO::getSubsystemName,
// LinkedHashMap::new,
// Collectors.toList()
// ));
Map<String, List<EngineParamDetailDTO>> valueBySubSysName = return engineParamDetailDTOS.stream()
engineParamDetailDTOS.stream().collect(Collectors.groupingBy(EngineParamDetailDTO::getSubsystemName)); .collect(Collectors.groupingBy(
EngineParamDetailDTO::getSubsystemName,
return valueBySubSysName; TreeMap::new,
Collectors.collectingAndThen(
Collectors.toList(),
list -> list.stream()
.sorted(Comparator.comparing(EngineParamDetailDTO::getParameterName))
.collect(Collectors.toList())
)
));
} }
/** /**

View File

@ -1,21 +1,16 @@
package com.xdap.self_development.service.impl; package com.xdap.self_development.service.impl;
import com.xdap.self_development.config.BusinessDatabase; import com.xdap.self_development.common.BusinessDatabase;
import com.xdap.self_development.controller.request.ModelRolesRequest;
import com.xdap.self_development.pojo.ModelMenuDictionaryPojo; import com.xdap.self_development.pojo.ModelMenuDictionaryPojo;
import com.xdap.self_development.pojo.ModelRolesPojo;
import com.xdap.self_development.pojo.view.MenuListView; import com.xdap.self_development.pojo.view.MenuListView;
import com.xdap.self_development.service.ModelMenuPermissionService; import com.xdap.self_development.service.ModelMenuPermissionService;
import com.xdap.self_development.service.ModelRoleService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.*; import java.util.*;
import java.util.stream.Collectors;
@Slf4j @Slf4j

View File

@ -3,7 +3,7 @@ package com.xdap.self_development.service.impl;
import com.xdap.api.moudle.department.pojo.entity.XdapDepartments; import com.xdap.api.moudle.department.pojo.entity.XdapDepartments;
import com.xdap.api.moudle.user.pojo.XdapUsers; import com.xdap.api.moudle.user.pojo.XdapUsers;
import com.xdap.self_development.config.BusinessDatabase; import com.xdap.self_development.common.BusinessDatabase;
import com.xdap.self_development.controller.request.ModelRolesRequest; import com.xdap.self_development.controller.request.ModelRolesRequest;
import com.xdap.self_development.controller.request.RolePerJoinRequest; import com.xdap.self_development.controller.request.RolePerJoinRequest;
import com.xdap.self_development.controller.request.UserRoleBindingRequest; import com.xdap.self_development.controller.request.UserRoleBindingRequest;
@ -11,7 +11,6 @@ import com.xdap.self_development.enums.ParamPermissionEnum;
import com.xdap.self_development.exception.CommonException; import com.xdap.self_development.exception.CommonException;
import com.xdap.self_development.pojo.*; import com.xdap.self_development.pojo.*;
import com.xdap.self_development.pojo.dto.PageResultDTO; import com.xdap.self_development.pojo.dto.PageResultDTO;
import com.xdap.self_development.pojo.view.MenuListView;
import com.xdap.self_development.pojo.view.MenuParamView; import com.xdap.self_development.pojo.view.MenuParamView;
import com.xdap.self_development.service.ModelMenuPermissionService; import com.xdap.self_development.service.ModelMenuPermissionService;
import com.xdap.self_development.service.ModelRoleService; import com.xdap.self_development.service.ModelRoleService;

View File

@ -2,7 +2,7 @@ package com.xdap.self_development.service.impl;
import com.definesys.mpaas.query.db.PageQueryResult; import com.definesys.mpaas.query.db.PageQueryResult;
import com.xdap.self_development.common.MyPageResult; import com.xdap.self_development.common.MyPageResult;
import com.xdap.self_development.config.BusinessDatabase; import com.xdap.self_development.common.BusinessDatabase;
import com.xdap.self_development.controller.form.ParameterForm; import com.xdap.self_development.controller.form.ParameterForm;
import com.xdap.self_development.controller.form.ParameterPageForm; import com.xdap.self_development.controller.form.ParameterPageForm;
import com.xdap.self_development.controller.form.UpdateParameterForm; import com.xdap.self_development.controller.form.UpdateParameterForm;

View File

@ -7,7 +7,7 @@ import com.xdap.api.moudle.department.pojo.entity.XdapDepartments;
import com.xdap.api.moudle.user.pojo.XdapUsers; import com.xdap.api.moudle.user.pojo.XdapUsers;
import com.xdap.runtime.service.RuntimeDatasourceService; import com.xdap.runtime.service.RuntimeDatasourceService;
import com.xdap.self_development.common.MyResponse; import com.xdap.self_development.common.MyResponse;
import com.xdap.self_development.config.BusinessDatabase; import com.xdap.self_development.common.BusinessDatabase;
import com.xdap.self_development.controller.form.*; import com.xdap.self_development.controller.form.*;
import com.xdap.self_development.exception.CommonException; import com.xdap.self_development.exception.CommonException;
import com.xdap.self_development.listener.PersonReadListener; import com.xdap.self_development.listener.PersonReadListener;
@ -26,6 +26,7 @@ import javax.servlet.http.HttpServletResponse;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.net.URLEncoder; import java.net.URLEncoder;
import java.sql.Timestamp;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
import java.util.ArrayList; import java.util.ArrayList;
@ -60,6 +61,7 @@ public class ResponsiblePersonServiceImpl implements ResponsiblePersonService {
responsiblePerson.setUserId(form.getUserId()); responsiblePerson.setUserId(form.getUserId());
responsiblePerson.setSubsystem(form.getSubsystem()); responsiblePerson.setSubsystem(form.getSubsystem());
responsiblePerson.setPersonLevel(1); responsiblePerson.setPersonLevel(1);
responsiblePerson.setCreationDate(Timestamp.valueOf(LocalDateTime.now()));
bd.getBusinessDatabase().doInsert(responsiblePerson); bd.getBusinessDatabase().doInsert(responsiblePerson);
} }
@ -92,6 +94,7 @@ public class ResponsiblePersonServiceImpl implements ResponsiblePersonService {
.update("user_id", form.getUserId()) .update("user_id", form.getUserId())
.update("department", form.getDepartment()) .update("department", form.getDepartment())
.update("subsystem", form.getSubsystem()) .update("subsystem", form.getSubsystem())
.update("creation_date", Timestamp.valueOf(LocalDateTime.now()))
.doUpdate(ResponsiblePerson.class); .doUpdate(ResponsiblePerson.class);
} }

View File

@ -7,7 +7,7 @@ import com.alibaba.nacos.client.naming.utils.CollectionUtils;
import com.definesys.mpaas.query.MpaasQueryFactory; import com.definesys.mpaas.query.MpaasQueryFactory;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import com.xdap.motor.utils.StringUtils; import com.xdap.motor.utils.StringUtils;
import com.xdap.self_development.config.BusinessDatabase; import com.xdap.self_development.common.BusinessDatabase;
import com.xdap.self_development.controller.request.AnalysisRequest; import com.xdap.self_development.controller.request.AnalysisRequest;
import com.xdap.self_development.controller.request.AnalysisVerRequest; import com.xdap.self_development.controller.request.AnalysisVerRequest;
import com.xdap.self_development.controller.request.ModelComparisonExportRequest; import com.xdap.self_development.controller.request.ModelComparisonExportRequest;
@ -760,175 +760,39 @@ public class TcDataQueryServiceImpl implements TcDataQueryService {
return valueBySubSysName; return valueBySubSysName;
} }
// @Override @Override
// public List<EngineParamDetailPojo> tcDataSelectAllByproductNumberBatch(List<DataEntryEngineModelPojo> engineModelPojos) {
// // 收集所有 productNumber
// Set<String> productNumbers = engineModelPojos.stream()
// .map(DataEntryEngineModelPojo::getProductNumber)
// .filter(ObjectUtils::isNotEmpty)
// .collect(Collectors.toSet());
//
// if (productNumbers.isEmpty()) {
// return Collections.emptyList();
// }
//
// // 一次性查询所有参数模板 TC 参数数据
// List<Parameter> parameters = engineParamDetailService.selectAllAndTcByNewVersion();
// List<Parameter> collect = parameters.stream()
// .filter(x -> "TC分类表".equals(x.getParameterSource()))
// .collect(Collectors.toList());
//
// if (collect.isEmpty()) {
// return Collections.emptyList();
// }
//
// // partsName 分组
// Map<String, List<Parameter>> stringListMap = collect.stream()
// .collect(Collectors.groupingBy(Parameter::getPartsName));
//
// Set<String> partsNames = stringListMap.keySet();
//
// // 一次性查询所有 EnginePartsCollection
// List<EnginePartsCollection> allPartsCollections = bd.getTCDatabase()
// .in("ztj", productNumbers)
// .in("lbjmc", partsNames)
// .doQuery(EnginePartsCollection.class);
//
// // productNumber partsName 分组
// Map<String, Map<String, List<EnginePartsCollection>>> partsCollectionsMap = allPartsCollections.stream()
// .collect(Collectors.groupingBy(
// EnginePartsCollection::getZtj,
// Collectors.groupingBy(EnginePartsCollection::getLbjmc)
// ));
//
// // 收集所有图号
// Set<String> allLbjths = allPartsCollections.stream()
// .map(EnginePartsCollection::getLbjth)
// .filter(ObjectUtils::isNotEmpty)
// .collect(Collectors.toSet());
//
// if (allLbjths.isEmpty()) {
// return Collections.emptyList();
// }
//
// // 一次性查询所有 ClassificationAttribute
// List<ClassificationAttribute> allClassifications = bd.getTCDatabase()
// .in("pitemId", allLbjths)
// .doQuery(ClassificationAttribute.class);
//
// // pitemId 分组
// Map<String, List<ClassificationAttribute>> classificationMap = allClassifications.stream()
// .collect(Collectors.groupingBy(ClassificationAttribute::getPitemId));
//
// // 构建结果
// List<EngineParamDetailPojo> result = new ArrayList<>();
//
// for (DataEntryEngineModelPojo engineModelPojo : engineModelPojos) {
// String productNumber = engineModelPojo.getProductNumber();
// if (ObjectUtils.isEmpty(productNumber)) {
// continue;
// }
//
// Map<String, List<EnginePartsCollection>> partsMap = partsCollectionsMap.get(productNumber);
// if (partsMap == null) {
// continue;
// }
//
// for (String partsName : partsNames) {
// List<Parameter> parameterList = stringListMap.get(partsName);
// if (parameterList == null) {
// continue;
// }
//
// Set<String> parameterNameSet = parameterList.stream()
// .map(Parameter::getParameterName).collect(Collectors.toSet());
//
// List<EnginePartsCollection> partsCollections = partsMap.get(partsName);
// if (partsCollections == null) {
// continue;
// }
//
// List<String> lbjths = partsCollections.stream()
// .map(EnginePartsCollection::getLbjth)
// .filter(ObjectUtils::isNotEmpty)
// .collect(Collectors.toList());
//
// for (String lbjth : lbjths) {
// List<ClassificationAttribute> classifications = classificationMap.get(lbjth);
// if (classifications == null) {
// continue;
// }
//
// for (ClassificationAttribute classificationAttribute : classifications) {
// if (parameterNameSet.contains(classificationAttribute.getIdattrtbutehame())) {
// EngineParamDetailPojo engineParamDetailPojo = new EngineParamDetailPojo();
// engineParamDetailPojo.setEngineModelId(engineModelPojo.getId());
// engineParamDetailPojo.setPartsName(partsName);
// engineParamDetailPojo.setParameterName(classificationAttribute.getIdattrtbutehame());
// engineParamDetailPojo.setParameterValue(classificationAttribute.getFieldvalue());
// result.add(engineParamDetailPojo);
// }
// }
// }
// }
// }
//
// return result;
// }
public List<EngineParamDetailPojo> tcDataSelectAllByproductNumberBatch(List<DataEntryEngineModelPojo> engineModelPojos) { public List<EngineParamDetailPojo> tcDataSelectAllByproductNumberBatch(List<DataEntryEngineModelPojo> engineModelPojos) {
if (CollectionUtils.isEmpty(engineModelPojos)) {
return Collections.emptyList();
}
// 收集所有 productNumber // 收集所有 productNumber
Set<String> productNumbers = engineModelPojos.stream() Set<String> productNumbers = engineModelPojos.stream()
.map(DataEntryEngineModelPojo::getProductNumber) .map(DataEntryEngineModelPojo::getProductNumber)
.filter(Objects::nonNull) .filter(ObjectUtils::isNotEmpty)
.filter(s -> !s.isEmpty())
.collect(Collectors.toSet()); .collect(Collectors.toSet());
if (productNumbers.isEmpty()) { if (productNumbers.isEmpty()) {
return Collections.emptyList(); return Collections.emptyList();
} }
List<Parameter> tcParameters = bd.getBusinessDatabase() // 一次性查询所有参数模板 TC 参数数据
.viewQueryMode(true) List<Parameter> parameters = engineParamDetailService.selectAllAndTcByNewVersion();
.view("selectTcParameter") List<Parameter> collect = parameters.stream()
.doQuery(Parameter.class); .filter(x -> "TC分类表".equals(x.getParameterSource()))
if (CollectionUtils.isEmpty(tcParameters)) { .collect(Collectors.toList());
if (collect.isEmpty()) {
return Collections.emptyList(); return Collections.emptyList();
} }
Set<String> allValidParamNames = tcParameters.stream() // partsName 分组
.map(Parameter::getParameterName) Map<String, List<Parameter>> stringListMap = collect.stream()
.collect(Collectors.toSet()); .collect(Collectors.groupingBy(Parameter::getPartsName));
Map<String, Set<String>> partsName2ParamNameSet = tcParameters.stream() Set<String> partsNames = stringListMap.keySet();
.collect(Collectors.groupingBy(
Parameter::getPartsName,
Collectors.mapping(Parameter::getParameterName, Collectors.toSet())
));
Set<String> partsNames = partsName2ParamNameSet.keySet(); // 一次性查询所有 EnginePartsCollection
List<EnginePartsCollection> allPartsCollections = bd.getTCDatabase()
CompletableFuture<List<EnginePartsCollection>> partsCollectionFuture =
CompletableFuture.supplyAsync(() -> bd.getTCDatabase()
.in("ztj", productNumbers) .in("ztj", productNumbers)
.in("lbjmc", partsNames) .in("lbjmc", partsNames)
.doQuery(EnginePartsCollection.class)); .doQuery(EnginePartsCollection.class);
List<EnginePartsCollection> allPartsCollections;
try {
allPartsCollections = partsCollectionFuture.get();
} catch (InterruptedException | ExecutionException e) {
// 补充异常处理避免线程中断导致请求失败
Thread.currentThread().interrupt();
return Collections.emptyList();
}
if (CollectionUtils.isEmpty(allPartsCollections)) {
return Collections.emptyList();
}
// productNumber partsName 分组 // productNumber partsName 分组
Map<String, Map<String, List<EnginePartsCollection>>> partsCollectionsMap = allPartsCollections.stream() Map<String, Map<String, List<EnginePartsCollection>>> partsCollectionsMap = allPartsCollections.stream()
@ -940,26 +804,20 @@ public class TcDataQueryServiceImpl implements TcDataQueryService {
// 收集所有图号 // 收集所有图号
Set<String> allLbjths = allPartsCollections.stream() Set<String> allLbjths = allPartsCollections.stream()
.map(EnginePartsCollection::getLbjth) .map(EnginePartsCollection::getLbjth)
.filter(Objects::nonNull) .filter(ObjectUtils::isNotEmpty)
.filter(s -> !s.isEmpty())
.collect(Collectors.toSet()); .collect(Collectors.toSet());
if (allLbjths.isEmpty()) { if (allLbjths.isEmpty()) {
return Collections.emptyList(); return Collections.emptyList();
} }
List<List<String>> lbjthBatches = splitBatch(allLbjths, lbjthBatchSize); // 一次性查询所有 ClassificationAttribute
List<ClassificationAttribute> allClassifications = new ArrayList<>(); List<ClassificationAttribute> allClassifications = bd.getTCDatabase()
for (List<String> batch : lbjthBatches) { .in("pitemId", allLbjths)
allClassifications.addAll( .doQuery(ClassificationAttribute.class);
bd.getTCDatabase()
.in("pitemId", batch)
.doQuery(ClassificationAttribute.class)
);
}
// pitemId 分组
Map<String, List<ClassificationAttribute>> classificationMap = allClassifications.stream() Map<String, List<ClassificationAttribute>> classificationMap = allClassifications.stream()
.filter(attr -> allValidParamNames.contains(attr.getIdattrtbutehame()))
.collect(Collectors.groupingBy(ClassificationAttribute::getPitemId)); .collect(Collectors.groupingBy(ClassificationAttribute::getPitemId));
// 构建结果 // 构建结果
@ -967,40 +825,40 @@ public class TcDataQueryServiceImpl implements TcDataQueryService {
for (DataEntryEngineModelPojo engineModelPojo : engineModelPojos) { for (DataEntryEngineModelPojo engineModelPojo : engineModelPojos) {
String productNumber = engineModelPojo.getProductNumber(); String productNumber = engineModelPojo.getProductNumber();
if (Objects.isNull(productNumber) || productNumber.isEmpty()) { if (ObjectUtils.isEmpty(productNumber)) {
continue; continue;
} }
Map<String, List<EnginePartsCollection>> partsMap = partsCollectionsMap.get(productNumber); Map<String, List<EnginePartsCollection>> partsMap = partsCollectionsMap.get(productNumber);
if (CollectionUtils.isEmpty((Collection) partsMap)) { if (partsMap == null) {
continue; continue;
} }
for (String partsName : partsMap.keySet()) { for (String partsName : partsNames) {
Set<String> parameterNameSet = partsName2ParamNameSet.get(partsName); List<Parameter> parameterList = stringListMap.get(partsName);
if (CollectionUtils.isEmpty(parameterNameSet)) { if (parameterList == null) {
continue; continue;
} }
Set<String> parameterNameSet = parameterList.stream()
.map(Parameter::getParameterName).collect(Collectors.toSet());
List<EnginePartsCollection> partsCollections = partsMap.get(partsName); List<EnginePartsCollection> partsCollections = partsMap.get(partsName);
if (CollectionUtils.isEmpty(partsCollections)) { if (partsCollections == null) {
continue; continue;
} }
// 合并Stream操作减少中间对象创建
List<String> lbjths = partsCollections.stream() List<String> lbjths = partsCollections.stream()
.map(EnginePartsCollection::getLbjth) .map(EnginePartsCollection::getLbjth)
.filter(Objects::nonNull) .filter(ObjectUtils::isNotEmpty)
.filter(s -> !s.isEmpty())
.collect(Collectors.toList()); .collect(Collectors.toList());
for (String lbjth : lbjths) { for (String lbjth : lbjths) {
List<ClassificationAttribute> classifications = classificationMap.get(lbjth); List<ClassificationAttribute> classifications = classificationMap.get(lbjth);
if (CollectionUtils.isEmpty(classifications)) { if (classifications == null) {
continue; continue;
} }
// 内层循环利用HashSet的O(1) contains
for (ClassificationAttribute classificationAttribute : classifications) { for (ClassificationAttribute classificationAttribute : classifications) {
if (parameterNameSet.contains(classificationAttribute.getIdattrtbutehame())) { if (parameterNameSet.contains(classificationAttribute.getIdattrtbutehame())) {
EngineParamDetailPojo engineParamDetailPojo = new EngineParamDetailPojo(); EngineParamDetailPojo engineParamDetailPojo = new EngineParamDetailPojo();

View File

@ -3,7 +3,7 @@ package com.xdap.self_development.service.impl;
import com.alibaba.fastjson2.JSON; import com.alibaba.fastjson2.JSON;
import com.definesys.mpaas.query.db.PageQueryResult; import com.definesys.mpaas.query.db.PageQueryResult;
import com.xdap.api.moudle.user.pojo.XdapUsers; import com.xdap.api.moudle.user.pojo.XdapUsers;
import com.xdap.self_development.config.BusinessDatabase; import com.xdap.self_development.common.BusinessDatabase;
import com.xdap.self_development.controller.form.*; import com.xdap.self_development.controller.form.*;
import com.xdap.self_development.exception.CommonException; import com.xdap.self_development.exception.CommonException;
import com.xdap.self_development.pojo.*; import com.xdap.self_development.pojo.*;
@ -193,6 +193,75 @@ public class TemplateApprovalServiceImpl implements TemplateApprovalService {
return flow.getId(); return flow.getId();
} }
@Override
@Transactional(rollbackFor = Exception.class)
public void continueApproval(String flowId, String userId) {
ApprovalFlow flow = bd.getBusinessDatabase()
.eq("id", flowId)
.doQueryFirst(ApprovalFlow.class);
if (flow == null) {
throw new CommonException("流程不存在");
}
// 清除原流程节点的所有待办
bd.getBusinessDatabase()
.eq("document_no", flow.getId())
.update("is_delete", 1)
.update("last_update_date", Timestamp.valueOf(LocalDateTime.now()))
.doUpdate(TodoTaskPojo.class);
// 修改非进行中的流程为进行中
if (!Objects.equals(flow.getFlowStatus(), "APPROVING")) {
ApprovalConfigPojo firstNode = bd.getBusinessDatabase()
.eq("approval_id", flow.getId())
.orderBy("node_order", "asc")
.doQueryFirst(ApprovalConfigPojo.class);
flow.setPreNode(-1);
flow.setFlowStatus("APPROVING");
flow.setCurrentNode(firstNode.getNodeOrder());
bd.getBusinessDatabase()
.eq("id", flow.getId())
.update("flow_status", "APPROVING")
.update("current_node", firstNode.getNodeOrder())
.update("pre_node", -1)
.doUpdate(ApprovalFlow.class);
}
// 获取当前节点和模板
Template template = bd.getBusinessDatabase()
.eq("id", flow.getTemplateId())
.doQueryFirst(Template.class);
ApprovalConfigPojo currentNode = bd.getBusinessDatabase()
.eq("approval_id", flow.getId())
.eq("node_order", flow.getCurrentNode())
.doQueryFirst(ApprovalConfigPojo.class);
// 添加新待办
List<TodoTaskPojo> list = new ArrayList<>();
for (String person : JSON.parseArray(currentNode.getAssignees()).toJavaList(String.class)) {
TodoTaskPojo todoTask = new TodoTaskPojo();
todoTask.setCreatedById(userId);
todoTask.setCreatedBy(xdapDeptUsersService.selectUserByID(userId).getUsername());
todoTask.setCurrentNode(currentNode.getNodeName());
todoTask.setDataType("模板审核");
todoTask.setDocumentNo(flow.getId());
todoTask.setCreationDate(Timestamp.valueOf(LocalDateTime.now()));
todoTask.setIsDelete(0);
todoTask.setModelId(template.getId());
todoTask.setModelName(template.getTemplateName());
todoTask.setProcessTitle(flow.getProcessTitle());
todoTask.setStatusCode(flow.getFlowStatus());
todoTask.setVersionNumber(template.getVersion());
todoTask.setOwnerId(person);
todoTask.setCurrentProcessor(JSON.toJSONString(currentNode.getAssignees()));
list.add(todoTask);
}
bd.getBusinessDatabase().doBatchInsert(list);
myself.updateTasks(flow, currentNode.getNodeName(), 0, currentNode);
}
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void directSendingApproval(String templateId, String userId) { public void directSendingApproval(String templateId, String userId) {
@ -530,7 +599,7 @@ public class TemplateApprovalServiceImpl implements TemplateApprovalService {
.update("published_time", Timestamp.valueOf(LocalDateTime.now())) .update("published_time", Timestamp.valueOf(LocalDateTime.now()))
.doUpdate(Template.class); .doUpdate(Template.class);
// 待办环节修改 // 待办环节修改
myself.updateTasks(flow, "已完成", 0, nextNode); myself.updateTasks(flow, "已完成", 0, null);
// 更新机型版本 // 更新机型版本
// dataEntryEngineModelService.updateModelForNewVersion(); // dataEntryEngineModelService.updateModelForNewVersion();
} else { } else {

View File

@ -6,7 +6,7 @@ import com.alibaba.excel.write.metadata.WriteSheet;
import com.alibaba.excel.write.style.column.LongestMatchColumnWidthStyleStrategy; import com.alibaba.excel.write.style.column.LongestMatchColumnWidthStyleStrategy;
import com.definesys.mpaas.query.db.PageQueryResult; import com.definesys.mpaas.query.db.PageQueryResult;
import com.xdap.self_development.common.MyResponse; import com.xdap.self_development.common.MyResponse;
import com.xdap.self_development.config.BusinessDatabase; import com.xdap.self_development.common.BusinessDatabase;
import com.xdap.self_development.controller.form.*; import com.xdap.self_development.controller.form.*;
import com.xdap.self_development.exception.CommonException; import com.xdap.self_development.exception.CommonException;
import com.xdap.self_development.listener.SheetDataListener; import com.xdap.self_development.listener.SheetDataListener;

View File

@ -4,13 +4,12 @@ import com.alibaba.fastjson2.JSON;
import com.definesys.mpaas.query.MpaasQueryFactory; import com.definesys.mpaas.query.MpaasQueryFactory;
import com.definesys.mpaas.query.db.PageQueryResult; import com.definesys.mpaas.query.db.PageQueryResult;
import com.xdap.api.moudle.user.pojo.XdapUsers; import com.xdap.api.moudle.user.pojo.XdapUsers;
import com.xdap.self_development.config.BusinessDatabase; import com.xdap.self_development.common.BusinessDatabase;
import com.xdap.self_development.controller.request.TodoReturnRequest; import com.xdap.self_development.controller.request.TodoReturnRequest;
import com.xdap.self_development.controller.request.TodoTaskRequest; import com.xdap.self_development.controller.request.TodoTaskRequest;
import com.xdap.self_development.controller.request.YcGetTodoTaskRequest; import com.xdap.self_development.controller.request.YcGetTodoTaskRequest;
import com.xdap.self_development.enums.CurrentNodeEnum; import com.xdap.self_development.enums.CurrentNodeEnum;
import com.xdap.self_development.enums.DistributeStatusEnum; import com.xdap.self_development.enums.DistributeStatusEnum;
import com.xdap.self_development.exception.CommonException;
import com.xdap.self_development.pojo.*; import com.xdap.self_development.pojo.*;
import com.xdap.self_development.pojo.dto.*; import com.xdap.self_development.pojo.dto.*;
import com.xdap.self_development.service.DataEntryEngineModelService; import com.xdap.self_development.service.DataEntryEngineModelService;

View File

@ -382,9 +382,120 @@ create table ads_prd_f_tc_flsxb(
FIELDVALUE VARCHAR(100) comment '零部件属性值' FIELDVALUE VARCHAR(100) comment '零部件属性值'
) comment 'tc分类属性表'; ) comment 'tc分类属性表';
-- 插入数据到ads_prd_f_yfsjglpt_fdjlbjcjb表 -- test.data_entry_engine_model definition
drop table if exists data_entry_engine_model;
CREATE TABLE `data_entry_engine_model` (
`id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT 'ID',
`yc_or_oth` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '本品或竞品',
`model_name` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '产品型号(全称)',
`model_name_simple` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '产品型号简称',
`product_number` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '产品编号',
`plate` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '板块',
`platform` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '平台',
`series` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '系列',
`market_segment` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '细分市场',
`project_name` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '项目名称',
`project_number` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '项目编号',
`brand` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '品牌',
`production_date` date DEFAULT NULL COMMENT '生产日期',
`parameter_num` int(11) DEFAULT NULL COMMENT '标准参数数量',
`maintained_parameter_num` int(11) DEFAULT NULL COMMENT '已维护参数数量',
`responsible_person_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '责任人表ID',
`distribute_status` tinyint(4) DEFAULT NULL COMMENT '分发状态',
`version_number` int(11) DEFAULT NULL COMMENT '版本',
`is_delete` tinyint(4) DEFAULT NULL COMMENT '是否删除',
`created_by` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '创建人',
`creation_date` datetime DEFAULT NULL COMMENT '创建时间',
`last_updated_by` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '最后更新人',
`last_update_date` datetime DEFAULT NULL COMMENT '最后更新时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='发动机型号数据表';
-- test.engine_param_detail definition
drop table if exists engine_param_detail;
CREATE TABLE `engine_param_detail` (
`id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT 'ID',
`parameter_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '参数模板表id',
`engine_model_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '发动机型号表id',
`subsystem_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '子系统',
`parameter_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '类型',
`parameter_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '参数名称',
`parameter_value` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '参数值',
`responsible_person_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '责任人',
`department` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '填写部门',
`filled_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '填写人',
`major_version` int(11) DEFAULT NULL COMMENT '大版本(审核通过后变更的)',
`minor_version` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '小版本(控制是否可以审核)',
`version_status` int(11) DEFAULT NULL COMMENT '版本状态(0已通过1草稿审核中3已撤回4拒绝)',
`approval_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '关联的审批流程',
`before_param_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '上个版本参数ID',
`is_delete` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '是否删除',
`operation` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '参数的操作(新增,修改,删除)',
`created_by` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '创建人',
`created_date` datetime DEFAULT NULL COMMENT '创建时间',
`last_updated_by` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '最后更新人',
`last_updated_date` datetime DEFAULT NULL COMMENT '最后更新时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='参数详情';
drop table if exists data_change_comment;
CREATE TABLE data_change_comment (
id VARCHAR(255) PRIMARY KEY COMMENT 'ID',
param_detail_id VARCHAR(255) COMMENT '',
engine_model_id VARCHAR(255) COMMENT '',
subsystem_name VARCHAR(255) COMMENT '',
parameter_type VARCHAR(255) COMMENT '',
parts_name VARCHAR(255) COMMENT '零部件',
parameter_name VARCHAR(255) COMMENT '',
parameter_value VARCHAR(255) COMMENT '审批中的值',
change_comment VARCHAR(255) COMMENT '变动说明',
unit VARCHAR(255) COMMENT '变动说明',
created_by VARCHAR(255) COMMENT '创建人',
creation_date DATETIME COMMENT '创建时间',
last_updated_by VARCHAR(255) COMMENT '最后更新人',
last_update_date DATETIME COMMENT '最后更新时间'
) COMMENT '数据变更评论表';
drop table if exists engine_review_list;
CREATE TABLE engine_review_list (
id VARCHAR(255) PRIMARY KEY COMMENT 'ID',
process_topic VARCHAR(255) COMMENT '流程主题',
yc_or_oth VARCHAR(255) COMMENT '本品或竞品',
model_id VARCHAR(255) COMMENT '机型ID',
model_name VARCHAR(255) COMMENT '产品型号',
status_code INT COMMENT '状态代号',
subsystem_name VARCHAR(255) COMMENT '子系统',
applicant VARCHAR(255) COMMENT '申请人ID',
status_description VARCHAR(255) COMMENT '当前状态',
approver_persons VARCHAR(255) COMMENT '当前审批人',
node_name VARCHAR(255) COMMENT '当前节点',
review_comment TEXT COMMENT '提交说明',
created_by VARCHAR(255) COMMENT '创建人',
creation_date DATETIME COMMENT '创建时间',
last_updated_by VARCHAR(255) COMMENT '最后更新人',
last_update_date DATETIME COMMENT '最后更新时间',
return_num INT COMMENT '退回标记',
pre_node INT COMMENT '前一个节点'
) COMMENT '发动机评审列表表';
drop table if exists param_approval_record;
CREATE TABLE param_approval_record (
id VARCHAR(255) PRIMARY KEY COMMENT 'ID',
approval_id VARCHAR(255) COMMENT '流程ID',
node_name VARCHAR(255) COMMENT '环节名称',
assignee VARCHAR(255) COMMENT '处理人',
operator VARCHAR(255) COMMENT '操作',
operate_time DATETIME COMMENT '操作时间',
approval_comment TEXT COMMENT '审批说明',
node_order INT COMMENT '环节顺序',
created_by VARCHAR(255) COMMENT '创建人',
creation_date DATETIME COMMENT '创建时间',
last_updated_by VARCHAR(255) COMMENT '最后更新人',
last_update_date DATETIME COMMENT '最后更新时间',
approval_level INT COMMENT ''
) COMMENT '参数审批记录表';
DELETE DELETE
FROM yfsjglpt_model_template; FROM yfsjglpt_model_template;
DELETE DELETE