上线版本7.0
This commit is contained in:
parent
20d92d7153
commit
291c7abda2
@ -154,7 +154,9 @@ public class ParameterValueCalculationTimer {
|
||||
String key = modelId + "|" + paramId + "|" + paramName;
|
||||
|
||||
// 跳过已成功计算的
|
||||
if (computedKeys.contains(key)) continue;
|
||||
if (computedKeys.contains(key)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
try {
|
||||
String replacedFormula = replaceParametersInFormula(
|
||||
@ -274,7 +276,9 @@ public class ParameterValueCalculationTimer {
|
||||
}
|
||||
|
||||
private boolean isNumeric(String str) {
|
||||
if (str == null || str.isEmpty()) return false;
|
||||
if (str == null || str.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
Double.parseDouble(str);
|
||||
return true;
|
||||
|
||||
@ -25,7 +25,9 @@ public class PersonReadListener implements ReadListener<ResponsiblePersonPojo> {
|
||||
|
||||
@Override
|
||||
public void invoke(ResponsiblePersonPojo responsiblePerson, AnalysisContext analysisContext) {
|
||||
if (analysisContext.readRowHolder().getRowIndex() == 1) return;
|
||||
if (analysisContext.readRowHolder().getRowIndex() == 1) {
|
||||
return;
|
||||
}
|
||||
if (
|
||||
responsiblePerson.getDepartment() == null ||
|
||||
responsiblePerson.getUsername() == null ||
|
||||
|
||||
@ -51,7 +51,9 @@ public class SheetDataListener implements ReadListener<ParameterPojo> {
|
||||
public void invoke(ParameterPojo data, AnalysisContext context) {
|
||||
log.info("开始解析数据行: {}", context.readRowHolder().getRowIndex());
|
||||
log.info("解析到一条数据: {}", data);
|
||||
if (context.readRowHolder().getRowIndex() == 1) return;
|
||||
if (context.readRowHolder().getRowIndex() == 1) {
|
||||
return;
|
||||
}
|
||||
// 参数校验
|
||||
if (data == null) {
|
||||
return;
|
||||
|
||||
@ -108,7 +108,7 @@ public class AnalysisCommonParametersServiceImpl implements AnalysisCommonParame
|
||||
// 按权限过滤
|
||||
List<ParameterPojo> parameters = engineParamDetailService.selectParamByIsUserId(modelParams, userId);
|
||||
return parameters.stream()
|
||||
.filter(x -> x.getUnit() != null && !x.getUnit().equals("/"))
|
||||
.filter(x -> x.getUnit() != null && !"/".equals(x.getUnit()))
|
||||
.map(ParameterPojo::getParameterName).distinct().collect(Collectors.toList());
|
||||
}
|
||||
|
||||
|
||||
@ -425,8 +425,8 @@ public class DataEntryEngineModelServiceImpl implements DataEntryEngineModelServ
|
||||
detailPojo.setParameterName(parameter.getParameterName());
|
||||
detailPojo.setParameterSource(parameter.getParameterSource());
|
||||
detailPojo.setParameterType(parameter.getParameterType());
|
||||
detailPojo.setIsDistributedFilled(parameter.getParameterSource().equals("数据平台手工录入") ? 0 : 2);
|
||||
detailPojo.setIsDistributedRes(parameter.getParameterSource().equals("数据平台手工录入") ? 0 : 2);
|
||||
detailPojo.setIsDistributedFilled("数据平台手工录入".equals(parameter.getParameterSource()) ? 0 : 2);
|
||||
detailPojo.setIsDistributedRes("数据平台手工录入".equals(parameter.getParameterSource()) ? 0 : 2);
|
||||
detailPojo.setResponsiblePersonId(null);
|
||||
detailPojo.setFilledBy(null);
|
||||
detailPojo.setMajorVersion(model.getVersionNumber());
|
||||
@ -520,8 +520,8 @@ public class DataEntryEngineModelServiceImpl implements DataEntryEngineModelServ
|
||||
detailPojo.setParameterName(parameter.getParameterName());
|
||||
detailPojo.setParameterSource(parameter.getParameterSource());
|
||||
detailPojo.setParameterType(parameter.getParameterType());
|
||||
detailPojo.setIsDistributedFilled(parameter.getParameterSource().equals("数据平台手工录入") ? 0 : 2);
|
||||
detailPojo.setIsDistributedRes(parameter.getParameterSource().equals("数据平台手工录入") ? 0 : 2);
|
||||
detailPojo.setIsDistributedFilled("数据平台手工录入".equals(parameter.getParameterSource()) ? 0 : 2);
|
||||
detailPojo.setIsDistributedRes("数据平台手工录入".equals(parameter.getParameterSource()) ? 0 : 2);
|
||||
detailPojo.setResponsiblePersonId(null);
|
||||
detailPojo.setFilledBy(null);
|
||||
detailPojo.setMajorVersion(model.getVersionNumber());
|
||||
|
||||
@ -154,7 +154,7 @@ public class EngineParamDetailServiceImpl implements EngineParamDetailService {
|
||||
String manufacturerName = dataEntryEngineModelPojo.getManufacturerName();
|
||||
String manufacturerAbbreviation = dataEntryEngineModelPojo.getManufacturerAbbreviation();
|
||||
Set<String> strings = new HashSet<>();
|
||||
if (dataEntryEngineModelPojo.getYcOrOth().equals("玉柴")) {
|
||||
if ("玉柴".equals(dataEntryEngineModelPojo.getYcOrOth())) {
|
||||
strings.add("状态代号:" + productNumber);
|
||||
} else {
|
||||
strings.add("产品编号:" + productNumber);
|
||||
@ -253,7 +253,7 @@ public class EngineParamDetailServiceImpl implements EngineParamDetailService {
|
||||
String manufacturerName = dataEntryEngineModelPojo.getManufacturerName();
|
||||
String manufacturerAbbreviation = dataEntryEngineModelPojo.getManufacturerAbbreviation();
|
||||
Set<String> strings = new HashSet<>();
|
||||
if (dataEntryEngineModelPojo.getYcOrOth().equals("玉柴")) {
|
||||
if ("玉柴".equals(dataEntryEngineModelPojo.getYcOrOth())) {
|
||||
strings.add("状态代号:" + productNumber);
|
||||
} else {
|
||||
strings.add("产品编号:" + productNumber);
|
||||
@ -719,7 +719,9 @@ public class EngineParamDetailServiceImpl implements EngineParamDetailService {
|
||||
.eq("owner_id", filledBy)
|
||||
.eq("process_title", modelPojo.getModelName() + "-" + "填写参数任务")
|
||||
.doQuery(TodoTaskPojo.class);
|
||||
if (!filledTodos.isEmpty()) continue;
|
||||
if (!filledTodos.isEmpty()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
TodoTaskPojo todoTask = new TodoTaskPojo();
|
||||
todoTask.setCreatedById(userID);
|
||||
@ -1094,7 +1096,9 @@ public class EngineParamDetailServiceImpl implements EngineParamDetailService {
|
||||
@Override
|
||||
@Transactional
|
||||
public void updateDept(EngineDeptUpdateDTO engineDeptUpdateDTO) {
|
||||
if (engineDeptUpdateDTO.getList().isEmpty()) throw new CommonException("部门信息不能为空");
|
||||
if (engineDeptUpdateDTO.getList().isEmpty()) {
|
||||
throw new CommonException("部门信息不能为空");
|
||||
}
|
||||
|
||||
// 检查机型
|
||||
DataEntryEngineModelPojo model = bd.getBusinessDatabase()
|
||||
|
||||
@ -117,7 +117,7 @@ public class EngineReviewListServiceImpl implements EngineReviewListService {
|
||||
List<ParamApprovalRecordPojo> paramApprovalRecordPojos = bd.getBusinessDatabase()
|
||||
.eq("approval_id", approvalId)
|
||||
.doQuery(ParamApprovalRecordPojo.class);
|
||||
if (paramApprovalRecordPojos.stream().anyMatch(x -> x.getOperator().equals("同意"))) {
|
||||
if (paramApprovalRecordPojos.stream().anyMatch(x -> "同意".equals(x.getOperator()))) {
|
||||
b = false;
|
||||
}
|
||||
if (b) {
|
||||
|
||||
@ -207,7 +207,7 @@ public class ModelRoleServiceImpl implements ModelRoleService {
|
||||
.eq("is_enabled", 1)
|
||||
.eq("id", roleID)
|
||||
.doQueryFirst(ModelRolesPojo.class);
|
||||
if (ObjectUtils.isNotEmpty(modelRolesPojos) && (modelRolesPojos.getRoleCode().equals("super_admin"))) {
|
||||
if (ObjectUtils.isNotEmpty(modelRolesPojos) && ("super_admin".equals(modelRolesPojos.getRoleCode()))) {
|
||||
return Collections.singletonList(new MenuParamView(roleID, "", "", "", "", 1));
|
||||
}
|
||||
ArrayList<MenuParamView> menuParamViews = new ArrayList<>();
|
||||
@ -366,7 +366,9 @@ public class ModelRoleServiceImpl implements ModelRoleService {
|
||||
String comp = Optional.ofNullable(pojo.getPartsName()).orElse("/");
|
||||
|
||||
Map<String, Set<String>> sysMap = permissionIndex.get(cat);
|
||||
if (sysMap == null) return false;
|
||||
if (sysMap == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// 1. 检查是否有 cat/*/* (即 parts.length == 1)
|
||||
if (sysMap.containsKey("*")) {
|
||||
|
||||
@ -139,6 +139,7 @@ public class ParameterServiceImpl implements ParameterService {
|
||||
* @param benchmark 模板基准信息
|
||||
* @return void
|
||||
*/
|
||||
@Override
|
||||
public void validateTemplateStatus(TemplateBenchmark benchmark) {
|
||||
// 当前修改的模板不为最新版
|
||||
if (!Objects.equals(benchmark.getLastTemplate().getId(), benchmark.getBaseTemplate().getId())) {
|
||||
@ -281,6 +282,7 @@ public class ParameterServiceImpl implements ParameterService {
|
||||
* @param isLastComplete 是否最后完成
|
||||
* @return 参数处理结果
|
||||
*/
|
||||
@Override
|
||||
public ParameterProcessingResult processParameters(
|
||||
List<ParameterForm> parameterForms,
|
||||
List<ParameterPojo> existingParameters,
|
||||
|
||||
@ -385,22 +385,26 @@ public class ResponsiblePersonServiceImpl implements ResponsiblePersonService {
|
||||
XdapDepartments xdapDepartments = bd.getSystemDatabase()
|
||||
.eq("name", "研发总院")
|
||||
.doQueryFirst(XdapDepartments.class);
|
||||
if (xdapDepartments == null) return xdapUserView;
|
||||
if (xdapDepartments == null) {
|
||||
return xdapUserView;
|
||||
}
|
||||
XdapDepartments currentDept = bd.getSystemDatabase()
|
||||
.eq("name", department)
|
||||
.eq("parent_id", xdapDepartments.getId())
|
||||
.doQueryFirst(XdapDepartments.class);
|
||||
|
||||
if (currentDept != null)
|
||||
if (currentDept != null) {
|
||||
xdapUserView.setDepartmentId(currentDept.getId());
|
||||
}
|
||||
if (userAccount != null) {
|
||||
XdapUsers currentUser = bd.getSystemDatabase()
|
||||
.eq("user_number", userAccount)
|
||||
.eq("username", username)
|
||||
.eq("exit_status", "ENABLE")
|
||||
.doQueryFirst(XdapUsers.class);
|
||||
if (currentUser != null)
|
||||
if (currentUser != null) {
|
||||
xdapUserView.setUserId(currentUser.getId());
|
||||
}
|
||||
} else {
|
||||
List<XdapUsers> xdapUsers = bd.getSystemDatabase()
|
||||
.eq("username", username)
|
||||
@ -423,7 +427,9 @@ public class ResponsiblePersonServiceImpl implements ResponsiblePersonService {
|
||||
XdapDepartments currentDept = bd.getSystemDatabase()
|
||||
.eq("name", "研发总院")
|
||||
.doQueryFirst(XdapDepartments.class);
|
||||
if (currentDept == null) return Collections.emptyList();
|
||||
if (currentDept == null) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return bd.getSystemDatabase()
|
||||
.eq("parent_id", currentDept.getId())
|
||||
.doQuery(XdapDepartments.class);
|
||||
|
||||
@ -799,7 +799,9 @@ public class TcDataQueryServiceImpl implements TcDataQueryService {
|
||||
// .filter(Objects::nonNull) // 增加null过滤
|
||||
.filter(pojo -> subsystemParts.stream().anyMatch(part -> {
|
||||
String[] parts = part.split("-");
|
||||
if (parts.length != 2) return false;
|
||||
if (parts.length != 2) {
|
||||
return false;
|
||||
}
|
||||
String subsystem = parts[0];
|
||||
String partsName = parts[1];
|
||||
|
||||
|
||||
@ -221,7 +221,7 @@ public class TemplateApprovalServiceImpl implements TemplateApprovalService {
|
||||
throw new CommonException("流程不存在");
|
||||
}
|
||||
|
||||
if (flow.getFlowStatus().equals("APPROVING")) {
|
||||
if ("APPROVING".equals(flow.getFlowStatus())) {
|
||||
throw new CommonException("流程正在审批中");
|
||||
}
|
||||
|
||||
|
||||
@ -62,6 +62,10 @@ public class TemplateServiceImpl implements TemplateService {
|
||||
.like("template_name", form.getTemplateName())
|
||||
.doPageQuery(form.getPageNumber(), form.getPageSize(), TemplatePojo.class);
|
||||
result.getResult().forEach(templatePojo -> {
|
||||
if (Objects.equals(templatePojo.getCreateBy(), "超级管理员")) {
|
||||
templatePojo.setCreateBy("超级管理员");
|
||||
return;
|
||||
}
|
||||
XdapUsers user = bd.getSystemDatabase()
|
||||
.eq("id", templatePojo.getCreateBy())
|
||||
.doQueryFirst(XdapUsers.class);
|
||||
@ -508,7 +512,7 @@ public class TemplateServiceImpl implements TemplateService {
|
||||
}
|
||||
|
||||
// 返回问题
|
||||
if (problems.getHasImported().toString().equals("已完成导入:无")) {
|
||||
if ("已完成导入:无".equals(problems.getHasImported().toString())) {
|
||||
problems.setHasImported(new StringBuilder("已完成导入:"));
|
||||
problems.getHasImported().append(templateName);
|
||||
} else {
|
||||
|
||||
@ -232,7 +232,9 @@ public class TodoTaskServiceImpl implements TodoTaskService {
|
||||
.eq("owner_id", resId)
|
||||
.eq("process_title", model.getModelName() + "-" + "分发参数填写人任务")
|
||||
.doQuery(TodoTaskPojo.class);
|
||||
if (!resTodos.isEmpty()) continue;
|
||||
if (!resTodos.isEmpty()) {
|
||||
continue;
|
||||
}
|
||||
// 没有就新增待办
|
||||
TodoTaskPojo todoTaskPojo = new TodoTaskPojo();
|
||||
todoTaskPojo.setCreatedById(userID);
|
||||
|
||||
@ -146,7 +146,7 @@ public class FormulaValidatorUtils {
|
||||
|
||||
// 第一个token:可以是参数/数字/常量/负号/占位符
|
||||
if (i == 0) {
|
||||
if (token.equals("-")) {
|
||||
if ("-".equals(token)) {
|
||||
// 负号开头,检查下一个token是否为有效值
|
||||
if (tokens.size() < 2 || isValidOperand(tokens.get(1)) && !tokens.get(1).equals(PLACEHOLDER)) {
|
||||
throw new IllegalArgumentException(String.format("负号后必须跟有效参数/数字/常量 [错误片段:-%s][原始公式:%s]",
|
||||
@ -169,7 +169,7 @@ public class FormulaValidatorUtils {
|
||||
token, currentFormula, originalFormula));
|
||||
}
|
||||
// 检查除法分母不能为0
|
||||
if (token.equals("/") && i + 1 < tokens.size()) {
|
||||
if ("/".equals(token) && i + 1 < tokens.size()) {
|
||||
String nextToken = tokens.get(i + 1);
|
||||
if (!nextToken.equals(PLACEHOLDER) && nextToken.matches("^-?0+(\\.0+)?$")) {
|
||||
throw new IllegalArgumentException(String.format("除法运算分母不能为0 [错误片段:/%s][原始公式:%s]",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user