diff --git a/scaleph-dao/src/main/java/cn/sliew/scaleph/dao/entity/master/ws/WsDiJobAttr.java b/scaleph-dao/src/main/java/cn/sliew/scaleph/dao/entity/master/ws/WsDiJobAttr.java deleted file mode 100644 index 87dd943af..000000000 --- a/scaleph-dao/src/main/java/cn/sliew/scaleph/dao/entity/master/ws/WsDiJobAttr.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package cn.sliew.scaleph.dao.entity.master.ws; - -import cn.sliew.scaleph.common.dict.job.JobAttrType; -import cn.sliew.scaleph.dao.entity.BaseDO; -import com.baomidou.mybatisplus.annotation.TableName; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - *

- * 数据集成-作业参数 - *

- * - * @author liyu - * @since 2022-03-10 - */ -@Data -@EqualsAndHashCode(callSuper = true) -@TableName("ws_di_job_attr") -public class WsDiJobAttr extends BaseDO { - - private static final long serialVersionUID = 1709354370837885026L; - - private Long jobId; - - private JobAttrType jobAttrType; - - private String jobAttrKey; - - private String jobAttrValue; - -} diff --git a/scaleph-dao/src/main/java/cn/sliew/scaleph/dao/entity/master/ws/WsDiJobLink.java b/scaleph-dao/src/main/java/cn/sliew/scaleph/dao/entity/master/ws/WsDiJobLink.java deleted file mode 100644 index 1f1c42fc5..000000000 --- a/scaleph-dao/src/main/java/cn/sliew/scaleph/dao/entity/master/ws/WsDiJobLink.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package cn.sliew.scaleph.dao.entity.master.ws; - -import cn.sliew.scaleph.dao.entity.BaseDO; -import com.baomidou.mybatisplus.annotation.TableName; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - *

- * 数据集成-作业连线 - *

- * - * @author liyu - * @since 2022-03-10 - */ -@Data -@EqualsAndHashCode(callSuper = true) -@TableName("ws_di_job_link") -public class WsDiJobLink extends BaseDO { - - private static final long serialVersionUID = 8533125383197913516L; - - private Long jobId; - - private String linkCode; - - private String fromStepCode; - - private String toStepCode; - -} diff --git a/scaleph-dao/src/main/java/cn/sliew/scaleph/dao/entity/master/ws/WsDiJobStep.java b/scaleph-dao/src/main/java/cn/sliew/scaleph/dao/entity/master/ws/WsDiJobStep.java deleted file mode 100644 index 5097dca5e..000000000 --- a/scaleph-dao/src/main/java/cn/sliew/scaleph/dao/entity/master/ws/WsDiJobStep.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package cn.sliew.scaleph.dao.entity.master.ws; - -import cn.sliew.scaleph.common.dict.seatunnel.SeaTunnelPluginName; -import cn.sliew.scaleph.common.dict.seatunnel.SeaTunnelPluginType; -import cn.sliew.scaleph.dao.entity.BaseDO; -import com.baomidou.mybatisplus.annotation.TableName; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - *

- * 数据集成-作业步骤信息 - *

- * - * @author liyu - * @since 2022-03-10 - */ -@Data -@EqualsAndHashCode(callSuper = true) -@TableName("ws_di_job_step") -public class WsDiJobStep extends BaseDO { - - private static final long serialVersionUID = -8131332626792290363L; - - private Long jobId; - - private String stepCode; - - private String stepTitle; - - private SeaTunnelPluginType stepType; - - private SeaTunnelPluginName stepName; - - private Integer positionX; - - private Integer positionY; - - private String stepAttrs; -} diff --git a/scaleph-dao/src/main/java/cn/sliew/scaleph/dao/mapper/master/ws/WsDiJobAttrMapper.java b/scaleph-dao/src/main/java/cn/sliew/scaleph/dao/mapper/master/ws/WsDiJobAttrMapper.java deleted file mode 100644 index 78c85b132..000000000 --- a/scaleph-dao/src/main/java/cn/sliew/scaleph/dao/mapper/master/ws/WsDiJobAttrMapper.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package cn.sliew.scaleph.dao.mapper.master.ws; - -import java.io.Serializable; -import java.util.Collection; - -import cn.sliew.scaleph.dao.entity.master.ws.WsDiJobAttr; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -/** - *

- * 数据集成-作业参数 Mapper 接口 - *

- * - * @author liyu - * @since 2022-03-10 - */ -@Repository -public interface WsDiJobAttrMapper extends BaseMapper { - - /** - * 按项目id删除 - * - * @param projectIds project id - * @return int - */ - int deleteByProjectId(@Param("projectIds") Collection projectIds); - - /** - * 按job id 删除 - * - * @param jobIds job id - * @return int - */ - int deleteByJobId(@Param("jobIds") Collection jobIds); - - int clone(@Param("sourceJobId") Long sourceJobId, @Param("targetJobId") Long targetJobId); - -} diff --git a/scaleph-dao/src/main/java/cn/sliew/scaleph/dao/mapper/master/ws/WsDiJobLinkMapper.java b/scaleph-dao/src/main/java/cn/sliew/scaleph/dao/mapper/master/ws/WsDiJobLinkMapper.java deleted file mode 100644 index b1a13b5fb..000000000 --- a/scaleph-dao/src/main/java/cn/sliew/scaleph/dao/mapper/master/ws/WsDiJobLinkMapper.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package cn.sliew.scaleph.dao.mapper.master.ws; - -import java.io.Serializable; -import java.util.Collection; - -import cn.sliew.scaleph.dao.entity.master.ws.WsDiJobLink; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -/** - *

- * 数据集成-作业连线 Mapper 接口 - *

- * - * @author liyu - * @since 2022-03-10 - */ -@Repository -public interface WsDiJobLinkMapper extends BaseMapper { - - /** - * 按项目id删除 - * - * @param projectIds project id - * @return int - */ - int deleteByProjectId(@Param("projectIds") Collection projectIds); - - /** - * 按job id 删除 - * - * @param jobIds job id - * @return int - */ - int deleteByJobId(@Param("jobIds") Collection jobIds); - - int clone(@Param("sourceJobId") Long sourceJobId, @Param("targetJobId") Long targetJobId); - -} diff --git a/scaleph-dao/src/main/java/cn/sliew/scaleph/dao/mapper/master/ws/WsDiJobStepMapper.java b/scaleph-dao/src/main/java/cn/sliew/scaleph/dao/mapper/master/ws/WsDiJobStepMapper.java deleted file mode 100644 index 3f02ad6d7..000000000 --- a/scaleph-dao/src/main/java/cn/sliew/scaleph/dao/mapper/master/ws/WsDiJobStepMapper.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package cn.sliew.scaleph.dao.mapper.master.ws; - -import java.io.Serializable; -import java.util.Collection; -import java.util.List; - -import cn.sliew.scaleph.dao.entity.master.ws.WsDiJobStep; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -/** - *

- * 数据集成-作业步骤信息 Mapper 接口 - *

- * - * @author liyu - * @since 2022-03-10 - */ -@Repository -public interface WsDiJobStepMapper extends BaseMapper { - /** - * 按项目id删除 - * - * @param projectIds project id - * @return int - */ - int deleteByProjectId(@Param("projectIds") Collection projectIds); - - /** - * 按job id 删除 - * - * @param jobIds job id - * @return int - */ - int deleteByJobId(@Param("jobIds") Collection jobIds); - - /** - * 查询作业id相关的步骤 - * - * @param jobId job id - * @return job step list - */ - List selectByJobId(@Param("jobId") Long jobId); - - int clone(@Param("sourceJobId") Long sourceJobId, @Param("targetJobId") Long targetJobId); - -} diff --git a/scaleph-dao/src/main/resources/cn/sliew/scaleph/dao/mapper/master/ws/WsDiJobAttrMapper.xml b/scaleph-dao/src/main/resources/cn/sliew/scaleph/dao/mapper/master/ws/WsDiJobAttrMapper.xml deleted file mode 100644 index feb039a42..000000000 --- a/scaleph-dao/src/main/resources/cn/sliew/scaleph/dao/mapper/master/ws/WsDiJobAttrMapper.xml +++ /dev/null @@ -1,81 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - delete t from ws_di_job_attr t - - exists (select 1 from ws_di_job j - - t.job_id = j.id - and j.project_id in - - #{projectId,jdbcType=BIGINT} - - - ) - - - - - delete from ws_di_job_attr where job_id in - - #{id,jdbcType=BIGINT} - - - - - insert into ws_di_job_attr - ( - job_id, - job_attr_type, - job_attr_key, - job_attr_value, - creator, - create_time, - editor, - update_time - ) - select - #{targetJobId,jdbcType=BIGINT} as job_id, - job_attr_type, - job_attr_key, - job_attr_value, - 'sys' as creator, - now() as create_time, - 'sys' as editor, - now() as update_time - from ws_di_job_attr - where job_id = #{sourceJobId,jdbcType=BIGINT} - - diff --git a/scaleph-dao/src/main/resources/cn/sliew/scaleph/dao/mapper/master/ws/WsDiJobLinkMapper.xml b/scaleph-dao/src/main/resources/cn/sliew/scaleph/dao/mapper/master/ws/WsDiJobLinkMapper.xml deleted file mode 100644 index dc947a015..000000000 --- a/scaleph-dao/src/main/resources/cn/sliew/scaleph/dao/mapper/master/ws/WsDiJobLinkMapper.xml +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - delete t from ws_di_job_link t - - exists (select 1 from ws_di_job j - - t.job_id = j.id - and j.project_id in - - #{projectId,jdbcType=BIGINT} - - - ) - - - - - delete from ws_di_job_link where job_id in - - #{id,jdbcType=BIGINT} - - - - - insert into ws_di_job_link - ( - job_id, - link_code, - from_step_code, - to_step_code, - creator, - create_time, - editor, - update_time - ) - select - #{targetJobId,jdbcType=BIGINT} as job_id, - link_code, - from_step_code, - to_step_code, - 'sys' as creator, - now() as create_time, - 'sys' as editor, - now() as update_time - from ws_di_job_link - where job_id = #{sourceJobId,jdbcType=BIGINT} - - - diff --git a/scaleph-dao/src/main/resources/cn/sliew/scaleph/dao/mapper/master/ws/WsDiJobStepMapper.xml b/scaleph-dao/src/main/resources/cn/sliew/scaleph/dao/mapper/master/ws/WsDiJobStepMapper.xml deleted file mode 100644 index c216940e1..000000000 --- a/scaleph-dao/src/main/resources/cn/sliew/scaleph/dao/mapper/master/ws/WsDiJobStepMapper.xml +++ /dev/null @@ -1,110 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - delete t from ws_di_job_step t - - exists (select 1 from ws_di_job j - - t.job_id = j.id - and j.project_id in - - #{projectId,jdbcType=BIGINT} - - - ) - - - - - delete from ws_di_job_step where job_id in - - #{id,jdbcType=BIGINT} - - - - - insert into ws_di_job_step - (job_id, - step_code, - step_title, - step_type, - step_name, - position_x, - position_y, - step_attrs, - creator, - create_time, - editor, - update_time) - select #{targetJobId,jdbcType=BIGINT} as job_id, - step_code, - step_title, - step_type, - step_name, - position_x, - position_y, - step_attrs, - 'sys' as creator, - now() as create_time, - 'sys' as editor, - now() as update_time - from ws_di_job_step - where job_id = #{sourceJobId,jdbcType=BIGINT} - - diff --git a/scaleph-engine/scaleph-engine-seatunnel/src/main/java/cn/sliew/scaleph/engine/seatunnel/service/WsDiJobAttrService.java b/scaleph-engine/scaleph-engine-seatunnel/src/main/java/cn/sliew/scaleph/engine/seatunnel/service/WsDiJobAttrService.java deleted file mode 100644 index 2df737b5d..000000000 --- a/scaleph-engine/scaleph-engine-seatunnel/src/main/java/cn/sliew/scaleph/engine/seatunnel/service/WsDiJobAttrService.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package cn.sliew.scaleph.engine.seatunnel.service; - -import java.io.Serializable; -import java.util.Collection; -import java.util.List; - -import cn.sliew.scaleph.engine.seatunnel.service.dto.WsDiJobAttrDTO; - -/** - *

- * 数据集成-作业参数 服务类 - *

- * - * @author liyu - * @since 2022-03-10 - */ -public interface WsDiJobAttrService { - - List listJobAttr(Long jobId); - - int upsert(WsDiJobAttrDTO jobAttrDTO); - - int deleteByProjectId(Collection projectIds); - - int deleteByJobId(Collection jobIds); - - int clone(Long sourceJobId, Long targetJobId); -} diff --git a/scaleph-engine/scaleph-engine-seatunnel/src/main/java/cn/sliew/scaleph/engine/seatunnel/service/WsDiJobGraphService.java b/scaleph-engine/scaleph-engine-seatunnel/src/main/java/cn/sliew/scaleph/engine/seatunnel/service/WsDiJobGraphService.java deleted file mode 100644 index 9c66c7f5f..000000000 --- a/scaleph-engine/scaleph-engine-seatunnel/src/main/java/cn/sliew/scaleph/engine/seatunnel/service/WsDiJobGraphService.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package cn.sliew.scaleph.engine.seatunnel.service; - -import cn.sliew.scaleph.dag.service.vo.DagGraphVO; -import cn.sliew.scaleph.engine.seatunnel.service.dto.WsDiJobDTO; -import cn.sliew.scaleph.engine.seatunnel.service.param.WsDiJobStepParam; - -import java.util.Collection; -import java.util.List; - -public interface WsDiJobGraphService { - - void queryJobGraph(WsDiJobDTO job); - - void saveJobGraph(Long jobId, DagGraphVO jobGraph); - - void updateJobStep(WsDiJobStepParam param); - - void clone(Long sourceJobId, Long targetJobId); - - void deleteBatch(List jobIds); - - int deleteByProjectId(Collection projectIds); - -} diff --git a/scaleph-engine/scaleph-engine-seatunnel/src/main/java/cn/sliew/scaleph/engine/seatunnel/service/WsDiJobLinkService.java b/scaleph-engine/scaleph-engine-seatunnel/src/main/java/cn/sliew/scaleph/engine/seatunnel/service/WsDiJobLinkService.java deleted file mode 100644 index 5e3399cca..000000000 --- a/scaleph-engine/scaleph-engine-seatunnel/src/main/java/cn/sliew/scaleph/engine/seatunnel/service/WsDiJobLinkService.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package cn.sliew.scaleph.engine.seatunnel.service; - -import java.io.Serializable; -import java.util.Collection; -import java.util.List; - -import cn.sliew.scaleph.engine.seatunnel.service.dto.WsDiJobLinkDTO; - -/** - *

- * 数据集成-作业连线 服务类 - *

- * - * @author liyu - * @since 2022-03-10 - */ -public interface WsDiJobLinkService { - - List listJobLink(Long jobId); - - int insert(WsDiJobLinkDTO diJobLink); - - int upsert(WsDiJobLinkDTO diJobLink); - - int deleteByProjectId(Collection projectIds); - - int deleteByJobId(Collection jobIds); - - int deleteSurplusLink(Long jobId, List linkCodeList); - - int clone(Long sourceJobId, Long targetJobId); -} diff --git a/scaleph-engine/scaleph-engine-seatunnel/src/main/java/cn/sliew/scaleph/engine/seatunnel/service/WsDiJobStepService.java b/scaleph-engine/scaleph-engine-seatunnel/src/main/java/cn/sliew/scaleph/engine/seatunnel/service/WsDiJobStepService.java deleted file mode 100644 index 74ac8699c..000000000 --- a/scaleph-engine/scaleph-engine-seatunnel/src/main/java/cn/sliew/scaleph/engine/seatunnel/service/WsDiJobStepService.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package cn.sliew.scaleph.engine.seatunnel.service; - -import java.util.Collection; -import java.util.List; - -import cn.sliew.scaleph.engine.seatunnel.service.dto.WsDiJobStepDTO; - -/** - *

- * 数据集成-作业步骤信息 服务类 - *

- * - * @author liyu - * @since 2022-03-10 - */ -public interface WsDiJobStepService { - - List listJobStep(Long jobId); - - WsDiJobStepDTO selectOne(Long jobId, String stepCode); - - int update(WsDiJobStepDTO wsDiJobStepDTO); - - int upsert(WsDiJobStepDTO diJobStep); - - int deleteByProjectId(Collection projectIds); - - int deleteByJobId(Collection jobIds); - - int deleteSurplusStep(Long jobId, List stepCodeList); - - int clone(Long sourceJobId, Long targetJobId); - -} diff --git a/scaleph-engine/scaleph-engine-seatunnel/src/main/java/cn/sliew/scaleph/engine/seatunnel/service/convert/WsDiJobAttrConvert.java b/scaleph-engine/scaleph-engine-seatunnel/src/main/java/cn/sliew/scaleph/engine/seatunnel/service/convert/WsDiJobAttrConvert.java deleted file mode 100644 index 682a39465..000000000 --- a/scaleph-engine/scaleph-engine-seatunnel/src/main/java/cn/sliew/scaleph/engine/seatunnel/service/convert/WsDiJobAttrConvert.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package cn.sliew.scaleph.engine.seatunnel.service.convert; - -import cn.sliew.scaleph.common.convert.BaseConvert; -import cn.sliew.scaleph.dao.entity.master.ws.WsDiJobAttr; -import cn.sliew.scaleph.engine.seatunnel.service.dto.WsDiJobAttrDTO; -import cn.sliew.scaleph.system.service.convert.DictVoConvert; -import org.mapstruct.Mapper; -import org.mapstruct.ReportingPolicy; -import org.mapstruct.factory.Mappers; - -/** - * @author gleiyu - */ -@Mapper(uses = {DictVoConvert.class}, unmappedTargetPolicy = ReportingPolicy.IGNORE) -public interface WsDiJobAttrConvert extends BaseConvert { - WsDiJobAttrConvert INSTANCE = Mappers.getMapper(WsDiJobAttrConvert.class); - - @Override - WsDiJobAttrDTO toDto(WsDiJobAttr entity); -} diff --git a/scaleph-engine/scaleph-engine-seatunnel/src/main/java/cn/sliew/scaleph/engine/seatunnel/service/convert/WsDiJobLinkConvert.java b/scaleph-engine/scaleph-engine-seatunnel/src/main/java/cn/sliew/scaleph/engine/seatunnel/service/convert/WsDiJobLinkConvert.java deleted file mode 100644 index bf513d440..000000000 --- a/scaleph-engine/scaleph-engine-seatunnel/src/main/java/cn/sliew/scaleph/engine/seatunnel/service/convert/WsDiJobLinkConvert.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package cn.sliew.scaleph.engine.seatunnel.service.convert; - -import cn.sliew.scaleph.common.convert.BaseConvert; -import cn.sliew.scaleph.dao.entity.master.ws.WsDiJobLink; -import cn.sliew.scaleph.engine.seatunnel.service.dto.WsDiJobLinkDTO; -import org.mapstruct.Mapper; -import org.mapstruct.ReportingPolicy; -import org.mapstruct.factory.Mappers; - -/** - * @author gleiyu - */ -@Mapper(unmappedTargetPolicy = ReportingPolicy.IGNORE) -public interface WsDiJobLinkConvert extends BaseConvert { - WsDiJobLinkConvert INSTANCE = Mappers.getMapper(WsDiJobLinkConvert.class); - -} diff --git a/scaleph-engine/scaleph-engine-seatunnel/src/main/java/cn/sliew/scaleph/engine/seatunnel/service/convert/WsDiJobStepConvert.java b/scaleph-engine/scaleph-engine-seatunnel/src/main/java/cn/sliew/scaleph/engine/seatunnel/service/convert/WsDiJobStepConvert.java deleted file mode 100644 index dea50e239..000000000 --- a/scaleph-engine/scaleph-engine-seatunnel/src/main/java/cn/sliew/scaleph/engine/seatunnel/service/convert/WsDiJobStepConvert.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package cn.sliew.scaleph.engine.seatunnel.service.convert; - -import cn.sliew.milky.common.util.JacksonUtil; -import cn.sliew.scaleph.common.convert.BaseConvert; -import cn.sliew.scaleph.common.util.BeanUtil; -import cn.sliew.scaleph.dao.entity.master.ws.WsDiJobStep; -import cn.sliew.scaleph.engine.seatunnel.service.dto.WsDiJobStepDTO; -import cn.sliew.scaleph.system.service.convert.DictVoConvert; -import com.fasterxml.jackson.core.type.TypeReference; -import org.mapstruct.Mapper; -import org.mapstruct.ReportingPolicy; -import org.mapstruct.factory.Mappers; -import org.springframework.util.CollectionUtils; -import org.springframework.util.StringUtils; - -import java.util.Map; - -/** - * @author gleiyu - */ -@Mapper(uses = {DictVoConvert.class}, unmappedTargetPolicy = ReportingPolicy.IGNORE) -public interface WsDiJobStepConvert extends BaseConvert { - WsDiJobStepConvert INSTANCE = Mappers.getMapper(WsDiJobStepConvert.class); - - @Override - default WsDiJobStep toDo(WsDiJobStepDTO dto) { - if (dto == null) { - return null; - } - WsDiJobStep jobStep = BeanUtil.copy(dto, new WsDiJobStep()); - if (CollectionUtils.isEmpty(dto.getStepAttrs()) == false) { - jobStep.setStepAttrs(JacksonUtil.toJsonString(dto.getStepAttrs())); - } - return jobStep; - } - - @Override - default WsDiJobStepDTO toDto(WsDiJobStep entity) { - if (entity == null) { - return null; - } - WsDiJobStepDTO dto = BeanUtil.copy(entity, new WsDiJobStepDTO()); - if (StringUtils.hasText(entity.getStepAttrs())) { - dto.setStepAttrs(JacksonUtil.parseJsonString(entity.getStepAttrs(), new TypeReference>() { - })); - } - return dto; - } -} diff --git a/scaleph-engine/scaleph-engine-seatunnel/src/main/java/cn/sliew/scaleph/engine/seatunnel/service/dto/WsDiJobAttrDTO.java b/scaleph-engine/scaleph-engine-seatunnel/src/main/java/cn/sliew/scaleph/engine/seatunnel/service/dto/WsDiJobAttrDTO.java deleted file mode 100644 index 9ccc7acb6..000000000 --- a/scaleph-engine/scaleph-engine-seatunnel/src/main/java/cn/sliew/scaleph/engine/seatunnel/service/dto/WsDiJobAttrDTO.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package cn.sliew.scaleph.engine.seatunnel.service.dto; - -import cn.sliew.scaleph.common.dict.job.JobAttrType; -import cn.sliew.scaleph.system.model.BaseDTO; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; -import org.hibernate.validator.constraints.Length; - -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotNull; - -/** - *

- * 数据集成-作业参数 - *

- * - * @author liyu - * @since 2022-03-10 - */ -@Data -@EqualsAndHashCode(callSuper = true) -@Schema(name = "作业参数信息", description = "数据集成-作业参数") -public class WsDiJobAttrDTO extends BaseDTO { - - private static final long serialVersionUID = -1088298944833438990L; - - @NotNull - @Schema(description = "作业id") - private Long jobId; - - @NotNull - @Schema(description = "作业参数类型") - private JobAttrType jobAttrType; - - @NotBlank - @Length(min = 1, max = 128) - @Schema(description = "作业参数key") - private String jobAttrKey; - - @Schema(description = "作业参数value") - private String jobAttrValue; - -} diff --git a/scaleph-engine/scaleph-engine-seatunnel/src/main/java/cn/sliew/scaleph/engine/seatunnel/service/impl/WsDiJobAttrServiceImpl.java b/scaleph-engine/scaleph-engine-seatunnel/src/main/java/cn/sliew/scaleph/engine/seatunnel/service/impl/WsDiJobAttrServiceImpl.java deleted file mode 100644 index 687b0dc8e..000000000 --- a/scaleph-engine/scaleph-engine-seatunnel/src/main/java/cn/sliew/scaleph/engine/seatunnel/service/impl/WsDiJobAttrServiceImpl.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package cn.sliew.scaleph.engine.seatunnel.service.impl; - -import cn.sliew.scaleph.dao.entity.master.ws.WsDiJobAttr; -import cn.sliew.scaleph.dao.mapper.master.ws.WsDiJobAttrMapper; -import cn.sliew.scaleph.engine.seatunnel.service.WsDiJobAttrService; -import cn.sliew.scaleph.engine.seatunnel.service.convert.WsDiJobAttrConvert; -import cn.sliew.scaleph.engine.seatunnel.service.dto.WsDiJobAttrDTO; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.io.Serializable; -import java.util.Collection; -import java.util.List; - -/** - * @author gleiyu - */ -@Service -public class WsDiJobAttrServiceImpl implements WsDiJobAttrService { - - @Autowired - private WsDiJobAttrMapper diJobAttrMapper; - - @Override - public List listJobAttr(Long jobId) { - List list = diJobAttrMapper.selectList(new LambdaQueryWrapper() - .eq(WsDiJobAttr::getJobId, jobId) - ); - return WsDiJobAttrConvert.INSTANCE.toDto(list); - } - - @Override - public int upsert(WsDiJobAttrDTO jobAttrDTO) { - WsDiJobAttr jobAttr = WsDiJobAttrConvert.INSTANCE.toDo(jobAttrDTO); - WsDiJobAttr attr = diJobAttrMapper.selectOne( - new LambdaQueryWrapper() - .eq(WsDiJobAttr::getJobId, jobAttr.getJobId()) - .eq(WsDiJobAttr::getJobAttrType, jobAttr.getJobAttrType()) - .eq(WsDiJobAttr::getJobAttrKey, jobAttr.getJobAttrKey()) - ); - if (attr == null) { - return diJobAttrMapper.insert(jobAttr); - } - - return diJobAttrMapper.update(jobAttr, - new LambdaUpdateWrapper() - .eq(WsDiJobAttr::getJobId, jobAttr.getJobId()) - .eq(WsDiJobAttr::getJobAttrType, jobAttr.getJobAttrType()) - .eq(WsDiJobAttr::getJobAttrKey, jobAttr.getJobAttrKey()) - ); - } - - @Override - public int deleteByProjectId(Collection projectIds) { - return diJobAttrMapper.deleteByProjectId(projectIds); - } - - @Override - public int deleteByJobId(Collection jobIds) { - return diJobAttrMapper.deleteByJobId(jobIds); - } - - @Override - public int clone(Long sourceJobId, Long targetJobId) { - return diJobAttrMapper.clone(sourceJobId, targetJobId); - } -} diff --git a/scaleph-engine/scaleph-engine-seatunnel/src/main/java/cn/sliew/scaleph/engine/seatunnel/service/impl/WsDiJobGraphServiceImpl.java b/scaleph-engine/scaleph-engine-seatunnel/src/main/java/cn/sliew/scaleph/engine/seatunnel/service/impl/WsDiJobGraphServiceImpl.java deleted file mode 100644 index 12235e598..000000000 --- a/scaleph-engine/scaleph-engine-seatunnel/src/main/java/cn/sliew/scaleph/engine/seatunnel/service/impl/WsDiJobGraphServiceImpl.java +++ /dev/null @@ -1,119 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package cn.sliew.scaleph.engine.seatunnel.service.impl; - -import cn.sliew.scaleph.common.constant.Constants; -import cn.sliew.scaleph.common.dict.seatunnel.SeaTunnelPluginName; -import cn.sliew.scaleph.common.dict.seatunnel.SeaTunnelPluginType; -import cn.sliew.scaleph.common.util.BeanUtil; -import cn.sliew.scaleph.dag.service.vo.DagGraphVO; -import cn.sliew.scaleph.dag.service.vo.EdgeCellVO; -import cn.sliew.scaleph.dag.service.vo.NodeCellVO; -import cn.sliew.scaleph.engine.seatunnel.service.WsDiJobGraphService; -import cn.sliew.scaleph.engine.seatunnel.service.WsDiJobLinkService; -import cn.sliew.scaleph.engine.seatunnel.service.WsDiJobStepService; -import cn.sliew.scaleph.engine.seatunnel.service.dto.WsDiJobDTO; -import cn.sliew.scaleph.engine.seatunnel.service.dto.WsDiJobLinkDTO; -import cn.sliew.scaleph.engine.seatunnel.service.dto.WsDiJobStepDTO; -import cn.sliew.scaleph.engine.seatunnel.service.param.WsDiJobStepParam; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.util.Collection; -import java.util.List; -import java.util.stream.Collectors; - -@Service -public class WsDiJobGraphServiceImpl implements WsDiJobGraphService { - - @Autowired - private WsDiJobStepService wsDiJobStepService; - @Autowired - private WsDiJobLinkService wsDiJobLinkService; - - @Override - public void queryJobGraph(WsDiJobDTO job) { - job.setJobStepList(wsDiJobStepService.listJobStep(job.getId())); - job.setJobLinkList(wsDiJobLinkService.listJobLink(job.getId())); - } - - @Override - public void saveJobGraph(Long jobId, DagGraphVO jobGraph) { - saveJobSteps(jobId, jobGraph.getNodes()); - saveJobLinks(jobId, jobGraph.getEdges()); - } - - private void saveJobSteps(Long jobId, List nodes) { - List stopCodes = nodes.stream().map(NodeCellVO::getId) - .collect(Collectors.toList()); - wsDiJobStepService.deleteSurplusStep(jobId, stopCodes); - for (NodeCellVO node : nodes) { - WsDiJobStepDTO jobStep = new WsDiJobStepDTO(); - jobStep.setJobId(jobId); - jobStep.setStepCode(node.getId()); - jobStep.setStepTitle(node.getLabel()); - jobStep.setStepType(SeaTunnelPluginType.of(String.valueOf(node.getData().get("type")))); - jobStep.setStepName(SeaTunnelPluginName.of(String.valueOf(node.getData().get("name")))); - jobStep.setPositionX(node.getX()); - jobStep.setPositionY(node.getY()); - wsDiJobStepService.upsert(jobStep); - } - } - - private void saveJobLinks(Long jobId, List edges) { - List linkCodes = edges.stream().map(EdgeCellVO::getId) - .collect(Collectors.toList()); - wsDiJobLinkService.deleteSurplusLink(jobId, linkCodes); - - for (EdgeCellVO edge : edges) { - WsDiJobLinkDTO jobLink = new WsDiJobLinkDTO(); - jobLink.setJobId(jobId); - jobLink.setLinkCode(edge.getId()); - jobLink.setFromStepCode(edge.getSource()); - jobLink.setToStepCode(edge.getTarget()); - wsDiJobLinkService.upsert(jobLink); - } - } - - @Override - public void updateJobStep(WsDiJobStepParam param) { - WsDiJobStepDTO dto = BeanUtil.copy(param, new WsDiJobStepDTO()); - dto.setStepTitle((String) param.getStepAttrs().get(Constants.JOB_STEP_TITLE)); - wsDiJobStepService.update(dto); - } - - @Override - public void clone(Long sourceJobId, Long targetJobId) { - wsDiJobStepService.clone(sourceJobId, targetJobId); - wsDiJobLinkService.clone(sourceJobId, targetJobId); - } - - @Override - public void deleteBatch(List jobIds) { - wsDiJobStepService.deleteByJobId(jobIds); - wsDiJobLinkService.deleteByJobId(jobIds); - } - - @Override - public int deleteByProjectId(Collection projectIds) { - wsDiJobStepService.deleteByProjectId(projectIds); - wsDiJobLinkService.deleteByProjectId(projectIds); - return projectIds.size(); - } -} diff --git a/scaleph-engine/scaleph-engine-seatunnel/src/main/java/cn/sliew/scaleph/engine/seatunnel/service/impl/WsDiJobLinkServiceImpl.java b/scaleph-engine/scaleph-engine-seatunnel/src/main/java/cn/sliew/scaleph/engine/seatunnel/service/impl/WsDiJobLinkServiceImpl.java deleted file mode 100644 index 63106f25a..000000000 --- a/scaleph-engine/scaleph-engine-seatunnel/src/main/java/cn/sliew/scaleph/engine/seatunnel/service/impl/WsDiJobLinkServiceImpl.java +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package cn.sliew.scaleph.engine.seatunnel.service.impl; - -import cn.hutool.core.collection.CollectionUtil; -import cn.sliew.scaleph.dao.entity.master.ws.WsDiJobLink; -import cn.sliew.scaleph.dao.mapper.master.ws.WsDiJobLinkMapper; -import cn.sliew.scaleph.engine.seatunnel.service.WsDiJobLinkService; -import cn.sliew.scaleph.engine.seatunnel.service.convert.WsDiJobLinkConvert; -import cn.sliew.scaleph.engine.seatunnel.service.dto.WsDiJobLinkDTO; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.io.Serializable; -import java.util.Collection; -import java.util.List; - -/** - * @author gleiyu - */ -@Service -public class WsDiJobLinkServiceImpl implements WsDiJobLinkService { - - @Autowired - private WsDiJobLinkMapper diJobLinkMapper; - - @Override - public List listJobLink(Long jobId) { - List list = diJobLinkMapper.selectList( - new LambdaQueryWrapper() - .eq(WsDiJobLink::getJobId, jobId) - ); - return WsDiJobLinkConvert.INSTANCE.toDto(list); - } - - @Override - public int insert(WsDiJobLinkDTO diJobLink) { - WsDiJobLink link = WsDiJobLinkConvert.INSTANCE.toDo(diJobLink); - return diJobLinkMapper.insert(link); - } - - @Override - public int upsert(WsDiJobLinkDTO diJobLink) { - WsDiJobLink link = diJobLinkMapper.selectOne( - new LambdaQueryWrapper() - .eq(WsDiJobLink::getJobId, diJobLink.getJobId()) - .eq(WsDiJobLink::getLinkCode, diJobLink.getLinkCode()) - ); - WsDiJobLink jobLink = WsDiJobLinkConvert.INSTANCE.toDo(diJobLink); - if (link == null) { - return diJobLinkMapper.insert(jobLink); - } else { - return diJobLinkMapper.update(jobLink, - new LambdaUpdateWrapper() - .eq(WsDiJobLink::getJobId, jobLink.getJobId()) - .eq(WsDiJobLink::getLinkCode, jobLink.getLinkCode()) - ); - } - } - - @Override - public int deleteByProjectId(Collection projectIds) { - return diJobLinkMapper.deleteByProjectId(projectIds); - } - - @Override - public int deleteByJobId(Collection jobIds) { - return diJobLinkMapper.deleteByJobId(jobIds); - } - - @Override - public int deleteSurplusLink(Long jobId, List linkCodeList) { - return diJobLinkMapper.delete( - new LambdaQueryWrapper() - .eq(WsDiJobLink::getJobId, jobId) - .notIn(CollectionUtil.isNotEmpty(linkCodeList), WsDiJobLink::getLinkCode, - linkCodeList) - ); - } - - @Override - public int clone(Long sourceJobId, Long targetJobId) { - return diJobLinkMapper.clone(sourceJobId, targetJobId); - } -} diff --git a/scaleph-engine/scaleph-engine-seatunnel/src/main/java/cn/sliew/scaleph/engine/seatunnel/service/impl/WsDiJobServiceImpl.java b/scaleph-engine/scaleph-engine-seatunnel/src/main/java/cn/sliew/scaleph/engine/seatunnel/service/impl/WsDiJobServiceImpl.java index 1ac7d0445..ede785e02 100644 --- a/scaleph-engine/scaleph-engine-seatunnel/src/main/java/cn/sliew/scaleph/engine/seatunnel/service/impl/WsDiJobServiceImpl.java +++ b/scaleph-engine/scaleph-engine-seatunnel/src/main/java/cn/sliew/scaleph/engine/seatunnel/service/impl/WsDiJobServiceImpl.java @@ -30,8 +30,6 @@ import cn.sliew.scaleph.dao.DataSourceConstants; import cn.sliew.scaleph.dao.entity.master.ws.WsDiJob; import cn.sliew.scaleph.dao.mapper.master.ws.WsDiJobMapper; -import cn.sliew.scaleph.engine.seatunnel.service.WsDiJobAttrService; -import cn.sliew.scaleph.engine.seatunnel.service.WsDiJobGraphService; import cn.sliew.scaleph.engine.seatunnel.service.WsDiJobService; import cn.sliew.scaleph.engine.seatunnel.service.convert.WsDiJobAttrVOConvert; import cn.sliew.scaleph.engine.seatunnel.service.convert.WsDiJobConvert; @@ -51,7 +49,6 @@ import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; -import java.util.Collections; import java.util.List; import java.util.UUID; import java.util.stream.Collectors; diff --git a/scaleph-engine/scaleph-engine-seatunnel/src/main/java/cn/sliew/scaleph/engine/seatunnel/service/impl/WsDiJobStepServiceImpl.java b/scaleph-engine/scaleph-engine-seatunnel/src/main/java/cn/sliew/scaleph/engine/seatunnel/service/impl/WsDiJobStepServiceImpl.java deleted file mode 100644 index 5c29e6519..000000000 --- a/scaleph-engine/scaleph-engine-seatunnel/src/main/java/cn/sliew/scaleph/engine/seatunnel/service/impl/WsDiJobStepServiceImpl.java +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package cn.sliew.scaleph.engine.seatunnel.service.impl; - -import cn.hutool.core.collection.CollectionUtil; -import cn.sliew.scaleph.dao.entity.master.ws.WsDiJobStep; -import cn.sliew.scaleph.dao.mapper.master.ws.WsDiJobStepMapper; -import cn.sliew.scaleph.engine.seatunnel.service.WsDiJobStepService; -import cn.sliew.scaleph.engine.seatunnel.service.convert.WsDiJobStepConvert; -import cn.sliew.scaleph.engine.seatunnel.service.dto.WsDiJobStepDTO; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.util.Collection; -import java.util.List; - -/** - * @author gleiyu - */ -@Service -public class WsDiJobStepServiceImpl implements WsDiJobStepService { - - @Autowired - private WsDiJobStepMapper diJobStepMapper; - - @Override - public List listJobStep(Long jobId) { - List list = diJobStepMapper.selectByJobId(jobId); - return WsDiJobStepConvert.INSTANCE.toDto(list); - } - - @Override - public WsDiJobStepDTO selectOne(Long jobId, String stepCode) { - WsDiJobStep step = diJobStepMapper.selectOne( - new LambdaQueryWrapper() - .eq(WsDiJobStep::getJobId, jobId) - .eq(WsDiJobStep::getStepCode, stepCode) - ); - return WsDiJobStepConvert.INSTANCE.toDto(step); - } - - @Override - public int update(WsDiJobStepDTO wsDiJobStepDTO) { - WsDiJobStep step = WsDiJobStepConvert.INSTANCE.toDo(wsDiJobStepDTO); - LambdaUpdateWrapper updateWrapper = new LambdaUpdateWrapper() - .eq(WsDiJobStep::getJobId, step.getJobId()) - .eq(WsDiJobStep::getStepCode, step.getStepCode()); - return diJobStepMapper.update(step, updateWrapper); - } - - @Override - public int upsert(WsDiJobStepDTO diJobStep) { - LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper() - .eq(WsDiJobStep::getJobId, diJobStep.getJobId()) - .eq(WsDiJobStep::getStepCode, diJobStep.getStepCode()); - WsDiJobStep step = diJobStepMapper.selectOne(queryWrapper); - WsDiJobStep jobStep = WsDiJobStepConvert.INSTANCE.toDo(diJobStep); - if (step == null) { - return diJobStepMapper.insert(jobStep); - } - return diJobStepMapper.update(jobStep, - new LambdaUpdateWrapper() - .eq(WsDiJobStep::getJobId, jobStep.getJobId()) - .eq(WsDiJobStep::getStepCode, jobStep.getStepCode()) - ); - } - - @Override - public int deleteByProjectId(Collection projectIds) { - return diJobStepMapper.deleteByProjectId(projectIds); - } - - @Override - public int deleteByJobId(Collection jobIds) { - return diJobStepMapper.deleteByJobId(jobIds); - } - - @Override - public int deleteSurplusStep(Long jobId, List stepCodeList) { - return diJobStepMapper.delete( - new LambdaQueryWrapper() - .eq(WsDiJobStep::getJobId, jobId) - .notIn(CollectionUtil.isNotEmpty(stepCodeList), WsDiJobStep::getStepCode, - stepCodeList) - ); - } - - @Override - public int clone(Long sourceJobId, Long targetJobId) { - return diJobStepMapper.clone(sourceJobId, targetJobId); - } -} diff --git a/tools/docker/mysql/init.d/scaleph-ws-mysql.sql b/tools/docker/mysql/init.d/scaleph-ws-mysql.sql index 14f94984b..24a307081 100644 --- a/tools/docker/mysql/init.d/scaleph-ws-mysql.sql +++ b/tools/docker/mysql/init.d/scaleph-ws-mysql.sql @@ -146,85 +146,6 @@ VALUES (1, 4, 'seatunnel', 'b8e16c94-258c-4487-a88c-8aad40a38b35', 1, 1, 'sys', INSERT INTO ws_di_job(id, flink_artifact_id, job_engine, job_id, dag_id, current, creator, editor) VALUES (2, 5, 'seatunnel', '0a6d475e-ed50-46ee-82af-3ef90b7d8509', 2, 1, 'sys', 'sys'); -drop table if exists ws_di_job_attr; -create table ws_di_job_attr -( - id bigint not null auto_increment comment '自增主键', - job_id bigint not null comment '作业id', - job_attr_type varchar(4) not null comment '作业参数类型', - job_attr_key varchar(128) not null comment '作业参数key', - job_attr_value varchar(512) comment '作业参数value', - creator varchar(32) comment '创建人', - create_time timestamp default current_timestamp comment '创建时间', - editor varchar(32) comment '修改人', - update_time timestamp default current_timestamp on update current_timestamp comment '修改时间', - primary key (id), - unique key (job_id, job_attr_type, job_attr_key) -) engine = innodb comment '数据集成-作业参数'; - -/* 作业步骤信息 包含source,transform,sink 等*/ -drop table if exists ws_di_job_step; -create table ws_di_job_step -( - id bigint not null auto_increment comment '自增主键', - job_id bigint not null comment '作业id', - step_code varchar(36) not null comment '步骤编码', - step_title varchar(128) not null comment '步骤标题', - step_type varchar(12) not null comment '步骤类型', - step_name varchar(128) not null comment '步骤名称', - position_x int not null comment 'x坐标', - position_y int not null comment 'y坐标', - step_attrs mediumtext comment '作业步骤属性', - creator varchar(32) comment '创建人', - create_time timestamp default current_timestamp comment '创建时间', - editor varchar(32) comment '修改人', - update_time timestamp default current_timestamp on update current_timestamp comment '修改时间', - primary key (id), - unique key (job_id, step_code) -) engine = innodb comment '数据集成-作业步骤信息'; -INSERT INTO ws_di_job_step (job_id, step_code, step_title, step_type, step_name, position_x, position_y, - step_attrs, creator, editor) -VALUES (1, 'f3e02087-91fa-494d-86f4-694970a49ebd', 'Jdbc Source', 'source', 'Jdbc', -400, -320, - '{\"stepTitle\":\"Jdbc Source\",\"dataSourceType\":\"MySQL\",\"dataSource\":2,\"query\":\"select * from sample_data_e_commerce\"}', - 'sys', 'sys'); -INSERT INTO ws_di_job_step (job_id, step_code, step_title, step_type, step_name, position_x, position_y, - step_attrs, creator, editor) -VALUES (1, '68834928-2a32-427a-a864-83b6b5848e04', 'Jdbc Sink', 'sink', 'Jdbc', -310, -120, - '{\"stepTitle\":\"Jdbc Sink\",\"dataSourceType\":\"MySQL\",\"dataSource\":2,\"batch_size\":300,\"batch_interval_ms\":1000,\"max_retries\":3,\"is_exactly_once\":false,\"query\":\"insert into sample_data_e_commerce_duplicate ( id, invoice_no, stock_code, description, quantity, invoice_date, unit_price, customer_id, country )\\nvalues (?,?,?,?,?,?,?,?,?)\"}', - 'sys', 'sys'); -INSERT INTO ws_di_job_step(job_id, step_code, step_title, step_type, step_name, position_x, position_y, - step_attrs, creator, editor) -VALUES (2, '6223c6c3-b552-4c69-adab-5300b7514fad', 'Fake Source', 'source', 'FakeSource', -400, -320, - '{\"stepTitle\":\"Fake Source\",\"fields\":[{\"field\":\"c_string\",\"type\":\"string\"},{\"field\":\"c_boolean\",\"type\":\"boolean\"},{\"field\":\"c_tinyint\",\"type\":\"tinyint\"},{\"field\":\"c_smallint\",\"type\":\"smallint\"},{\"field\":\"c_int\",\"type\":\"int\"},{\"field\":\"c_bigint\",\"type\":\"bigint\"},{\"field\":\"c_float\",\"type\":\"float\"},{\"field\":\"c_double\",\"type\":\"double\"},{\"field\":\"c_decimal\",\"type\":\"decimal(30, 8)\"},{\"field\":\"c_bytes\",\"type\":\"bytes\"},{\"field\":\"c_map\",\"type\":\"map\"},{\"field\":\"c_date\",\"type\":\"date\"},{\"field\":\"c_time\",\"type\":\"time\"},{\"field\":\"c_timestamp\",\"type\":\"timestamp\"}],\"schema\":\"{\\\"fields\\\":{\\\"c_string\\\":\\\"string\\\",\\\"c_boolean\\\":\\\"boolean\\\",\\\"c_tinyint\\\":\\\"tinyint\\\",\\\"c_smallint\\\":\\\"smallint\\\",\\\"c_int\\\":\\\"int\\\",\\\"c_bigint\\\":\\\"bigint\\\",\\\"c_float\\\":\\\"float\\\",\\\"c_double\\\":\\\"double\\\",\\\"c_decimal\\\":\\\"decimal(30, 8)\\\",\\\"c_bytes\\\":\\\"bytes\\\",\\\"c_map\\\":\\\"map\\\",\\\"c_date\\\":\\\"date\\\",\\\"c_time\\\":\\\"time\\\",\\\"c_timestamp\\\":\\\"timestamp\\\"}}\"}', - 'sys', 'sys'); -INSERT INTO ws_di_job_step(job_id, step_code, step_title, step_type, step_name, position_x, position_y, - step_attrs, creator, editor) -VALUES (2, 'f08143b4-34dc-4190-8723-e8d8ce49738f', 'Console Sink', 'sink', 'Console', -320, -120, - '{\"stepTitle\":\"Console Sink\"}', 'sys', 'sys'); - -/* 作业连线信息 */ -drop table if exists ws_di_job_link; -create table ws_di_job_link -( - id bigint not null auto_increment comment '自增主键', - job_id bigint not null comment '作业id', - link_code varchar(36) not null comment '作业连线编码', - from_step_code varchar(36) not null comment '源步骤编码', - to_step_code varchar(36) not null comment '目标步骤编码', - creator varchar(32) comment '创建人', - create_time timestamp default current_timestamp comment '创建时间', - editor varchar(32) comment '修改人', - update_time timestamp default current_timestamp on update current_timestamp comment '修改时间', - primary key (id), - key (job_id) -) engine = innodb comment '数据集成-作业连线'; -INSERT INTO ws_di_job_link (job_id, link_code, from_step_code, to_step_code, creator, editor) -VALUES (1, 'fabfda41-aacb-4a19-b5ef-9e84a75ed4e9', 'f3e02087-91fa-494d-86f4-694970a49ebd', - '68834928-2a32-427a-a864-83b6b5848e04', 'sys', 'sys'); -INSERT INTO ws_di_job_link(job_id, link_code, from_step_code, to_step_code, creator, editor) -VALUES (2, 'd57021a1-65c7-4dfe-ae89-3b73d00fcf72', '6223c6c3-b552-4c69-adab-5300b7514fad', - 'f08143b4-34dc-4190-8723-e8d8ce49738f', 'sys', 'sys'); - DROP TABLE IF EXISTS ws_flink_kubernetes_template; CREATE TABLE ws_flink_kubernetes_template (