区域报告接口
This commit is contained in:
@@ -10,6 +10,7 @@ import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.common.utils.LogUtil;
|
||||
import com.njcn.system.pojo.param.EventTemplateParam;
|
||||
import com.njcn.system.pojo.po.EventTemplate;
|
||||
import com.njcn.system.pojo.vo.EventReportDictVO;
|
||||
import com.njcn.system.pojo.vo.EventTemplateVO;
|
||||
import com.njcn.system.service.IEventTemplateService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
@@ -155,4 +156,23 @@ public class EventTemplateController extends BaseController{
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.DELETE_PID_UNEXIST, null, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 根据模板id查询关系
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@PostMapping("/selectReleation")
|
||||
@ApiOperation("根据模板id查询关系")
|
||||
@ApiImplicitParam(name = "id", value = "角色索引", required = true)
|
||||
public HttpResult<List<EventReportDictVO>> selectReleation(@RequestParam @Validated String id) {
|
||||
String methodDescribe = getMethodDescribe("selectReleation");
|
||||
LogUtil.njcnDebug(log, "{},查询数据为:{}", methodDescribe, id);
|
||||
List<EventReportDictVO> res = iEventTemplateService.selectReleation(id);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, res, methodDescribe);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,9 +19,11 @@ public interface TemplateRelMapper extends BaseMapper<TemplateRel> {
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
List<TemplateRel> selectRelevance(@Param("ids") List<String> ids);
|
||||
List<TemplateRel> selectRelevance (@Param("ids") List<String> ids);
|
||||
|
||||
boolean batchInsert(@Param("list") List<TemplateRel> list);
|
||||
boolean batchInsert (@Param("list") List<TemplateRel> list);
|
||||
|
||||
boolean deleteByRtId(@Param("rtId") String id);
|
||||
boolean deleteByRtId (@Param("rtId") String id);
|
||||
|
||||
List<String> selectReleation (@Param("id") String id);
|
||||
}
|
||||
|
||||
@@ -25,4 +25,11 @@
|
||||
#{item}
|
||||
</foreach>
|
||||
</select>
|
||||
<select id="selectReleation" resultType="java.lang.String">
|
||||
SELECT
|
||||
rd.Name
|
||||
FROM report_relevancy rr
|
||||
INNER JOIN report_dict rd ON rr.Rd_Id = rd.Id
|
||||
WHERE rr.Rt_Id = #{id}
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.system.pojo.param.EventTemplateParam;
|
||||
import com.njcn.system.pojo.po.EventTemplate;
|
||||
import com.njcn.system.pojo.vo.EventReportDictVO;
|
||||
import com.njcn.system.pojo.vo.EventTemplateVO;
|
||||
|
||||
import java.util.List;
|
||||
@@ -51,4 +52,6 @@ public interface IEventTemplateService extends IService<EventTemplate> {
|
||||
* @return
|
||||
*/
|
||||
Boolean selectRelevance(List<String> ids);
|
||||
|
||||
List<EventReportDictVO> selectReleation (String id);
|
||||
}
|
||||
|
||||
@@ -143,7 +143,7 @@ public class EventDictServiceImpl extends ServiceImpl<EventDictMapper, ReportDic
|
||||
queryWrapper.orderBy(true, true, "report_dict.update_time");
|
||||
}
|
||||
}
|
||||
queryWrapper.eq("report_dict.state", DataStateEnum.ENABLE.getCode());
|
||||
queryWrapper.eq("report_dict.state", DataStateEnum.ENABLE.getCode()).eq("report_dict.Type",dictQueryParam.getType());
|
||||
List<ReportDict> reportAllDicts = this.baseMapper.selectList(queryWrapper);
|
||||
List<ReportDict> reportDicts = new ArrayList<>();
|
||||
reportAllDicts.stream().filter(reportDict -> reportDict.getId().equals(dictQueryParam.getId())).forEach(reportDict -> {
|
||||
|
||||
@@ -16,6 +16,7 @@ import com.njcn.system.pojo.param.EventTemplateParam;
|
||||
import com.njcn.system.pojo.po.EventTemplate;
|
||||
import com.njcn.system.pojo.po.ReportTemplate;
|
||||
import com.njcn.system.pojo.po.TemplateRel;
|
||||
import com.njcn.system.pojo.vo.EventReportDictVO;
|
||||
import com.njcn.system.pojo.vo.EventTemplateVO;
|
||||
import com.njcn.system.service.IEventTemplateService;
|
||||
import com.njcn.web.factory.PageFactory;
|
||||
@@ -168,10 +169,23 @@ public class EventTemplateServiceImpl extends ServiceImpl<EventTemplateMapper, E
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EventReportDictVO> selectReleation(String id) {
|
||||
List<EventReportDictVO> list = new ArrayList<>();
|
||||
List<String> configs = templateRelMapper.selectReleation(id);
|
||||
configs.forEach(config -> {
|
||||
EventReportDictVO eventReportDictVO = new EventReportDictVO();
|
||||
eventReportDictVO.setName(config);
|
||||
eventReportDictVO.setFlag(true);
|
||||
list.add(eventReportDictVO);
|
||||
});
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 名称重复校验
|
||||
*/
|
||||
private void checkName(EventTemplateParam eventTemplateParam,boolean flag){
|
||||
private void checkName(EventTemplateParam eventTemplateParam,boolean flag) {
|
||||
LambdaQueryWrapper<EventTemplate> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(EventTemplate::getName,eventTemplateParam.getName())
|
||||
.eq(EventTemplate::getType,eventTemplateParam.getType());
|
||||
|
||||
Reference in New Issue
Block a user