统一 boot 和 cloud 代码

This commit is contained in:
YunaiV 2023-10-24 14:07:50 +08:00
parent 57330054de
commit 6d5b066ae6
7 changed files with 30 additions and 19 deletions

View File

@ -3,6 +3,7 @@ package cn.iocoder.yudao.module.system.convert.dict;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.system.api.dict.dto.DictDataRespDTO;
import cn.iocoder.yudao.module.system.controller.admin.dict.vo.data.*;
import cn.iocoder.yudao.module.system.controller.app.dict.vo.AppDictDataRespVO;
import cn.iocoder.yudao.module.system.dal.dataobject.dict.DictDataDO;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
@ -28,5 +29,6 @@ public interface DictDataConvert {
DictDataRespDTO convert02(DictDataDO bean);
List<AppDictDataRespVO> convertList03(List<DictDataDO> list);
}

View File

@ -1,16 +1,12 @@
package cn.iocoder.yudao.module.system.convert.ip;
import cn.iocoder.yudao.framework.ip.core.Area;
import cn.iocoder.yudao.framework.ip.core.enums.AreaTypeEnum;
import cn.iocoder.yudao.module.system.controller.admin.ip.vo.AreaNodeRespVO;
import cn.iocoder.yudao.module.system.controller.admin.ip.vo.AreaNodeSimpleRespVO;
import cn.iocoder.yudao.module.system.controller.app.ip.vo.AppAreaNodeRespVO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;
import java.util.List;
import java.util.Objects;
@Mapper
public interface AreaConvert {
@ -19,15 +15,6 @@ public interface AreaConvert {
List<AreaNodeRespVO> convertList(List<Area> list);
List<AreaNodeSimpleRespVO> convertList2(List<Area> list);
@Mapping(source = "type", target = "leaf")
AreaNodeSimpleRespVO convert(Area area);
default Boolean convertAreaType(Integer type) {
return Objects.equals(AreaTypeEnum.DISTRICT.getType(), type);
}
List<AppAreaNodeRespVO> convertList3(List<Area> list);
}

View File

@ -1,6 +1,7 @@
package cn.iocoder.yudao.module.system.convert.notify;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.util.date.DateUtils;
import cn.iocoder.yudao.module.system.controller.admin.notify.vo.template.NotifyTemplateCreateReqVO;
import cn.iocoder.yudao.module.system.controller.admin.notify.vo.template.NotifyTemplateRespVO;
import cn.iocoder.yudao.module.system.controller.admin.notify.vo.template.NotifyTemplateUpdateReqVO;
@ -15,7 +16,7 @@ import java.util.List;
*
* @author xrcoder
*/
@Mapper
@Mapper(uses = DateUtils.class)
public interface NotifyTemplateConvert {
NotifyTemplateConvert INSTANCE = Mappers.getMapper(NotifyTemplateConvert.class);

View File

@ -55,7 +55,7 @@ public class DictDataDO extends BaseDO {
/**
* css 样式
*/
@TableField(updateStrategy = FieldStrategy.IGNORED)
@TableField(updateStrategy = FieldStrategy.ALWAYS)
private String cssClass;
/**
* 备注

View File

@ -48,4 +48,10 @@ public interface DictDataMapper extends BaseMapperX<DictDataDO> {
.eqIfPresent(DictDataDO::getStatus, reqVO.getStatus()));
}
default List<DictDataDO> selectListByTypeAndStatus(String dictType, Integer status) {
return selectList(new LambdaQueryWrapper<DictDataDO>()
.eq(DictDataDO::getDictType, dictType)
.eq(DictDataDO::getStatus, status));
}
}

View File

@ -62,6 +62,14 @@ public interface DictDataService {
*/
List<DictDataDO> getDictDataList(DictDataExportReqVO reqVO);
/**
* 获得字典数据列表
*
* @param dictType 字典类型
* @return 字典数据列表
*/
List<DictDataDO> getEnabledDictDataListByType(String dictType);
/**
* 获得字典数据详情
*
@ -84,7 +92,7 @@ public interface DictDataService {
* 2. 字典数据被禁用
*
* @param dictType 字典类型
* @param values 字典数据值的数组
* @param values 字典数据值的数组
*/
void validateDictDataList(String dictType, Collection<String> values);
@ -92,7 +100,7 @@ public interface DictDataService {
* 获得指定的字典数据
*
* @param dictType 字典类型
* @param value 字典数据值
* @param value 字典数据值
* @return 字典数据
*/
DictDataDO getDictData(String dictType, String value);
@ -101,7 +109,7 @@ public interface DictDataService {
* 解析获得指定的字典数据从缓存中
*
* @param dictType 字典类型
* @param label 字典数据标签
* @param label 字典数据标签
* @return 字典数据
*/
DictDataDO parseDictData(String dictType, String label);

View File

@ -49,7 +49,7 @@ public class DictDataServiceImpl implements DictDataService {
@Override
public List<DictDataDO> getDictDataList() {
List<DictDataDO> list = dictDataMapper.selectList();
List<DictDataDO> list = dictDataMapper.selectList(DictDataDO::getStatus, CommonStatusEnum.ENABLE.getStatus());
list.sort(COMPARATOR_TYPE_AND_SORT);
return list;
}
@ -66,6 +66,13 @@ public class DictDataServiceImpl implements DictDataService {
return list;
}
@Override
public List<DictDataDO> getEnabledDictDataListByType(String dictType) {
List<DictDataDO> list = dictDataMapper.selectListByTypeAndStatus(dictType, CommonStatusEnum.ENABLE.getStatus());
list.sort(COMPARATOR_TYPE_AND_SORT);
return list;
}
@Override
public DictDataDO getDictData(Long id) {
return dictDataMapper.selectById(id);