Commit 2d72b7b0 authored by mcb's avatar mcb

commit

parent 20162665
...@@ -285,6 +285,30 @@ public class OfflineSynchController { ...@@ -285,6 +285,30 @@ public class OfflineSynchController {
return list; return list;
} }
/**
* 离线任务详情--编辑回显
*
* @return
* @author Bellamy
*/
@ApiOperation(value = "离线任务详情--编辑回显", notes = "离线任务详情--编辑回显")
@GetMapping(value = "/getSyncTaskInfoById")
@ApiImplicitParam(name = "id",value = "离线任务id",required = true)
public JsonResult getSyncTaskInfoById(@RequestParam String id) throws Exception {
if(StringUtils.isEmpty(id)){
return JsonResult.error(ResultCode.PARAMS_ERROR,"id不能为空");
}
JsonResult list = new JsonResult();
try {
list = offlineSynchService.querySyncTaskInfoById(id);
} catch (Exception e) {
list.setCode(ResultCode.INTERNAL_SERVER_ERROR);
list.setMessage("failed!");
e.printStackTrace();
}
return list;
}
/** /**
* 编辑离线任务数据 * 编辑离线任务数据
* *
......
...@@ -138,4 +138,12 @@ public interface OfflineSynchService { ...@@ -138,4 +138,12 @@ public interface OfflineSynchService {
* @author Bellamy * @author Bellamy
*/ */
JsonResult getSyncSoureAndTargetColumns(Map<String, List<SynchTableColumnsReq>> req) throws Exception; JsonResult getSyncSoureAndTargetColumns(Map<String, List<SynchTableColumnsReq>> req) throws Exception;
/**
* 离线任务详情--编辑回显
*
* @return
* @author Bellamy
*/
JsonResult querySyncTaskInfoById(String id) throws Exception;
} }
...@@ -172,7 +172,7 @@ public class OfflineSynchServiceImpl implements OfflineSynchService { ...@@ -172,7 +172,7 @@ public class OfflineSynchServiceImpl implements OfflineSynchService {
Map<String, Object> map = offlineSynchDao.selectNavigationTreeByTaskId(taskId); Map<String, Object> map = offlineSynchDao.selectNavigationTreeByTaskId(taskId);
if (map.size() > 0 && map != null) { if (map.size() > 0 && map != null) {
Integer execId = this.publish(map); Integer execId = this.publish(map);
if (execId!=null) { if (execId != null) {
flag = true; flag = true;
} }
...@@ -647,15 +647,17 @@ public class OfflineSynchServiceImpl implements OfflineSynchService { ...@@ -647,15 +647,17 @@ public class OfflineSynchServiceImpl implements OfflineSynchService {
//更新规则信息 //更新规则信息
List<Map> taskRules = (List<Map>) body.get("taskRules"); List<Map> taskRules = (List<Map>) body.get("taskRules");
//判断taskId是否存在,存在编辑,不存在新增 //判断taskId是否存在,存在编辑,不存在新增
Integer id = null;
if (StringUtils.isEmpty(taskId)) { if (StringUtils.isEmpty(taskId)) {
task.setVersion("1.0"); task.setVersion("1.0");
task.setCreateUserId(SessionUtils.getCurrentUserId()); task.setCreateUserId(SessionUtils.getCurrentUserId());
task.setCreateTime(new Date()); task.setCreateTime(new Date());
dmpDevelopTaskDao.insert(task); //新增任务数据 dmpDevelopTaskDao.insert(task); //新增任务数据
id = task.getId();
logger.info("======== save sync task end ========"); logger.info("======== save sync task end ========");
this.saveTaskHistory(task); //保存任务历史版本 this.saveTaskHistory(task); //保存任务历史版本
//保存dmp数据校验规则信息 //保存dmp数据校验规则信息
settRuleInfo(taskId, taskRules, list); settRuleInfo(task.getId().toString(), taskRules, list);
} else { } else {
DmpDevelopTask devTask = dmpDevelopTaskDao.selectTaskById(taskId); DmpDevelopTask devTask = dmpDevelopTaskDao.selectTaskById(taskId);
BigDecimal version = new BigDecimal(devTask.getVersion()); BigDecimal version = new BigDecimal(devTask.getVersion());
...@@ -665,6 +667,7 @@ public class OfflineSynchServiceImpl implements OfflineSynchService { ...@@ -665,6 +667,7 @@ public class OfflineSynchServiceImpl implements OfflineSynchService {
task.setUpdateUserId(SessionUtils.getCurrentUserId()); task.setUpdateUserId(SessionUtils.getCurrentUserId());
task.setId(Integer.valueOf(taskId)); task.setId(Integer.valueOf(taskId));
dmpDevelopTaskDao.update(task); dmpDevelopTaskDao.update(task);
id = task.getId();
logger.info("======== edit sync task end ========"); logger.info("======== edit sync task end ========");
this.saveTaskHistory(task); //保存任务历史版本 this.saveTaskHistory(task); //保存任务历史版本
//更新规则信息 //更新规则信息
...@@ -679,7 +682,9 @@ public class OfflineSynchServiceImpl implements OfflineSynchService { ...@@ -679,7 +682,9 @@ public class OfflineSynchServiceImpl implements OfflineSynchService {
} }
//保存时提交XML //保存时提交XML
//dmpDevelopTaskService.submitSyncing(task); //dmpDevelopTaskService.submitSyncing(task);
return JsonResult.ok(); Map map = new HashMap();
map.put("id", id);
return JsonResult.ok(map);
} }
/** /**
...@@ -1036,4 +1041,17 @@ public class OfflineSynchServiceImpl implements OfflineSynchService { ...@@ -1036,4 +1041,17 @@ public class OfflineSynchServiceImpl implements OfflineSynchService {
return JsonResult.ok(data); return JsonResult.ok(data);
} }
/**
* 离线任务详情--编辑回显
*
* @return
* @author Bellamy
*/
@Override
public JsonResult querySyncTaskInfoById(String id) throws Exception {
DmpDevelopTask dmpDevelopTask = dmpDevelopTaskDao.selectTaskById(id);
return JsonResult.ok(dmpDevelopTask);
}
} }
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
<sql id="FIND_ALL_COLUMN"> <sql id="FIND_ALL_COLUMN">
id,task_type,type,schedule_type,is_submit,task_desc,script,data_status,create_user_id,create_time,update_user_id,update_time,tree_id,flow_header, id,task_type,type,schedule_type,is_submit,task_desc,script,data_status,create_user_id,create_time,update_user_id,update_time,tree_id,flow_header,
flow_json, version, publish_version, is_gziped flow_json, version, publish_version, is_gziped,source_db_id,target_db_name,target_table_name,source_db_name,source_table_name
</sql> </sql>
<select id="getDmpTaskAndTreeInfo" parameterType="string" resultType="map"> <select id="getDmpTaskAndTreeInfo" parameterType="string" resultType="map">
......
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