Commit 4fba45b1 authored by sml's avatar sml

冲突提交

parents 1d492b05 da644070
package com.jz.dmp.modules.controller.dataOperation;
import com.jz.common.constant.JsonResult;
import com.jz.common.constant.ResultCode;
import com.jz.common.page.PageInfoResponse;
import com.jz.dmp.modules.controller.dataOperation.bean.DataDevTaskListDto;
import com.jz.dmp.modules.controller.dataOperation.bean.DataDevTaskListReq;
import com.jz.dmp.modules.service.DmpDevelopTaskService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
/**
* 数据运维-数据开发实例
*
* @author Bellamy
* @since 2021-01-13 10:56:18
*/
@RestController
@RequestMapping("/dataDevExamples")
@Api(tags = "数据运维-数据开发实例")
public class DmpDevExamplesController {
@Autowired
private DmpDevelopTaskService dmpDevelopTaskService;
/**
* 列表分页查询
*
* @return
* @author Bellamy
* @since 2021-01-05
*/
@ApiOperation(value = "列表分页查询", notes = "列表分页查询")
@PostMapping(value = "/listPage")
public PageInfoResponse<DataDevTaskListDto> getDevTaskListPage(@RequestBody @Validated DataDevTaskListReq req, HttpServletRequest httpRequest) throws Exception {
PageInfoResponse<DataDevTaskListDto> pageInfo = new PageInfoResponse<DataDevTaskListDto>();
if (StringUtils.isEmpty(req.getProjectId())) {
pageInfo.setMessage("项目id不能为空!");
pageInfo.setCode(ResultCode.PARAMS_ERROR);
return pageInfo;
}
try {
pageInfo = dmpDevelopTaskService.queryDevTaskListPage(req);
} catch (Exception e) {
pageInfo.setMessage("查询失败");
pageInfo.setCode(ResultCode.INTERNAL_SERVER_ERROR);
e.printStackTrace();
}
return pageInfo;
}
}
package com.jz.dmp.modules.controller.dataOperation; package com.jz.dmp.modules.controller.dataOperation;
import com.jz.common.constant.JsonResult;
import com.jz.common.constant.ResultCode; import com.jz.common.constant.ResultCode;
import com.jz.common.page.PageInfoResponse; import com.jz.common.page.PageInfoResponse;
import com.jz.dmp.modules.controller.DataIntegration.bean.RealTimeSyncListDto; import com.jz.dmp.modules.controller.DataIntegration.bean.RealTimeSyncListDto;
...@@ -8,14 +9,12 @@ import com.jz.dmp.modules.controller.dataOperation.bean.DataDevTaskListDto; ...@@ -8,14 +9,12 @@ import com.jz.dmp.modules.controller.dataOperation.bean.DataDevTaskListDto;
import com.jz.dmp.modules.controller.dataOperation.bean.DataDevTaskListReq; import com.jz.dmp.modules.controller.dataOperation.bean.DataDevTaskListReq;
import com.jz.dmp.modules.service.DmpDevelopTaskService; import com.jz.dmp.modules.service.DmpDevelopTaskService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
...@@ -58,4 +57,21 @@ public class DmpDevTaskController { ...@@ -58,4 +57,21 @@ public class DmpDevTaskController {
} }
return pageInfo; return pageInfo;
} }
/**
* 执行任务
*
* @return
* @author Bellamy
*/
@ApiOperation(value = "执行", notes = "执行")
@GetMapping(value = "/runTask")
@ApiImplicitParam(name = "taskId", value = "任务id")
public JsonResult runTaskByTaskId(@RequestParam(value = "taskId") String taskId) throws Exception {
if (StringUtils.isEmpty(taskId)) {
return new JsonResult(ResultCode.PARAMS_ERROR,"任务id不能为空!");
}
JsonResult list = dmpDevelopTaskService.runTaskByTaskId(taskId);
return list;
}
} }
...@@ -764,18 +764,6 @@ public class DmpDevelopTaskServiceImpl implements DmpDevelopTaskService { ...@@ -764,18 +764,6 @@ public class DmpDevelopTaskServiceImpl implements DmpDevelopTaskService {
return pageInfoResponse; return pageInfoResponse;
} }
/**
* 数据运维-执行任务
*
* @return
* @author Bellamy
*/
@Override
public JsonResult runTaskByTaskId(String taskId) throws Exception {
return offlineSynchService.taskRunNowByTaskId(taskId);
}
/* /*
* (non-Javadoc) * (non-Javadoc)
* *
...@@ -926,4 +914,15 @@ public class DmpDevelopTaskServiceImpl implements DmpDevelopTaskService { ...@@ -926,4 +914,15 @@ public class DmpDevelopTaskServiceImpl implements DmpDevelopTaskService {
pageInfoResponse.setData(pageInfo); pageInfoResponse.setData(pageInfo);
return pageInfoResponse; return pageInfoResponse;
} }
/**
* 数据运维-执行任务
*
* @return
* @author Bellamy
*/
@Override
public JsonResult runTaskByTaskId(String taskId) throws Exception {
return offlineSynchService.taskRunNowByTaskId(taskId);
}
} }
\ No newline at end of file
...@@ -161,10 +161,10 @@ public class OfflineSynchServiceImpl implements OfflineSynchService { ...@@ -161,10 +161,10 @@ public class OfflineSynchServiceImpl implements OfflineSynchService {
/** /**
* 发布流程 * 发布流程
*/ */
private boolean publish(Map<String, Object> map) { private boolean publish(Map<String, Object> map) throws Exception {
String taskId = map.get("taskId").toString(); //任务id String taskId = map.get("taskId").toString(); //任务id
String projectId = map.get("projectId").toString(); //项目id String projectId = map.get("projectId").toString(); //项目id
String treeName = map.get("treeName").toString(); //流程名称 String treeName = map.get("treeName").toString(); //任务流程名称
String azkabanExectorXmlExec = map.get("azkabanExectorXmlExec").toString(); //执行数据同步任务命令 String azkabanExectorXmlExec = map.get("azkabanExectorXmlExec").toString(); //执行数据同步任务命令
String azkabanLocalTaskFilePath = map.get("azkabanLocalTaskFilePath").toString(); //文件路径 String azkabanLocalTaskFilePath = map.get("azkabanLocalTaskFilePath").toString(); //文件路径
String azkabanMonitorUrl = map.get("azkabanMonitorUrl").toString();//AZKABAN WEB服务地址 String azkabanMonitorUrl = map.get("azkabanMonitorUrl").toString();//AZKABAN WEB服务地址
......
...@@ -142,9 +142,9 @@ ...@@ -142,9 +142,9 @@
t3.AZKABAN_LOCAL_TASK_FILE_PATH as azkabanLocalTaskFilePath, t3.AZKABAN_LOCAL_TASK_FILE_PATH as azkabanLocalTaskFilePath,
t3.AZKABAN_MONITOR_URL as azkabanMonitorUrl t3.AZKABAN_MONITOR_URL as azkabanMonitorUrl
from dmp_develop_task t1 from dmp_develop_task t1
left join dmp_navigation_tree t2 on t1.TREE_ID=t2.ID inner join dmp_navigation_tree t2 on t1.TREE_ID=t2.ID
left join dmp_project_system_info t3 on t2.PROJECT_ID=t3.PROJECT_ID and t3.data_status = '1' left join dmp_project_system_info t3 on t2.PROJECT_ID=t3.PROJECT_ID and t3.data_status = '1'
where 1=1 and t1.id = #{taskId} where 1=1 and t2.id = #{taskId}
</select> </select>
<!-- 根据执行实例id查询规则执行结果表 --> <!-- 根据执行实例id查询规则执行结果表 -->
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment