package com.qianwen.smartman.modules.cps.service.impl;
|
|
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.baomidou.mybatisplus.extension.conditions.update.LambdaUpdateChainWrapper;
|
import com.google.common.collect.Lists;
|
import java.lang.invoke.SerializedLambda;
|
import java.util.Collection;
|
import java.util.Comparator;
|
import java.util.List;
|
import java.util.Map;
|
import java.util.Set;
|
import java.util.stream.Collectors;
|
import org.slf4j.Logger;
|
import org.slf4j.LoggerFactory;
|
import com.qianwen.smartman.common.cache.RegionCache;
|
import com.qianwen.smartman.common.utils.ExtraLambdaQueryWrapper;
|
import com.qianwen.smartman.common.utils.Lambda;
|
import com.qianwen.smartman.common.utils.MessageUtils;
|
import com.qianwen.core.log.exception.ServiceException;
|
import com.qianwen.core.mp.service.impl.BladeServiceImpl;
|
import com.qianwen.core.tool.node.ForestNodeMerger;
|
import com.qianwen.core.tool.utils.Func;
|
import com.qianwen.smartman.modules.cps.convert.ProductionCraftProcessConvert;
|
import com.qianwen.smartman.modules.cps.convert.ProductionCraftProcessFileConvert;
|
import com.qianwen.smartman.modules.cps.convert.ProductionCraftProcessRelatedFixtureConvert;
|
import com.qianwen.smartman.modules.cps.convert.ProductionCraftProcessRelatedToolConvert;
|
import com.qianwen.smartman.modules.cps.dto.MainProcessSaveDTO;
|
import com.qianwen.smartman.modules.cps.dto.ProcessMainUpdateDTO;
|
import com.qianwen.smartman.modules.cps.dto.ProcessNmUpdateDTO;
|
import com.qianwen.smartman.modules.cps.entity.ProductionCraftProcess;
|
import com.qianwen.smartman.modules.cps.entity.ProductionCraftProcessFile;
|
import com.qianwen.smartman.modules.cps.entity.ProductionCraftProcessRelatedFixture;
|
import com.qianwen.smartman.modules.cps.entity.ProductionCraftProcessRelatedTool;
|
import com.qianwen.smartman.modules.cps.enums.MainProcessEnum;
|
import com.qianwen.smartman.modules.cps.enums.ProductionCraftStatusEnum;
|
import com.qianwen.smartman.modules.cps.mapper.ProductionCraftProcessMapper;
|
import com.qianwen.smartman.modules.cps.service.IProductionCraftProcessFileService;
|
import com.qianwen.smartman.modules.cps.service.IProductionCraftProcessRelatedFixtureService;
|
import com.qianwen.smartman.modules.cps.service.IProductionCraftProcessRelatedToolService;
|
import com.qianwen.smartman.modules.cps.service.IProductionCraftProcessService;
|
import com.qianwen.smartman.modules.cps.utils.ThrowFun;
|
import com.qianwen.smartman.modules.cps.vo.ChildProcessVO;
|
import com.qianwen.smartman.modules.cps.vo.ParallelProVO;
|
import com.qianwen.smartman.modules.cps.vo.ProcessParallelSaveVO;
|
import com.qianwen.smartman.modules.cps.vo.ProcessParallelUpdateVO;
|
import com.qianwen.smartman.modules.cps.vo.ProcessParallelVO;
|
import com.qianwen.smartman.modules.cps.vo.ProductionCraftProcessDeleteVO;
|
import com.qianwen.smartman.modules.cps.vo.ProductionCraftProcessDetailVO;
|
import com.qianwen.smartman.modules.cps.vo.ProductionCraftProcessFileVO;
|
import com.qianwen.smartman.modules.cps.vo.ProductionCraftProcessRelatedFixtureVO;
|
import com.qianwen.smartman.modules.cps.vo.ProductionCraftProcessRelatedToolVO;
|
import com.qianwen.smartman.modules.cps.vo.ProductionCraftProcessRemoveVO;
|
import com.qianwen.smartman.modules.cps.vo.ProductionCraftProcessUpdateSortVO;
|
import com.qianwen.smartman.modules.cps.vo.ProductionCraftProcessVO;
|
import com.qianwen.smartman.modules.cps.vo.UpdateParallelProcessVO;
|
import com.qianwen.smartman.modules.cps.vo.VersionProcessAddVO;
|
import com.qianwen.smartman.modules.cps.vo.VersionProcessParallelVO;
|
import com.qianwen.smartman.modules.cps.vo.VersionProcessTreeVO;
|
import com.qianwen.smartman.modules.cps.vo.VersionProcessUpdateVO;
|
import org.springframework.stereotype.Service;
|
import org.springframework.transaction.annotation.Transactional;
|
|
@Service
|
/* loaded from: blade-api.jar:BOOT-INF/classes/org/springblade/modules/cps/service/impl/ProductionCraftProcessServiceImpl.class */
|
public class ProductionCraftProcessServiceImpl extends BladeServiceImpl<ProductionCraftProcessMapper, ProductionCraftProcess> implements IProductionCraftProcessService {
|
private final IProductionCraftProcessFileService processFileService;
|
private final IProductionCraftProcessRelatedToolService relatedToolService;
|
private final IProductionCraftProcessRelatedFixtureService relatedFixtureService;
|
private static final Logger log = LoggerFactory.getLogger(ProductionCraftProcessServiceImpl.class);
|
private static final Integer CHILD_PROCESS_SIZE = 2;
|
|
private static /* synthetic */ Object $deserializeLambda$(SerializedLambda lambda) {
|
String implMethodName = lambda.getImplMethodName();
|
boolean z = true;
|
switch (implMethodName.hashCode()) {
|
case -1416707747:
|
if (implMethodName.equals("getVersionId")) {
|
z = true;
|
break;
|
}
|
break;
|
case -1291082392:
|
if (implMethodName.equals("getVersionProcessId")) {
|
z = true;
|
break;
|
}
|
break;
|
case -1130621541:
|
if (implMethodName.equals("getYCoordinate")) {
|
z = true;
|
break;
|
}
|
break;
|
case -470739956:
|
if (implMethodName.equals("getSourceId")) {
|
z = true;
|
break;
|
}
|
break;
|
case -75145708:
|
if (implMethodName.equals("getSort")) {
|
z = true;
|
break;
|
}
|
break;
|
case 98245393:
|
if (implMethodName.equals("getId")) {
|
z = true;
|
break;
|
}
|
break;
|
case 147927115:
|
if (implMethodName.equals("getMainSequenceId")) {
|
z = true;
|
break;
|
}
|
break;
|
case 474985501:
|
if (implMethodName.equals("getHeight")) {
|
z = true;
|
break;
|
}
|
break;
|
case 666329818:
|
if (implMethodName.equals("getXCoordinate")) {
|
z = true;
|
break;
|
}
|
break;
|
case 1635948546:
|
if (implMethodName.equals("getTargetId")) {
|
z = false;
|
break;
|
}
|
break;
|
}
|
switch (z) {
|
case false:
|
if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/cps/entity/ProductionCraftProcess") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
|
return (v0) -> {
|
return v0.getTargetId();
|
};
|
}
|
if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/cps/entity/ProductionCraftProcess") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
|
return (v0) -> {
|
return v0.getTargetId();
|
};
|
}
|
if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/cps/entity/ProductionCraftProcess") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
|
return (v0) -> {
|
return v0.getTargetId();
|
};
|
}
|
break;
|
case true:
|
if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/cps/entity/ProductionCraftProcess") && lambda.getImplMethodSignature().equals("()Ljava/lang/Integer;")) {
|
return (v0) -> {
|
return v0.getSort();
|
};
|
}
|
if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/cps/entity/ProductionCraftProcess") && lambda.getImplMethodSignature().equals("()Ljava/lang/Integer;")) {
|
return (v0) -> {
|
return v0.getSort();
|
};
|
}
|
if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/cps/entity/ProductionCraftProcess") && lambda.getImplMethodSignature().equals("()Ljava/lang/Integer;")) {
|
return (v0) -> {
|
return v0.getSort();
|
};
|
}
|
if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/cps/entity/ProductionCraftProcess") && lambda.getImplMethodSignature().equals("()Ljava/lang/Integer;")) {
|
return (v0) -> {
|
return v0.getSort();
|
};
|
}
|
if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/cps/entity/ProductionCraftProcess") && lambda.getImplMethodSignature().equals("()Ljava/lang/Integer;")) {
|
return (v0) -> {
|
return v0.getSort();
|
};
|
}
|
if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/cps/entity/ProductionCraftProcess") && lambda.getImplMethodSignature().equals("()Ljava/lang/Integer;")) {
|
return (v0) -> {
|
return v0.getSort();
|
};
|
}
|
break;
|
case true:
|
if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/cps/entity/ProductionCraftProcess") && lambda.getImplMethodSignature().equals("()Ljava/lang/Integer;")) {
|
return (v0) -> {
|
return v0.getHeight();
|
};
|
}
|
break;
|
case true:
|
if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/cps/entity/ProductionCraftProcess") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) {
|
return (v0) -> {
|
return v0.getVersionId();
|
};
|
}
|
if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/cps/entity/ProductionCraftProcess") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) {
|
return (v0) -> {
|
return v0.getVersionId();
|
};
|
}
|
if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/cps/entity/ProductionCraftProcess") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) {
|
return (v0) -> {
|
return v0.getVersionId();
|
};
|
}
|
if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/cps/entity/ProductionCraftProcess") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) {
|
return (v0) -> {
|
return v0.getVersionId();
|
};
|
}
|
if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/cps/entity/ProductionCraftProcess") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) {
|
return (v0) -> {
|
return v0.getVersionId();
|
};
|
}
|
if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/cps/entity/ProductionCraftProcess") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) {
|
return (v0) -> {
|
return v0.getVersionId();
|
};
|
}
|
if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/cps/entity/ProductionCraftProcess") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) {
|
return (v0) -> {
|
return v0.getVersionId();
|
};
|
}
|
if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/cps/entity/ProductionCraftProcess") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) {
|
return (v0) -> {
|
return v0.getVersionId();
|
};
|
}
|
if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/cps/entity/ProductionCraftProcess") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) {
|
return (v0) -> {
|
return v0.getVersionId();
|
};
|
}
|
break;
|
case true:
|
if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/cps/entity/ProductionCraftProcessRelatedFixture") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) {
|
return (v0) -> {
|
return v0.getVersionProcessId();
|
};
|
}
|
if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/cps/entity/ProductionCraftProcessRelatedFixture") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) {
|
return (v0) -> {
|
return v0.getVersionProcessId();
|
};
|
}
|
if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/cps/entity/ProductionCraftProcessFile") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) {
|
return (v0) -> {
|
return v0.getVersionProcessId();
|
};
|
}
|
if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/cps/entity/ProductionCraftProcessRelatedFixture") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) {
|
return (v0) -> {
|
return v0.getVersionProcessId();
|
};
|
}
|
if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/cps/entity/ProductionCraftProcessRelatedTool") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) {
|
return (v0) -> {
|
return v0.getVersionProcessId();
|
};
|
}
|
if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/cps/entity/ProductionCraftProcessFile") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) {
|
return (v0) -> {
|
return v0.getVersionProcessId();
|
};
|
}
|
if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/cps/entity/ProductionCraftProcessRelatedTool") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) {
|
return (v0) -> {
|
return v0.getVersionProcessId();
|
};
|
}
|
if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/cps/entity/ProductionCraftProcessRelatedFixture") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) {
|
return (v0) -> {
|
return v0.getVersionProcessId();
|
};
|
}
|
break;
|
case RegionCache.VILLAGE_LEVEL /* 5 */:
|
if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/cps/entity/ProductionCraftProcess") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
|
return (v0) -> {
|
return v0.getYCoordinate();
|
};
|
}
|
if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/cps/entity/ProductionCraftProcess") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
|
return (v0) -> {
|
return v0.getYCoordinate();
|
};
|
}
|
if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/cps/entity/ProductionCraftProcess") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
|
return (v0) -> {
|
return v0.getYCoordinate();
|
};
|
}
|
break;
|
case true:
|
if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/cps/entity/ProductionCraftProcess") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) {
|
return (v0) -> {
|
return v0.getMainSequenceId();
|
};
|
}
|
if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/cps/entity/ProductionCraftProcess") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) {
|
return (v0) -> {
|
return v0.getMainSequenceId();
|
};
|
}
|
if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/cps/entity/ProductionCraftProcess") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) {
|
return (v0) -> {
|
return v0.getMainSequenceId();
|
};
|
}
|
if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/cps/entity/ProductionCraftProcess") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) {
|
return (v0) -> {
|
return v0.getMainSequenceId();
|
};
|
}
|
if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/cps/entity/ProductionCraftProcess") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) {
|
return (v0) -> {
|
return v0.getMainSequenceId();
|
};
|
}
|
break;
|
case true:
|
if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/core/mp/base/BaseEntity") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) {
|
return (v0) -> {
|
return v0.getId();
|
};
|
}
|
if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/core/mp/base/BaseEntity") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) {
|
return (v0) -> {
|
return v0.getId();
|
};
|
}
|
if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/core/mp/base/BaseEntity") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) {
|
return (v0) -> {
|
return v0.getId();
|
};
|
}
|
if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/core/mp/base/BaseEntity") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) {
|
return (v0) -> {
|
return v0.getId();
|
};
|
}
|
if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/core/mp/base/BaseEntity") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) {
|
return (v0) -> {
|
return v0.getId();
|
};
|
}
|
if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/core/mp/base/BaseEntity") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) {
|
return (v0) -> {
|
return v0.getId();
|
};
|
}
|
break;
|
case true:
|
if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/cps/entity/ProductionCraftProcess") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
|
return (v0) -> {
|
return v0.getSourceId();
|
};
|
}
|
if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/cps/entity/ProductionCraftProcess") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
|
return (v0) -> {
|
return v0.getSourceId();
|
};
|
}
|
if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/cps/entity/ProductionCraftProcess") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
|
return (v0) -> {
|
return v0.getSourceId();
|
};
|
}
|
break;
|
case true:
|
if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/cps/entity/ProductionCraftProcess") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
|
return (v0) -> {
|
return v0.getXCoordinate();
|
};
|
}
|
if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/cps/entity/ProductionCraftProcess") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
|
return (v0) -> {
|
return v0.getXCoordinate();
|
};
|
}
|
if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/cps/entity/ProductionCraftProcess") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
|
return (v0) -> {
|
return v0.getXCoordinate();
|
};
|
}
|
break;
|
}
|
throw new IllegalArgumentException("Invalid lambda deserialization");
|
}
|
|
public ProductionCraftProcessServiceImpl(final IProductionCraftProcessFileService processFileService, final IProductionCraftProcessRelatedToolService relatedToolService, final IProductionCraftProcessRelatedFixtureService relatedFixtureService) {
|
this.processFileService = processFileService;
|
this.relatedToolService = relatedToolService;
|
this.relatedFixtureService = relatedFixtureService;
|
}
|
|
@Override // org.springblade.modules.cps.service.IProductionCraftProcessService
|
@Transactional(rollbackFor = {Exception.class})
|
public List<ProductionCraftProcessVO> saveVersionProcess(Long versionId, List<VersionProcessAddVO> processList) {
|
validFixVersion(versionId);
|
List<ProductionCraftProcess> craftProcessList = saveAll(versionId, processList);
|
if (Func.isNotEmpty(processList)) {
|
Map<Integer, List<Integer>> sortMap = (Map) processList.stream().map((v0) -> {
|
return v0.getSort();
|
}).filter((v0) -> {
|
return Func.notNull(v0);
|
}).collect(Collectors.groupingBy(c -> {
|
return c;
|
}));
|
if (sortMap.size() != processList.size()) {
|
throw new ServiceException(MessageUtils.message("cps.production.craft.process.same.sort", new Object[0]));
|
}
|
}
|
return ProductionCraftProcessConvert.INSTANCE.convert(craftProcessList);
|
}
|
|
@Override // org.springblade.modules.cps.service.IProductionCraftProcessService
|
@Transactional(rollbackFor = {Exception.class})
|
public Boolean removeVersionProcess(List<Long> ids) {
|
boolean flag = removeBatchByIds(ids);
|
return Boolean.valueOf(flag && removeProcessAssociation(ids));
|
}
|
|
@Override // org.springblade.modules.cps.service.IProductionCraftProcessService
|
public List<ProductionCraftProcess> listProcessByVersion(Long id) {
|
return list((Wrapper) ((LambdaQueryWrapper) Wrappers.lambdaQuery(ProductionCraftProcess.class).eq((v0) -> {
|
return v0.getVersionId();
|
}, id)).orderByAsc((v0) -> {
|
return v0.getSort();
|
}));
|
}
|
|
@Override // org.springblade.modules.cps.service.IProductionCraftProcessService
|
public boolean useSameFixture(ProductionCraftProcess currentProcess, ProductionCraftProcess nextProcess) {
|
List<ProductionCraftProcessRelatedFixture> currentFixture = this.relatedFixtureService.list((Wrapper) Wrappers.lambdaQuery(ProductionCraftProcessRelatedFixture.class).eq((v0) -> {
|
return v0.getVersionProcessId();
|
}, currentProcess.getId()));
|
List<ProductionCraftProcessRelatedFixture> nextFixture = this.relatedFixtureService.list((Wrapper) Wrappers.lambdaQuery(ProductionCraftProcessRelatedFixture.class).eq((v0) -> {
|
return v0.getVersionProcessId();
|
}, nextProcess.getId()));
|
int currentSize = currentFixture.size();
|
int nextSize = nextFixture.size();
|
if (currentSize != nextSize) {
|
return false;
|
}
|
Set<Long> currentIds = (Set) currentFixture.stream().map((v0) -> {
|
return v0.getFixtureId();
|
}).collect(Collectors.toSet());
|
Set<Long> nextIds = (Set) nextFixture.stream().map((v0) -> {
|
return v0.getFixtureId();
|
}).collect(Collectors.toSet());
|
return currentIds.containsAll(nextIds);
|
}
|
|
@Override // org.springblade.modules.cps.service.IProductionCraftProcessService
|
public Boolean updateSort(ProductionCraftProcessUpdateSortVO productionCraftProcessUpdateSortVO) {
|
List<ProductionCraftProcess> list = (List) productionCraftProcessUpdateSortVO.getProcessList().stream().map(i -> {
|
ProductionCraftProcess productionCraftProcess = new ProductionCraftProcess();
|
productionCraftProcess.setId(i.getId());
|
productionCraftProcess.setSort(i.getSort());
|
productionCraftProcess.setTargetId(i.getTargetId());
|
productionCraftProcess.setSourceId(i.getSourceId());
|
productionCraftProcess.setXCoordinate(i.getXCoordinate());
|
productionCraftProcess.setYCoordinate(i.getYCoordinate());
|
return productionCraftProcess;
|
}).collect(Collectors.toList());
|
return Boolean.valueOf(updateBatchById(list));
|
}
|
|
@Override // org.springblade.modules.cps.service.IProductionCraftProcessService
|
public ProductionCraftProcessDetailVO detailProcess(Long id) {
|
ProductionCraftProcess process = (ProductionCraftProcess) getById(id);
|
ProductionCraftProcessDetailVO vo = ProductionCraftProcessConvert.INSTANCE.convertDetailVO(process);
|
Long mainSequenceId = process.getMainSequenceId();
|
vo.setParentId(Long.valueOf(mainSequenceId == null ? 1024L : mainSequenceId.longValue()));
|
List<ProductionCraftProcessFile> processFiles = this.processFileService.list((Wrapper) Wrappers.lambdaQuery(ProductionCraftProcessFile.class).eq((v0) -> {
|
return v0.getVersionProcessId();
|
}, id));
|
List<ProductionCraftProcessFileVO> fileList = ProductionCraftProcessFileConvert.INSTANCE.convert(processFiles);
|
vo.setFiles(fileList);
|
List<ProductionCraftProcessRelatedFixture> fixtures = this.relatedFixtureService.list((Wrapper) Wrappers.lambdaQuery(ProductionCraftProcessRelatedFixture.class).eq((v0) -> {
|
return v0.getVersionProcessId();
|
}, id));
|
List<ProductionCraftProcessRelatedFixtureVO> fixtureList = ProductionCraftProcessRelatedFixtureConvert.INSTANCE.convert(fixtures);
|
vo.setFixtures(fixtureList);
|
List<ProductionCraftProcessRelatedTool> tools = this.relatedToolService.list((Wrapper) Wrappers.lambdaQuery(ProductionCraftProcessRelatedTool.class).eq((v0) -> {
|
return v0.getVersionProcessId();
|
}, id));
|
List<ProductionCraftProcessRelatedToolVO> toolList = ProductionCraftProcessRelatedToolConvert.INSTANCE.convert(tools);
|
vo.setTools(toolList);
|
return vo;
|
}
|
|
@Override // org.springblade.modules.cps.service.IProductionCraftProcessService
|
@Transactional(rollbackFor = {Exception.class})
|
public Boolean removeProcess(ProductionCraftProcessRemoveVO vo) {
|
int versionStatus = this.baseMapper.getVersionStatus(vo.getVersionId());
|
if (ProductionCraftStatusEnum.FINALIZED.getStatus().equals(Integer.valueOf(versionStatus))) {
|
throw new ServiceException(MessageUtils.message("cps.production.craft.version.has.been.finalized.can.not.delete", new Object[0]));
|
}
|
Long versionProcessId = vo.getVersionProcessId();
|
removeById(versionProcessId);
|
remove(Lambda.eq((v0) -> {
|
return v0.getMainSequenceId();
|
}, versionProcessId));
|
removeProcessAssociation(Lists.newArrayList(new Long[]{versionProcessId}));
|
List<ProductionCraftProcessDeleteVO> voList = vo.getProductionCraftProcessDeleteVOList();
|
if (Func.isNotEmpty(voList)) {
|
List<ProductionCraftProcess> list = (List) voList.stream().filter(c -> {
|
return !versionProcessId.equals(c.getId());
|
}).map(i -> {
|
ProductionCraftProcess productionCraftProcess = new ProductionCraftProcess();
|
productionCraftProcess.setId(i.getId());
|
productionCraftProcess.setSourceId(i.getSourceId());
|
productionCraftProcess.setTargetId(i.getTargetId());
|
productionCraftProcess.setXCoordinate(i.getXCoordinate());
|
productionCraftProcess.setYCoordinate(i.getYCoordinate());
|
return productionCraftProcess;
|
}).collect(Collectors.toList());
|
updateBatchById(list);
|
}
|
return true;
|
}
|
|
@Override // org.springblade.modules.cps.service.IProductionCraftProcessService
|
@Transactional(rollbackFor = {Exception.class})
|
public Boolean updateVersionProcess(VersionProcessUpdateVO vo) {
|
Long versionId = vo.getVersionId();
|
int versionStatus = this.baseMapper.getVersionStatus(versionId);
|
if (ProductionCraftStatusEnum.FINALIZED.getStatus().equals(Integer.valueOf(versionStatus))) {
|
throw new ServiceException(MessageUtils.message("cps.production.craft.version.has.been.finalized.can.not.edit", new Object[0]));
|
}
|
ProductionCraftProcess productionCraftProcess = ProductionCraftProcessConvert.INSTANCE.convert(vo);
|
Integer sort = productionCraftProcess.getSort();
|
if (Func.notNull(sort)) {
|
Long id = productionCraftProcess.getId();
|
ProductionCraftProcess process = (ProductionCraftProcess) getById(id);
|
if (Func.isNull(process.getMainSequenceId())) {
|
List<ProductionCraftProcess> list = list((Wrapper) ((ExtraLambdaQueryWrapper) Lambda.eq((v0) -> {
|
return v0.getSort();
|
}, sort).ne((v0) -> {
|
return v0.getId();
|
}, vo.getId())).eq((v0) -> {
|
return v0.getVersionId();
|
}, versionId));
|
if (Func.isNotEmpty(list)) {
|
throw new ServiceException(MessageUtils.message("cps.production.craft.process.same.sort", new Object[0]));
|
}
|
}
|
}
|
updateById(productionCraftProcess);
|
removeProcessAssociation(Lists.newArrayList(new Long[]{vo.getId()}));
|
List<ProductionCraftProcessFile> fileList = Lists.newArrayList();
|
List<ProductionCraftProcessRelatedTool> toolList = Lists.newArrayList();
|
List<ProductionCraftProcessRelatedFixture> fixtureList = Lists.newArrayList();
|
saveFileToolFixtures(vo.getId(), vo.getFiles(), vo.getTools(), vo.getFixtures(), fileList, toolList, fixtureList);
|
if (Func.isNotEmpty(fileList)) {
|
this.processFileService.saveBatch(fileList);
|
}
|
if (Func.isNotEmpty(toolList)) {
|
this.relatedToolService.saveBatch(toolList);
|
}
|
if (Func.isNotEmpty(fixtureList)) {
|
this.relatedFixtureService.saveBatch(fixtureList);
|
}
|
return true;
|
}
|
|
@Override // org.springblade.modules.cps.service.IProductionCraftProcessService
|
public List<ProductionCraftProcessVO> listProcess(Long versionId) {
|
List<ProductionCraftProcess> list = list((Wrapper) Wrappers.lambdaQuery(ProductionCraftProcess.class).eq((v0) -> {
|
return v0.getVersionId();
|
}, versionId));
|
return ProductionCraftProcessConvert.INSTANCE.convert(list);
|
}
|
|
@Override // org.springblade.modules.cps.service.IProductionCraftProcessService
|
@Transactional(rollbackFor = {Exception.class})
|
public Boolean saveParallel(VersionProcessParallelVO vo) {
|
Long versionId = vo.getVersionId();
|
List<ProcessParallelVO> childProcess = vo.getParallelVO();
|
checkProcessType(childProcess);
|
MainProcessSaveDTO build = MainProcessSaveDTO.builder().versionId(versionId).mainProcessName(vo.getProcessName()).mainProcessCode(vo.getProcessCode()).sort(vo.getSort()).targetId(vo.getTargetId()).sourceId(vo.getSourceId()).xCoordinate(vo.getXCoordinate()).yCoordinate(vo.getYCoordinate()).height(vo.getHeight()).build();
|
ProductionCraftProcess craftProcess = saveMainProcess(build);
|
return updateChildProcess(craftProcess, childProcess);
|
}
|
|
@Override // org.springblade.modules.cps.service.IProductionCraftProcessService
|
public List<VersionProcessTreeVO> treeProcess(String versionId) {
|
List<ProductionCraftProcess> list = list(Lambda.eq((v0) -> {
|
return v0.getVersionId();
|
}, versionId));
|
List<VersionProcessTreeVO> vos = (List) list.stream().map(this::convert).collect(Collectors.toList());
|
List<VersionProcessTreeVO> result = ForestNodeMerger.merge(vos);
|
result.sort(Comparator.comparing((v0) -> {
|
return v0.getSort();
|
}));
|
return result;
|
}
|
|
@Override // org.springblade.modules.cps.service.IProductionCraftProcessService
|
public Boolean updateParallelProcess(UpdateParallelProcessVO vo) {
|
ProductionCraftProcess process = new ProductionCraftProcess();
|
process.setId(vo.getId());
|
process.setProcessCode(vo.getProcessCode());
|
process.setProcessName(vo.getProcessName());
|
process.setSort(vo.getSort());
|
return Boolean.valueOf(updateById(process) && ((LambdaUpdateChainWrapper) ((LambdaUpdateChainWrapper) Lambda.updateWrapper(this.baseMapper).set((v0) -> {
|
return v0.getSort();
|
}, vo.getSort())).eq((v0) -> {
|
return v0.getMainSequenceId();
|
}, vo.getId())).update());
|
}
|
|
@Override // org.springblade.modules.cps.service.IProductionCraftProcessService
|
@Transactional(rollbackFor = {Exception.class})
|
public List<ProductionCraftProcessVO> parallelSave(ProcessParallelSaveVO vo) {
|
Long versionId = vo.getVersionId();
|
validFixVersion(versionId);
|
List<VersionProcessAddVO> normalProcessList = vo.getNormalProcessList();
|
List<ProductionCraftProcessVO> res = Lists.newArrayList();
|
List<Integer> sorts = Lists.newArrayList();
|
if (Func.isNotEmpty(normalProcessList)) {
|
List<Integer> sortList = (List) normalProcessList.stream().map((v0) -> {
|
return v0.getSort();
|
}).filter((v0) -> {
|
return Func.notNull(v0);
|
}).collect(Collectors.toList());
|
sorts.addAll(sortList);
|
List<ProductionCraftProcess> craftProcessList = saveAll(versionId, normalProcessList);
|
res.addAll(ProductionCraftProcessConvert.INSTANCE.convert(craftProcessList));
|
}
|
List<ParallelProVO> parallelProcessList = vo.getParallelProcessList();
|
if (Func.isNotEmpty(parallelProcessList)) {
|
List<Integer> sortList2 = (List) parallelProcessList.stream().map((v0) -> {
|
return v0.getSort();
|
}).filter((v0) -> {
|
return Func.notNull(v0);
|
}).collect(Collectors.toList());
|
sorts.addAll(sortList2);
|
parallelProcessList.forEach(ppl -> {
|
MainProcessSaveDTO build = MainProcessSaveDTO.builder().versionId(versionId).mainProcessName(ppl.getProcessName()).mainProcessCode(ppl.getProcessCode()).sort(ppl.getSort()).targetId(ppl.getTargetId()).sourceId(ppl.getSourceId()).xCoordinate(ppl.getXCoordinate()).yCoordinate(ppl.getYCoordinate()).height(ppl.getHeight()).build();
|
ProductionCraftProcess mainProcess = saveMainProcess(build);
|
res.add(ProductionCraftProcessConvert.INSTANCE.convert(mainProcess));
|
List<VersionProcessAddVO> childProcessList = ppl.getChildProcessList();
|
Map<Integer, List<VersionProcessAddVO>> collect = (Map) childProcessList.stream().collect(Collectors.groupingBy((v0) -> {
|
return v0.getProcessType();
|
}));
|
if (collect.size() > 1) {
|
throw new ServiceException(MessageUtils.message("cps.production.craft.version.child.process", new Object[0]));
|
}
|
List<ProductionCraftProcess> craftProcessList2 = saveAll(versionId, mainProcess.getId(), mainProcess.getSort(), childProcessList);
|
res.addAll(ProductionCraftProcessConvert.INSTANCE.convert(craftProcessList2));
|
});
|
}
|
Map<Integer, List<Integer>> collect = (Map) sorts.stream().collect(Collectors.groupingBy(c -> {
|
return c;
|
}));
|
if (collect.size() != sorts.size()) {
|
throw new ServiceException(MessageUtils.message("cps.production.craft.process.same.sort", new Object[0]));
|
}
|
return res;
|
}
|
|
@Override // org.springblade.modules.cps.service.IProductionCraftProcessService
|
public List<ProductionCraftProcess> childProcessSave(ChildProcessVO vo) {
|
List<VersionProcessAddVO> childProcess = vo.getChildProcess();
|
Map<Integer, List<VersionProcessAddVO>> typeMap = (Map) childProcess.stream().collect(Collectors.groupingBy((v0) -> {
|
return v0.getProcessType();
|
}));
|
if (typeMap.size() > 1) {
|
throw new ServiceException(MessageUtils.message("cps.production.craft.version.child.process", new Object[0]));
|
}
|
Long mainId = vo.getMainId();
|
Long versionId = vo.getVersionId();
|
List<ProductionCraftProcess> list = list((Wrapper) Lambda.eq((v0) -> {
|
return v0.getMainSequenceId();
|
}, mainId).eq((v0) -> {
|
return v0.getVersionId();
|
}, versionId));
|
if (Func.isNotEmpty(list)) {
|
list.stream().map((v0) -> {
|
return v0.getProcessType();
|
}).findFirst().ifPresent(pt -> {
|
if (!typeMap.containsKey(pt)) {
|
throw new ServiceException(MessageUtils.message("cps.production.craft.version.child.process", new Object[0]));
|
}
|
});
|
}
|
return saveAll(versionId, mainId, vo.getSort(), childProcess);
|
}
|
|
@Override // org.springblade.modules.cps.service.IProductionCraftProcessService
|
public Boolean childProcessRemove(String mainId, String childId) {
|
return Boolean.valueOf(remove((Wrapper) Lambda.eq((v0) -> {
|
return v0.getMainSequenceId();
|
}, mainId).eq((v0) -> {
|
return v0.getId();
|
}, childId)));
|
}
|
|
@Override // org.springblade.modules.cps.service.IProductionCraftProcessService
|
@Transactional(rollbackFor = {Exception.class})
|
public Boolean childProcessUpdate(ProcessParallelUpdateVO vo) {
|
Long versionId = vo.getVersionId();
|
checkChildSize(vo.getMainProcess());
|
boolean flag = changeAllProcess(versionId, vo.getNormalProcess(), vo.getMainProcess());
|
return Boolean.valueOf(flag && removeChildProcess(versionId, vo.getRemoveIds()));
|
}
|
|
private boolean changeAllProcess(Long versionId, List<ProcessNmUpdateDTO> normalProcess, List<ProcessMainUpdateDTO> mainProcess) {
|
List<Boolean> res = Lists.newArrayList();
|
normalProcess.forEach(np -> {
|
updateNormalInfo(versionId, np, res);
|
});
|
mainProcess.forEach(mp -> {
|
boolean update = ((LambdaUpdateChainWrapper) ((LambdaUpdateChainWrapper) ((LambdaUpdateChainWrapper) ((LambdaUpdateChainWrapper) ((LambdaUpdateChainWrapper) ((LambdaUpdateChainWrapper) ((LambdaUpdateChainWrapper) ((LambdaUpdateChainWrapper) Lambda.updateWrapper(this.baseMapper).set((v0) -> {
|
return v0.getSort();
|
}, mp.getSort())).set((v0) -> {
|
return v0.getTargetId();
|
}, mp.getTargetId())).set((v0) -> {
|
return v0.getSourceId();
|
}, mp.getSourceId())).set((v0) -> {
|
return v0.getXCoordinate();
|
}, mp.getXCoordinate())).set((v0) -> {
|
return v0.getYCoordinate();
|
}, mp.getYCoordinate())).set((v0) -> {
|
return v0.getHeight();
|
}, mp.getHeight())).eq((v0) -> {
|
return v0.getId();
|
}, mp.getId())).eq((v0) -> {
|
return v0.getVersionId();
|
}, versionId)).update();
|
res.add(Boolean.valueOf(update));
|
List<ProcessNmUpdateDTO> childList = mp.getChildList();
|
childList.forEach(mcl -> {
|
updateChildInfo(versionId, mcl, res);
|
});
|
});
|
return res.stream().allMatch(c -> {
|
return c.booleanValue();
|
});
|
}
|
|
private void updateNormalInfo(Long versionId, ProcessNmUpdateDTO np, List<Boolean> res) {
|
boolean update = ((LambdaUpdateChainWrapper) ((LambdaUpdateChainWrapper) ((LambdaUpdateChainWrapper) ((LambdaUpdateChainWrapper) ((LambdaUpdateChainWrapper) ((LambdaUpdateChainWrapper) ((LambdaUpdateChainWrapper) ((LambdaUpdateChainWrapper) Lambda.updateWrapper(this.baseMapper).set((v0) -> {
|
return v0.getSort();
|
}, np.getSort())).set((v0) -> {
|
return v0.getTargetId();
|
}, np.getTargetId())).set((v0) -> {
|
return v0.getSourceId();
|
}, np.getSourceId())).set((v0) -> {
|
return v0.getXCoordinate();
|
}, np.getXCoordinate())).set((v0) -> {
|
return v0.getYCoordinate();
|
}, np.getYCoordinate())).set((v0) -> {
|
return v0.getMainSequenceId();
|
}, (Object) null)).eq((v0) -> {
|
return v0.getId();
|
}, np.getId())).eq((v0) -> {
|
return v0.getVersionId();
|
}, versionId)).update();
|
res.add(Boolean.valueOf(update));
|
}
|
|
private void updateChildInfo(Long versionId, ProcessNmUpdateDTO np, List<Boolean> res) {
|
boolean update = ((LambdaUpdateChainWrapper) ((LambdaUpdateChainWrapper) ((LambdaUpdateChainWrapper) ((LambdaUpdateChainWrapper) ((LambdaUpdateChainWrapper) ((LambdaUpdateChainWrapper) ((LambdaUpdateChainWrapper) Lambda.updateWrapper(this.baseMapper).set((v0) -> {
|
return v0.getSort();
|
}, np.getSort())).set((v0) -> {
|
return v0.getTargetId();
|
}, np.getTargetId())).set((v0) -> {
|
return v0.getSourceId();
|
}, np.getSourceId())).set((v0) -> {
|
return v0.getXCoordinate();
|
}, np.getXCoordinate())).set((v0) -> {
|
return v0.getYCoordinate();
|
}, np.getYCoordinate())).eq((v0) -> {
|
return v0.getId();
|
}, np.getId())).eq((v0) -> {
|
return v0.getVersionId();
|
}, versionId)).update();
|
res.add(Boolean.valueOf(update));
|
}
|
|
/* JADX WARN: Removed duplicated region for block: B:7:0x0017 */
|
/*
|
Code decompiled incorrectly, please refer to instructions dump.
|
To view partially-correct code enable 'Show inconsistent code' option in preferences
|
*/
|
private void checkChildSize(java.util.List<org.springblade.modules.cps.dto.ProcessMainUpdateDTO> r6) {
|
/*
|
r5 = this;
|
r0 = r6
|
boolean r0 = org.springblade.core.tool.utils.Func.isNotEmpty(r0)
|
if (r0 == 0) goto L53
|
r0 = r6
|
java.util.Iterator r0 = r0.iterator()
|
r7 = r0
|
Le:
|
r0 = r7
|
boolean r0 = r0.hasNext()
|
if (r0 == 0) goto L53
|
r0 = r7
|
java.lang.Object r0 = r0.next()
|
org.springblade.modules.cps.dto.ProcessMainUpdateDTO r0 = (org.springblade.modules.cps.dto.ProcessMainUpdateDTO) r0
|
r8 = r0
|
r0 = r8
|
java.util.List r0 = r0.getChildList()
|
r9 = r0
|
r0 = r9
|
boolean r0 = org.springblade.core.tool.utils.Func.isEmpty(r0)
|
if (r0 != 0) goto L3f
|
r0 = r9
|
int r0 = r0.size()
|
java.lang.Integer r1 = org.springblade.modules.cps.service.impl.ProductionCraftProcessServiceImpl.CHILD_PROCESS_SIZE
|
int r1 = r1.intValue()
|
if (r0 >= r1) goto L50
|
L3f:
|
org.springblade.core.log.exception.ServiceException r0 = new org.springblade.core.log.exception.ServiceException
|
r1 = r0
|
java.lang.String r2 = "cps.production.craft.child.process.size.less"
|
r3 = 0
|
java.lang.Object[] r3 = new java.lang.Object[r3]
|
java.lang.String r2 = org.springblade.common.utils.MessageUtils.message(r2, r3)
|
r1.<init>(r2)
|
throw r0
|
L50:
|
goto Le
|
L53:
|
return
|
*/
|
throw new UnsupportedOperationException("Method not decompiled: org.springblade.modules.cps.service.impl.ProductionCraftProcessServiceImpl.checkChildSize(java.util.List):void");
|
}
|
|
private boolean removeChildProcess(Long versionId, List<Long> ids) {
|
return Func.isEmpty(ids) || remove((Wrapper) Lambda.eq((v0) -> {
|
return v0.getVersionId();
|
}, versionId).in((v0) -> {
|
return v0.getId();
|
}, ids));
|
}
|
|
private List<ProductionCraftProcess> saveAll(Long versionId, List<VersionProcessAddVO> processList) {
|
List<ProductionCraftProcess> list = Lists.newArrayList();
|
processList.forEach(c -> {
|
ProductionCraftProcess process = ProductionCraftProcessConvert.INSTANCE.convertAdd(c);
|
process.setVersionId(versionId);
|
save(process);
|
saveOther(process.getId(), c);
|
list.add(process);
|
});
|
return list;
|
}
|
|
private List<ProductionCraftProcess> saveAll(Long versionId, Long mainProcessId, Integer sort, List<VersionProcessAddVO> processList) {
|
List<ProductionCraftProcess> list = Lists.newArrayList();
|
processList.forEach(c -> {
|
ProductionCraftProcess process = ProductionCraftProcessConvert.INSTANCE.convertAdd(c);
|
process.setVersionId(versionId);
|
process.setMainSequenceId(mainProcessId);
|
process.setSort(sort);
|
save(process);
|
saveOther(process.getId(), c);
|
list.add(process);
|
});
|
return list;
|
}
|
|
private void saveOther(Long versionProcessId, VersionProcessAddVO vo) {
|
List<ProductionCraftProcessFile> fileList = Lists.newArrayList();
|
List<ProductionCraftProcessRelatedTool> toolList = Lists.newArrayList();
|
List<ProductionCraftProcessRelatedFixture> fixtureList = Lists.newArrayList();
|
saveFileToolFixtures(versionProcessId, vo.getFiles(), vo.getTools(), vo.getFixtures(), fileList, toolList, fixtureList);
|
if (Func.isNotEmpty(fileList)) {
|
this.processFileService.saveBatch(fileList);
|
}
|
if (Func.isNotEmpty(toolList)) {
|
this.relatedToolService.saveBatch(toolList);
|
}
|
if (Func.isNotEmpty(fixtureList)) {
|
this.relatedFixtureService.saveBatch(fixtureList);
|
}
|
}
|
|
private void validFixVersion(Long versionId) {
|
int versionStatus = this.baseMapper.getVersionStatus(versionId);
|
ThrowFun.isTrue(ProductionCraftStatusEnum.FINALIZED.getStatus().equals(Integer.valueOf(versionStatus))).throwMessage(MessageUtils.message("cps.production.craft.version.has.been.finalized.can.not.add", new Object[0]));
|
}
|
|
private VersionProcessTreeVO convert(ProductionCraftProcess process) {
|
VersionProcessTreeVO vo = new VersionProcessTreeVO();
|
vo.setId(process.getId());
|
vo.setProcessId(process.getProcessId());
|
vo.setProcessCode(process.getProcessCode());
|
vo.setProcessName(process.getProcessName());
|
vo.setSort(process.getSort());
|
vo.setProcessType(process.getProcessType());
|
Long sequenceId = process.getMainSequenceId();
|
vo.setParentId(Long.valueOf(sequenceId == null ? 1024L : process.getMainSequenceId().longValue()));
|
vo.setTargetId(process.getTargetId());
|
vo.setSourceId(process.getSourceId());
|
vo.setXCoordinate(process.getXCoordinate());
|
vo.setYCoordinate(process.getYCoordinate());
|
vo.setHeight(process.getHeight());
|
return vo;
|
}
|
|
private ProductionCraftProcess saveMainProcess(MainProcessSaveDTO dto) {
|
ProductionCraftProcess process = convertMainProcess(dto);
|
save(process);
|
return process;
|
}
|
|
private ProductionCraftProcess convertMainProcess(MainProcessSaveDTO dto) {
|
return new ProductionCraftProcess().setVersionId(dto.getVersionId()).setProcessName(dto.getMainProcessName()).setProcessCode(dto.getMainProcessCode()).setWhetherParallel(MainProcessEnum.MAIN_PROCESS.getCode()).setSort(dto.getSort()).setTargetId(dto.getTargetId()).setSourceId(dto.getSourceId()).setXCoordinate(dto.getXCoordinate()).setYCoordinate(dto.getYCoordinate()).setHeight(dto.getHeight());
|
}
|
|
private Boolean updateChildProcess(ProductionCraftProcess mainProcess, List<ProcessParallelVO> childProcess) {
|
List<ProductionCraftProcess> craftProcesses = (List) childProcess.stream().map(pro -> {
|
ProductionCraftProcess process = new ProductionCraftProcess().setMainSequenceId(mainProcess.getId()).setWhetherParallel(MainProcessEnum.MAIN_PROCESS.getCode()).setSort(mainProcess.getSort());
|
process.setId(pro.getVersionProcessId());
|
return process;
|
}).collect(Collectors.toList());
|
return Boolean.valueOf(updateBatchById(craftProcesses));
|
}
|
|
private void checkProcessType(List<ProcessParallelVO> childProcess) {
|
Map<Integer, List<ProcessParallelVO>> typeMap = (Map) childProcess.stream().collect(Collectors.groupingBy((v0) -> {
|
return v0.getProcessType();
|
}));
|
if (typeMap.size() > 1) {
|
throw new ServiceException(MessageUtils.message("cps.production.craft.version.child.process", new Object[0]));
|
}
|
}
|
|
private void saveFileToolFixtures(Long versionProcessId, List<ProductionCraftProcessFileVO> files, List<ProductionCraftProcessRelatedToolVO> tools, List<ProductionCraftProcessRelatedFixtureVO> fixtures, List<ProductionCraftProcessFile> fileList, List<ProductionCraftProcessRelatedTool> toolList, List<ProductionCraftProcessRelatedFixture> fixtureList) {
|
if (Func.isNotEmpty(files)) {
|
fileList.addAll((Collection) files.stream().map(c -> {
|
ProductionCraftProcessFile file = ProductionCraftProcessFileConvert.INSTANCE.convert(c);
|
file.setVersionProcessId(versionProcessId);
|
return file;
|
}).collect(Collectors.toList()));
|
}
|
if (Func.isNotEmpty(tools)) {
|
toolList.addAll((Collection) tools.stream().map(c2 -> {
|
return new ProductionCraftProcessRelatedTool().setToolId(c2.getToolId()).setVersionProcessId(versionProcessId).setToolCode(c2.getToolCode()).setToolModelName(c2.getToolModelName()).setToolCategoryName(c2.getToolCategoryName());
|
}).collect(Collectors.toList()));
|
}
|
if (Func.isNotEmpty(fixtures)) {
|
fixtureList.addAll((Collection) fixtures.stream().map(c3 -> {
|
return new ProductionCraftProcessRelatedFixture().setFixtureId(c3.getFixtureId()).setVersionProcessId(versionProcessId).setFixtureGroupName(c3.getFixtureGroupName()).setFixtureCode(c3.getFixtureCode()).setFixtureName(c3.getFixtureName());
|
}).collect(Collectors.toList()));
|
}
|
}
|
|
private boolean removeProcessAssociation(List<Long> ids) {
|
this.processFileService.remove(Lambda.in((v0) -> {
|
return v0.getVersionProcessId();
|
}, ids));
|
this.relatedToolService.remove(Lambda.in((v0) -> {
|
return v0.getVersionProcessId();
|
}, ids));
|
this.relatedFixtureService.remove(Lambda.in((v0) -> {
|
return v0.getVersionProcessId();
|
}, ids));
|
return true;
|
}
|
}
|