mirror of https://gitee.com/stylefeng/roses
【7.2.2】【expand】更新字段列表
parent
501f1a74bb
commit
93ec68e8a0
|
@ -4,6 +4,7 @@ import cn.stylefeng.roses.kernel.db.api.pojo.page.PageResult;
|
||||||
import cn.stylefeng.roses.kernel.expand.modular.modular.entity.SysExpandField;
|
import cn.stylefeng.roses.kernel.expand.modular.modular.entity.SysExpandField;
|
||||||
import cn.stylefeng.roses.kernel.expand.modular.modular.pojo.request.SysExpandFieldRequest;
|
import cn.stylefeng.roses.kernel.expand.modular.modular.pojo.request.SysExpandFieldRequest;
|
||||||
import cn.stylefeng.roses.kernel.expand.modular.modular.service.SysExpandFieldService;
|
import cn.stylefeng.roses.kernel.expand.modular.modular.service.SysExpandFieldService;
|
||||||
|
import cn.stylefeng.roses.kernel.rule.pojo.request.BaseRequest;
|
||||||
import cn.stylefeng.roses.kernel.rule.pojo.response.ResponseData;
|
import cn.stylefeng.roses.kernel.rule.pojo.response.ResponseData;
|
||||||
import cn.stylefeng.roses.kernel.rule.pojo.response.SuccessResponseData;
|
import cn.stylefeng.roses.kernel.rule.pojo.response.SuccessResponseData;
|
||||||
import cn.stylefeng.roses.kernel.scanner.api.annotation.ApiResource;
|
import cn.stylefeng.roses.kernel.scanner.api.annotation.ApiResource;
|
||||||
|
@ -94,7 +95,7 @@ public class SysExpandFieldController {
|
||||||
* @date 2022/03/29 23:47
|
* @date 2022/03/29 23:47
|
||||||
*/
|
*/
|
||||||
@GetResource(name = "分页查询", path = "/sysExpandField/page")
|
@GetResource(name = "分页查询", path = "/sysExpandField/page")
|
||||||
public ResponseData<PageResult<SysExpandField>> page(SysExpandFieldRequest sysExpandFieldRequest) {
|
public ResponseData<PageResult<SysExpandField>> page(@Validated(BaseRequest.page.class) SysExpandFieldRequest sysExpandFieldRequest) {
|
||||||
return new SuccessResponseData<>(sysExpandFieldService.findPage(sysExpandFieldRequest));
|
return new SuccessResponseData<>(sysExpandFieldService.findPage(sysExpandFieldRequest));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,7 @@ public class SysExpandFieldRequest extends BaseRequest {
|
||||||
/**
|
/**
|
||||||
* 对应拓展业务的主键id
|
* 对应拓展业务的主键id
|
||||||
*/
|
*/
|
||||||
@NotNull(message = "对应拓展业务的主键id不能为空", groups = {add.class, edit.class})
|
@NotNull(message = "对应拓展业务的主键id不能为空", groups = {add.class, edit.class, page.class})
|
||||||
@ChineseDescription("对应拓展业务的主键id")
|
@ChineseDescription("对应拓展业务的主键id")
|
||||||
private Long expandId;
|
private Long expandId;
|
||||||
|
|
||||||
|
|
|
@ -88,23 +88,9 @@ public class SysExpandFieldServiceImpl extends ServiceImpl<SysExpandFieldMapper,
|
||||||
private LambdaQueryWrapper<SysExpandField> createWrapper(SysExpandFieldRequest sysExpandFieldRequest) {
|
private LambdaQueryWrapper<SysExpandField> createWrapper(SysExpandFieldRequest sysExpandFieldRequest) {
|
||||||
LambdaQueryWrapper<SysExpandField> queryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<SysExpandField> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
|
||||||
Long fieldId = sysExpandFieldRequest.getFieldId();
|
|
||||||
Long expandId = sysExpandFieldRequest.getExpandId();
|
Long expandId = sysExpandFieldRequest.getExpandId();
|
||||||
String fieldName = sysExpandFieldRequest.getFieldName();
|
|
||||||
String fieldCode = sysExpandFieldRequest.getFieldCode();
|
|
||||||
Integer fieldType = sysExpandFieldRequest.getFieldType();
|
|
||||||
String fieldRequired = sysExpandFieldRequest.getFieldRequired();
|
|
||||||
Integer fieldLength = sysExpandFieldRequest.getFieldLength();
|
|
||||||
String listShowFlag = sysExpandFieldRequest.getListShowFlag();
|
|
||||||
|
|
||||||
queryWrapper.eq(ObjectUtil.isNotNull(fieldId), SysExpandField::getFieldId, fieldId);
|
|
||||||
queryWrapper.eq(ObjectUtil.isNotNull(expandId), SysExpandField::getExpandId, expandId);
|
queryWrapper.eq(ObjectUtil.isNotNull(expandId), SysExpandField::getExpandId, expandId);
|
||||||
queryWrapper.like(ObjectUtil.isNotEmpty(fieldName), SysExpandField::getFieldName, fieldName);
|
|
||||||
queryWrapper.like(ObjectUtil.isNotEmpty(fieldCode), SysExpandField::getFieldCode, fieldCode);
|
|
||||||
queryWrapper.eq(ObjectUtil.isNotNull(fieldType), SysExpandField::getFieldType, fieldType);
|
|
||||||
queryWrapper.like(ObjectUtil.isNotEmpty(fieldRequired), SysExpandField::getFieldRequired, fieldRequired);
|
|
||||||
queryWrapper.eq(ObjectUtil.isNotNull(fieldLength), SysExpandField::getFieldLength, fieldLength);
|
|
||||||
queryWrapper.like(ObjectUtil.isNotEmpty(listShowFlag), SysExpandField::getListShowFlag, listShowFlag);
|
|
||||||
|
|
||||||
return queryWrapper;
|
return queryWrapper;
|
||||||
}
|
}
|
||||||
|
|
|
@ -74,6 +74,8 @@ public class SysExpandServiceImpl extends ServiceImpl<SysExpandMapper, SysExpand
|
||||||
@Override
|
@Override
|
||||||
public List<SysExpand> findList(SysExpandRequest sysExpandRequest) {
|
public List<SysExpand> findList(SysExpandRequest sysExpandRequest) {
|
||||||
LambdaQueryWrapper<SysExpand> wrapper = this.createWrapper(sysExpandRequest);
|
LambdaQueryWrapper<SysExpand> wrapper = this.createWrapper(sysExpandRequest);
|
||||||
|
wrapper.select(SysExpand::getExpandId, SysExpand::getExpandName, SysExpand::getExpandCode);
|
||||||
|
wrapper.eq(SysExpand::getExpandStatus, StatusEnum.ENABLE.getCode());
|
||||||
return this.list(wrapper);
|
return this.list(wrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -103,14 +105,10 @@ public class SysExpandServiceImpl extends ServiceImpl<SysExpandMapper, SysExpand
|
||||||
Long expandId = sysExpandRequest.getExpandId();
|
Long expandId = sysExpandRequest.getExpandId();
|
||||||
String expandName = sysExpandRequest.getExpandName();
|
String expandName = sysExpandRequest.getExpandName();
|
||||||
String expandCode = sysExpandRequest.getExpandCode();
|
String expandCode = sysExpandRequest.getExpandCode();
|
||||||
Integer expandStatus = sysExpandRequest.getExpandStatus();
|
|
||||||
String primaryFieldName = sysExpandRequest.getPrimaryFieldName();
|
|
||||||
|
|
||||||
queryWrapper.eq(ObjectUtil.isNotNull(expandId), SysExpand::getExpandId, expandId);
|
queryWrapper.eq(ObjectUtil.isNotNull(expandId), SysExpand::getExpandId, expandId);
|
||||||
queryWrapper.like(ObjectUtil.isNotEmpty(expandName), SysExpand::getExpandName, expandName);
|
queryWrapper.like(ObjectUtil.isNotEmpty(expandName), SysExpand::getExpandName, expandName);
|
||||||
queryWrapper.like(ObjectUtil.isNotEmpty(expandCode), SysExpand::getExpandCode, expandCode);
|
queryWrapper.like(ObjectUtil.isNotEmpty(expandCode), SysExpand::getExpandCode, expandCode);
|
||||||
queryWrapper.eq(ObjectUtil.isNotNull(expandStatus), SysExpand::getExpandStatus, expandStatus);
|
|
||||||
queryWrapper.like(ObjectUtil.isNotEmpty(primaryFieldName), SysExpand::getPrimaryFieldName, primaryFieldName);
|
|
||||||
|
|
||||||
return queryWrapper;
|
return queryWrapper;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue