Commit 69644f84 authored by mcb's avatar mcb

no message

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