Commit 69644f84 authored by mcb's avatar mcb

no message

parent be5c85f8
......@@ -183,4 +183,16 @@ public class OfflineSynchController {
JsonResult list = offlineSynchService.addSyncTask(syncDmpTaskAddReq);
return list;
}
/**
* 编辑离线任务数据
*
* @return
*/
@ApiOperation(value = "编辑离线任务数据", notes = "编辑离线任务数据")
@PostMapping(value = "/addSyncTask")
public JsonResult updateSyncTask(@RequestBody @Validated SyncDmpTaskAddReq syncDmpTaskAddReq) throws Exception {
JsonResult list = offlineSynchService.updateSyncTask(syncDmpTaskAddReq);
return list;
}
}
......@@ -37,4 +37,6 @@ public interface OfflineSynchService {
PageInfoResponse<DvRuleTDto> queryJyRuleListPage(BasePageBean basePageBean, HttpServletRequest httpRequest) throws Exception;
JsonResult addSyncTask(SyncDmpTaskAddReq syncDmpTaskAddReq) throws Exception;
JsonResult updateSyncTask(SyncDmpTaskAddReq syncDmpTaskAddReq) throws Exception;
}
......@@ -242,6 +242,8 @@ public class OfflineSynchServiceImpl implements OfflineSynchService {
/**
* 任务状态查看,异步调用azkaban服务
* @Author Bellamy
* @Date 2020/12/20
*/
@Override
public JsonResult<List<CheckTaskStatusPageDto>> queryCheckTaskStatusListPage(CheckTaskStatusPageReq checkTaskStatusPageReq) throws Exception {
......@@ -428,7 +430,8 @@ public class OfflineSynchServiceImpl implements OfflineSynchService {
/**
* 添加保存dmp数据(包含校验数据)
*
* @Author Bellamy
* @Date 2020/12/20
* @param syncDmpTaskAddReq
* @return
*/
......@@ -445,14 +448,32 @@ public class OfflineSynchServiceImpl implements OfflineSynchService {
return new JsonResult(ResultCode.SUCCESS, result);
}
/*
*编辑离线任务数据
* @Author Bellamy
* @Date 2020/12/30
* */
@Override
@Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRES_NEW)
public JsonResult updateSyncTask(SyncDmpTaskAddReq syncDmpTaskAddReq) throws Exception {
List<Map<String, Object>> result = new ArrayList<>();
Map<String, Object> reqParam = syncDmpTaskAddReq.getParams();
if (reqParam.size() > 0 && reqParam != null) {
JsonResult jsonResult = addSyncing(reqParam);
DmpDevelopTask data = (DmpDevelopTask) jsonResult.getData();
saveRuleInfo(result, reqParam, jsonResult, String.valueOf(data.getId()));
}
return new JsonResult(ResultCode.SUCCESS, result);
}
/**
* 添加保存离线任务dmp数据
*
* @param body
* @return
*/
public JsonResult addSyncing(Map<String, Object> body) throws Exception {
Integer projectId = Integer.valueOf(body.get("projectId").toString()) ;
public JsonResult addSyncing(Map<String, Object> body) throws Exception {
Integer projectId = Integer.valueOf(body.get("projectId").toString());
Integer parentId = Integer.valueOf(body.get("parentId").toString()); //父节点ID
String taskName = (String) body.get("taskName"); //任务名称 业务节点名称 一对一
Integer treeId = Integer.valueOf(body.get("treeId").toString()); //树节点ID
......@@ -559,7 +580,7 @@ public class OfflineSynchServiceImpl implements OfflineSynchService {
* @param list
* @throws Exception
*/
private void settRuleInfo(String taskId, List<Map> rules, List<DvTaskRuleT> list) throws Exception {
private void settRuleInfo(String taskId, List<Map> rules, List<DvTaskRuleT> list) throws Exception {
for (Map rule : rules) {
DvTaskRuleT taskRuleT = new DvTaskRuleT();
Integer ruleId = Integer.valueOf(rule.get("ruleId").toString());
......
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