Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
package com.jero.modules.tag.controller;
|
package com.jero.modules.tag.controller;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
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.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||||
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
|
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
|
||||||
@@ -19,6 +18,7 @@ import com.jero.modules.system.vo.IdMapBody;
|
|||||||
import com.jero.modules.system.vo.IdsMapBody;
|
import com.jero.modules.system.vo.IdsMapBody;
|
||||||
import com.jero.modules.tag.entity.LawsTag;
|
import com.jero.modules.tag.entity.LawsTag;
|
||||||
import com.jero.modules.tag.enums.TableNameEnum;
|
import com.jero.modules.tag.enums.TableNameEnum;
|
||||||
|
import com.jero.modules.tag.mapper.LawsTagMapper;
|
||||||
import com.jero.modules.tag.service.ILawsTagService;
|
import com.jero.modules.tag.service.ILawsTagService;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
@@ -153,47 +153,8 @@ public class LawsTagController extends JeroController<LawsTag, ILawsTagService>
|
|||||||
public Result<?> edit(@Validated @RequestBody LawsTag lawsTag) {
|
public Result<?> edit(@Validated @RequestBody LawsTag lawsTag) {
|
||||||
if (FixedFieldEnum.FIXED_FIELD_ENUM.getValue().equals(lawsTag.getIsReadOnly().toString()) ||
|
if (FixedFieldEnum.FIXED_FIELD_ENUM.getValue().equals(lawsTag.getIsReadOnly().toString()) ||
|
||||||
FixedFieldEnum.CONFIGURABLE_FIELD.getValue().equals(lawsTag.getIsReadOnly().toString())) {
|
FixedFieldEnum.CONFIGURABLE_FIELD.getValue().equals(lawsTag.getIsReadOnly().toString())) {
|
||||||
// 修改展示区域以下的字段
|
lawsTagService.UpdateFixedField(lawsTag);
|
||||||
LambdaUpdateWrapper<LawsTag> lambdaUpdateWrapper = new LambdaUpdateWrapper();
|
return Result.OK(ResultCommon.EDIT_OK);
|
||||||
// 展示顺序
|
|
||||||
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 {
|
}else {
|
||||||
String isModel = lawsTag.getIsModel();
|
String isModel = lawsTag.getIsModel();
|
||||||
String tableName = TableNameEnum.getTableName(isModel);
|
String tableName = TableNameEnum.getTableName(isModel);
|
||||||
|
|||||||
@@ -87,4 +87,5 @@ public interface ILawsTagService extends IService<LawsTag> {
|
|||||||
*/
|
*/
|
||||||
List<LawsTag> listByData(String dbFieldTxt,String isModel);
|
List<LawsTag> listByData(String dbFieldTxt,String isModel);
|
||||||
|
|
||||||
|
void UpdateFixedField(LawsTag lawsTag);
|
||||||
}
|
}
|
||||||
|
|||||||
+50
-3
@@ -3,10 +3,10 @@ package com.jero.modules.tag.service.impl;
|
|||||||
import cn.hutool.core.lang.Validator;
|
import cn.hutool.core.lang.Validator;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
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.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.jero.common.api.vo.Result;
|
|
||||||
import com.jero.common.api.vo.ResultCommon;
|
import com.jero.common.api.vo.ResultCommon;
|
||||||
import com.jero.common.constant.CommonConstant;
|
import com.jero.common.constant.CommonConstant;
|
||||||
import com.jero.common.constant.enums.YesOrNoEnum;
|
import com.jero.common.constant.enums.YesOrNoEnum;
|
||||||
@@ -28,12 +28,11 @@ import org.apache.shiro.SecurityUtils;
|
|||||||
import org.springframework.beans.factory.annotation.Autowired;
|
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;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import java.sql.SQLSyntaxErrorException;
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: 标签管理
|
* @Description: 标签管理
|
||||||
@@ -307,4 +306,52 @@ public class ILawsTagServiceImpl extends ServiceImpl<LawsTagMapper, LawsTag> imp
|
|||||||
public List<LawsTag> listByData(String dbFieldTxt, String isModel) {
|
public List<LawsTag> listByData(String dbFieldTxt, String isModel) {
|
||||||
return lawsTagMapper.listByData(dbFieldTxt, isModel);
|
return lawsTagMapper.listByData(dbFieldTxt, isModel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void UpdateFixedField(LawsTag lawsTag) {
|
||||||
|
LambdaUpdateWrapper<LawsTag> lambdaUpdateWrapper = new LambdaUpdateWrapper();
|
||||||
|
// 只有文本框能改字段长度
|
||||||
|
if (!Objects.isNull(lawsTag.getDbLength()) && lawsTag.getFieldShowType().equals(LawsFieldTypeEnum.TEXT_BOX.getValue())) {
|
||||||
|
executeDDL(lawsTag,"modify");
|
||||||
|
lambdaUpdateWrapper.set(LawsTag::getDbLength,lawsTag.getDbLength());
|
||||||
|
}
|
||||||
|
// 展示顺序
|
||||||
|
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());
|
||||||
|
update(lambdaUpdateWrapper);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user