update:标签管理-固定字段的部分属性可以修改
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package com.jero.modules.tag.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
|
||||
@@ -27,11 +28,8 @@ import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.SQLSyntaxErrorException;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
@@ -155,7 +153,47 @@ public class LawsTagController extends JeroController<LawsTag, ILawsTagService>
|
||||
public Result<?> edit(@Validated @RequestBody LawsTag lawsTag) {
|
||||
if (FixedFieldEnum.FIXED_FIELD_ENUM.getValue().equals(lawsTag.getIsReadOnly().toString()) ||
|
||||
FixedFieldEnum.CONFIGURABLE_FIELD.getValue().equals(lawsTag.getIsReadOnly().toString())) {
|
||||
return Result.error(ResultCommon.TAG_EDIT_ERROR_1);
|
||||
// 修改展示区域以下的字段
|
||||
LambdaUpdateWrapper<LawsTag> lambdaUpdateWrapper = new LambdaUpdateWrapper();
|
||||
// 展示顺序
|
||||
if (!Objects.isNull(lawsTag.getOrderNum())) {
|
||||
lambdaUpdateWrapper.set(LawsTag::getOrderNum,lawsTag.getOrderNum());
|
||||
}
|
||||
// 是否必填
|
||||
if (StringUtils.isNotBlank(lawsTag.getFieldMustInput())) {
|
||||
lambdaUpdateWrapper.set(LawsTag::getFieldMustInput,lawsTag.getFieldMustInput());
|
||||
}
|
||||
// 对应列表是否展示
|
||||
if (!Objects.isNull(lawsTag.getIsShowList())) {
|
||||
lambdaUpdateWrapper.set(LawsTag::getIsShowList,lawsTag.getIsShowList());
|
||||
}
|
||||
// 详情页是否展示
|
||||
if (!Objects.isNull(lawsTag.getIsShowForm())) {
|
||||
lambdaUpdateWrapper.set(LawsTag::getIsShowForm,lawsTag.getIsShowForm());
|
||||
}
|
||||
// 新增是否展示
|
||||
if (!Objects.isNull(lawsTag.getIsShowFormCreate())) {
|
||||
lambdaUpdateWrapper.set(LawsTag::getIsShowFormCreate,lawsTag.getIsShowFormCreate());
|
||||
}
|
||||
// 展示区域
|
||||
if (StringUtils.isNotBlank(lawsTag.getShowArea())) {
|
||||
lambdaUpdateWrapper.set(LawsTag::getShowArea,lawsTag.getShowArea());
|
||||
}
|
||||
// 是否搜索
|
||||
if (!Objects.isNull(lawsTag.getIsQuery())) {
|
||||
lambdaUpdateWrapper.set(LawsTag::getIsQuery,lawsTag.getIsQuery());
|
||||
}
|
||||
// 是否排序
|
||||
if (StringUtils.isNotBlank(lawsTag.getSortFlag())) {
|
||||
lambdaUpdateWrapper.set(LawsTag::getSortFlag,lawsTag.getSortFlag());
|
||||
}
|
||||
// 搜索中心展示
|
||||
if (!Objects.isNull(lawsTag.getIsShowSearch())) {
|
||||
lambdaUpdateWrapper.set(LawsTag::getIsShowSearch,lawsTag.getIsShowSearch());
|
||||
}
|
||||
lambdaUpdateWrapper.eq(LawsTag::getId, lawsTag.getId());
|
||||
lawsTagService.update(lambdaUpdateWrapper);
|
||||
return Result.OK(ResultCommon.OK);
|
||||
}else {
|
||||
String isModel = lawsTag.getIsModel();
|
||||
String tableName = TableNameEnum.getTableName(isModel);
|
||||
|
||||
Reference in New Issue
Block a user