Commit cf6855ab by zhouhaibao

[+]数据源修复

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