EventTemplate控制器编写

This commit is contained in:
hanyong
2022-09-16 16:33:06 +08:00
parent 3635403a35
commit 1512674f4c
4 changed files with 11 additions and 28 deletions

View File

@@ -70,13 +70,13 @@ public class EventTemplateController extends BaseController{
}
/**
* 新增模板
* 新增
* @author hany
* @date 2022/09/09
*/
@PostMapping("/add")
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
@ApiOperation("新增模板")
@ApiOperation("新增")
@ApiImplicitParam(name = "eventTemplateParam", value = "模板数据", required = true)
public HttpResult<Boolean> add(@RequestBody EventTemplateParam eventTemplateParam){
String methodDescribe = getMethodDescribe("add");
@@ -98,10 +98,10 @@ public class EventTemplateController extends BaseController{
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
@ApiOperation("修改字典")
@ApiImplicitParam(name = "eventDataUpdateParam", value = "字典表数据", required = true)
public HttpResult<Boolean> update(@RequestBody EventTemplateParam.EventTemplateUpdateParam eventDataUpdateParam){
public HttpResult<Boolean> update(@RequestBody EventTemplateParam.EventTemplateUpdateParam eventUpdateParam){
String methodDescribe = getMethodDescribe("update");
LogUtil.njcnDebug(log, "{},字典表数据数据为:{}", methodDescribe, eventDataUpdateParam);
boolean result = iEventTemplateService.update(eventDataUpdateParam);
LogUtil.njcnDebug(log, "{},字典表数据数据为:{}", methodDescribe, eventUpdateParam);
boolean result = iEventTemplateService.update(eventUpdateParam);
if (result) {
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
} else {

View File

@@ -55,17 +55,17 @@ public class EventTemplateServiceImpl extends ServiceImpl<EventTemplateMapper, E
if (ObjectUtil.isNotNull(queryParam)) {
//查询参数不为空,进行条件填充
if (StrUtil.isNotBlank(queryParam.getSearchValue())) {
//字典类型表,仅提供名称、编码模糊查询
//字典类型表,仅提供名称模糊查询
queryWrapper
.and(param -> param.like("report_template_dict.name", queryParam.getSearchValue())
.or().like("report_template_dict.pid", queryParam.getSearchValue()));
.and(param -> param.like("report_template_dict.name", queryParam.getSearchValue()));
}
//排序
if (ObjectUtil.isAllNotEmpty(queryParam.getSortBy(), queryParam.getOrderBy())) {
queryWrapper.orderBy(true, queryParam.getOrderBy().equals(DbConstant.ASC), StrUtil.toUnderlineCase(queryParam.getSortBy()));
} else {
queryWrapper.eq("report_template_dict.pid",queryParam.getPid());
//没有排序参数默认根据sort字段排序没有排序字段的根据updateTime更新时间排序
queryWrapper.orderBy(true, true, "report_template_dict.sort");
queryWrapper.orderBy(true, true, "report_template_dict.update_time");
}
}
queryWrapper.ne("report_template_dict.state", DataStateEnum.DELETED.getCode());