统一 boot 和 cloud 代码

pull/62/head
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);