Commit cf6855ab by zhouhaibao

[+]数据源修复

1 parent 096e8ab0
...@@ -7,5 +7,5 @@ import org.apache.ibatis.annotations.Param; ...@@ -7,5 +7,5 @@ import org.apache.ibatis.annotations.Param;
@Mapper @Mapper
public interface SopDataSourceMapper extends CommonBaseMapper<SopDataSource> { public interface SopDataSourceMapper extends CommonBaseMapper<SopDataSource> {
SopDataSource findByName(@Param("name") String name); SopDataSource findByDataSourceId(@Param("dataSourceId") String dataSourceId);
} }
\ No newline at end of file \ No newline at end of file
...@@ -21,7 +21,7 @@ import lombok.extern.slf4j.Slf4j; ...@@ -21,7 +21,7 @@ import lombok.extern.slf4j.Slf4j;
@Slf4j @Slf4j
@Tag(name = "SOP模板开放接口") @Tag(name = "SOP模板开放接口")
@RestController @RestController
@RequestMapping(value = "/sop/sopTpls") @RequestMapping(value = "/sop/api/sopTpls")
@ResponseResultBody @ResponseResultBody
public class SopTplController extends BaseController { public class SopTplController extends BaseController {
......
...@@ -44,11 +44,11 @@ public class TestXXLJobController { ...@@ -44,11 +44,11 @@ public class TestXXLJobController {
@PostMapping("/jobtestupdate") @PostMapping("/jobtestupdate")
@Operation(summary = "动态任务更新", description = "动态任务更新") @Operation(summary = "动态任务更新", description = "动态任务更新")
public void updatetest(@RequestParam("cron") String cron, public void updatetest(@RequestParam(value = "cron", required = false) String cron,
@RequestParam("id") String id, @RequestParam("id") String id,
@RequestParam("executorParam") String executorParam, @RequestParam(value = "executorParam", required = false) String executorParam,
@RequestParam("jobDesc") String jobDesc, @RequestParam(value = "jobDesc", required = false) String jobDesc,
@RequestParam("triggerStatus") Integer triggerStatus) { @RequestParam(value = "triggerStatus", required = false) Integer triggerStatus) {
XxlJobInfo jobInfo = new XxlJobInfo(); XxlJobInfo jobInfo = new XxlJobInfo();
jobInfo.setBusKey(id); jobInfo.setBusKey(id);
jobInfo.setScheduleConf(cron); jobInfo.setScheduleConf(cron);
......
...@@ -16,8 +16,8 @@ public class SopDataSourceService { ...@@ -16,8 +16,8 @@ public class SopDataSourceService {
return sopDataSourceMapper.selectByPrimaryKey(id); return sopDataSourceMapper.selectByPrimaryKey(id);
}; };
public SopDataSource findByName(String name) { public SopDataSource findByDataSourceId(String dataSourceId) {
return sopDataSourceMapper.findByName(name); return sopDataSourceMapper.findByDataSourceId(dataSourceId);
} }
} }
...@@ -40,7 +40,7 @@ public class SqlExecutor implements SopNodeExecutor { ...@@ -40,7 +40,7 @@ public class SqlExecutor implements SopNodeExecutor {
String dataSourceId = paramMap.get("dataSourceId") + ""; String dataSourceId = paramMap.get("dataSourceId") + "";
// 执行sql插件 // 执行sql插件
SopDataSource byId = sopDataSourceService.findByName(dataSourceId); SopDataSource byId = sopDataSourceService.findByDataSourceId(dataSourceId);
SopBizAdapter mcgBizAdapter = new FlowDataAdapterImpl(byId); SopBizAdapter mcgBizAdapter = new FlowDataAdapterImpl(byId);
String sql = FreemarkerUtil.processContent(sqlTemplate, executeStruct.toMap()); String sql = FreemarkerUtil.processContent(sqlTemplate, executeStruct.toMap());
......
...@@ -38,7 +38,7 @@ public class SqlQueryExecutor implements SopNodeExecutor { ...@@ -38,7 +38,7 @@ public class SqlQueryExecutor implements SopNodeExecutor {
String dataSourceId = paramMap.get("dataSourceId") + ""; String dataSourceId = paramMap.get("dataSourceId") + "";
// 执行sql插件 // 执行sql插件
SopDataSource byId = sopDataSourceService.findByName(dataSourceId); SopDataSource byId = sopDataSourceService.findByDataSourceId(dataSourceId);
SopBizAdapter mcgBizAdapter = new FlowDataAdapterImpl(byId); SopBizAdapter mcgBizAdapter = new FlowDataAdapterImpl(byId);
String sql = FreemarkerUtil.processContent(sqlTemplate, executeStruct.toMap()); String sql = FreemarkerUtil.processContent(sqlTemplate, executeStruct.toMap());
......
...@@ -33,6 +33,11 @@ public class ControllerRopHttpDemo { ...@@ -33,6 +33,11 @@ public class ControllerRopHttpDemo {
String nodeName = jsonObject.get("nodeName") + ""; String nodeName = jsonObject.get("nodeName") + "";
// TODO 组装任务需要的参数 // TODO 组装任务需要的参数
JSONObject instSnapshotData = JSONObject.parseObject(instSnapshot);
// //
MultiValueMap<String, String> multiValueMap = new LinkedMultiValueMap<>(); MultiValueMap<String, String> multiValueMap = new LinkedMultiValueMap<>();
...@@ -49,6 +54,4 @@ public class ControllerRopHttpDemo { ...@@ -49,6 +54,4 @@ public class ControllerRopHttpDemo {
return (JSONObject) JSONObject.toJSON(post); return (JSONObject) JSONObject.toJSON(post);
} }
} }
\ No newline at end of file \ No newline at end of file
...@@ -14,11 +14,11 @@ ...@@ -14,11 +14,11 @@
<result column="name" jdbcType="VARCHAR" property="name" /> <result column="name" jdbcType="VARCHAR" property="name" />
<result column="db_name" jdbcType="VARCHAR" property="dbName" /> <result column="db_name" jdbcType="VARCHAR" property="dbName" />
</resultMap> </resultMap>
<select id="findByName" resultMap="BaseResultMap" <select id="findByDataSourceId" resultMap="BaseResultMap"
parameterType="java.lang.String"> parameterType="java.lang.String">
select * select *
from sop_data_source from sop_data_source
where name = #{name} where data_source_id = #{dataSourceId}
</select> </select>
</mapper> </mapper>
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!