指标库:列表中点击衍生获取原子指标配置
This commit is contained in:
parent
8585429bc5
commit
112c70fa4e
@ -89,4 +89,15 @@ public class TargetController {
|
|||||||
targetService.deleteTargetById(params);
|
targetService.deleteTargetById(params);
|
||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "获取原子指标配置(指标库列表中点击衍生)")
|
||||||
|
@PostMapping("/getDetailExpandTarget")
|
||||||
|
public R<JSONObject> getDetailExpandTarget(@RequestBody JSONObject params) {
|
||||||
|
JSONObject result;
|
||||||
|
result = targetService.getDetailExpandTarget(params);
|
||||||
|
Page<?> list = tableColumnService.getDataByTableName(result.getJSONObject("list"));
|
||||||
|
result.put("list", list);
|
||||||
|
result.put("columnList", tableColumnService.getColumnsByTableName(result.getString("tableName")));
|
||||||
|
return R.ok(result);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -28,4 +28,6 @@ public interface TargetService extends IService<Target> {
|
|||||||
Page<?> getDataByParam(JSONObject params);
|
Page<?> getDataByParam(JSONObject params);
|
||||||
|
|
||||||
void deleteTargetById(JSONObject params);
|
void deleteTargetById(JSONObject params);
|
||||||
|
|
||||||
|
JSONObject getDetailExpandTarget(JSONObject params);
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
package iet.ustb.sf.service.impl;
|
package iet.ustb.sf.service.impl;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSON;
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
@ -19,7 +18,6 @@ import iet.ustb.sf.util.CheckUtils;
|
|||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
import org.apache.commons.lang3.SerializationUtils;
|
import org.apache.commons.lang3.SerializationUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
@ -60,7 +58,8 @@ public class TargetServiceImpl extends ServiceImpl<TargetMapper, Target>
|
|||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private RuleMapper ruleMapper;
|
private RuleMapper ruleMapper;
|
||||||
@Autowired
|
|
||||||
|
@Resource
|
||||||
private MonitorMapper monitorMapper;
|
private MonitorMapper monitorMapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -441,6 +440,20 @@ public class TargetServiceImpl extends ServiceImpl<TargetMapper, Target>
|
|||||||
monitorMapper.delete(new QueryWrapper<Monitor>().eq("target_id", id));
|
monitorMapper.delete(new QueryWrapper<Monitor>().eq("target_id", id));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public JSONObject getDetailExpandTarget(JSONObject params) {
|
||||||
|
Target target = params.getObject("target", Target.class);
|
||||||
|
String id = target.getId();
|
||||||
|
CheckUtils.checkEmpty(id, "指标ID");
|
||||||
|
target = targetMapper.selectById(id);
|
||||||
|
List<TargetOption> optionList = new ArrayList<>();
|
||||||
|
while (id != null) {
|
||||||
|
optionList.addAll(0, targetOptionMapper.selectList(new QueryWrapper<TargetOption>().eq("target_id", id)));
|
||||||
|
id = target.getParent();
|
||||||
|
}
|
||||||
|
return getDetailTarget(optionList, target);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查看指标详情
|
* 查看指标详情
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user