|
@@ -4,10 +4,11 @@ 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.additional.query.impl.LambdaQueryChainWrapper;
|
|
import com.baomidou.mybatisplus.extension.service.additional.query.impl.LambdaQueryChainWrapper;
|
|
import com.lantone.common.enums.IsDeleteEnum;
|
|
import com.lantone.common.enums.IsDeleteEnum;
|
|
|
|
+import com.lantone.common.enums.StatusEnum;
|
|
import com.lantone.common.exception.ApiException;
|
|
import com.lantone.common.exception.ApiException;
|
|
import com.lantone.common.util.StringUtil;
|
|
import com.lantone.common.util.StringUtil;
|
|
-import com.lantone.common.vo.SaveDictionaryVO;
|
|
|
|
import com.lantone.common.vo.GetDictionaryVO;
|
|
import com.lantone.common.vo.GetDictionaryVO;
|
|
|
|
+import com.lantone.common.vo.SaveDictionaryVO;
|
|
import com.lantone.dblayermbg.entity.DictionaryInfo;
|
|
import com.lantone.dblayermbg.entity.DictionaryInfo;
|
|
import com.lantone.dblayermbg.facade.DictionaryInfoFacade;
|
|
import com.lantone.dblayermbg.facade.DictionaryInfoFacade;
|
|
import org.springframework.beans.BeanUtils;
|
|
import org.springframework.beans.BeanUtils;
|
|
@@ -69,13 +70,15 @@ public class DictionaryManagementFacade {
|
|
}
|
|
}
|
|
dictionaryInfoLambdaQuery.orderByDesc(DictionaryInfo::getGmtCreate);
|
|
dictionaryInfoLambdaQuery.orderByDesc(DictionaryInfo::getGmtCreate);
|
|
IPage<DictionaryInfo> page = dictionaryInfoLambdaQuery.page(pageInfo);
|
|
IPage<DictionaryInfo> page = dictionaryInfoLambdaQuery.page(pageInfo);
|
|
- page.getRecords().forEach(obj->{
|
|
|
|
-// if(null != obj.getStatus() && 1 == obj.getStatus()){
|
|
|
|
-// obj.setStatusStr("启用");
|
|
|
|
-// }
|
|
|
|
-// if(null != obj.getStatus() && 0 == obj.getStatus()){
|
|
|
|
-// obj.setStatusStr("禁用");
|
|
|
|
-// }
|
|
|
|
|
|
+ page.getRecords().forEach(obj -> {
|
|
|
|
+ if (StringUtil.isNotBlank(obj.getStatus())) {
|
|
|
|
+ if (obj.getStatus().equals(StatusEnum.Enable.getKey())) {
|
|
|
|
+ obj.setStatus("启用");
|
|
|
|
+ }
|
|
|
|
+ if (obj.getStatus().equals(StatusEnum.Disable.getKey())) {
|
|
|
|
+ obj.setStatus("禁用");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
});
|
|
});
|
|
page.setRecords(page.getRecords());
|
|
page.setRecords(page.getRecords());
|
|
return page;
|
|
return page;
|
|
@@ -89,7 +92,7 @@ public class DictionaryManagementFacade {
|
|
* @Date: 2021/7/30
|
|
* @Date: 2021/7/30
|
|
*/
|
|
*/
|
|
public Boolean deleteDictionary(Integer id) {
|
|
public Boolean deleteDictionary(Integer id) {
|
|
- return dictionaryInfoFacade.lambdaUpdate().eq(DictionaryInfo::getId,id).set(DictionaryInfo::getIsDeleted, IsDeleteEnum.Y.getKey()).update();
|
|
|
|
|
|
+ return dictionaryInfoFacade.lambdaUpdate().eq(DictionaryInfo::getId, id).set(DictionaryInfo::getIsDeleted, IsDeleteEnum.Y.getKey()).update();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -125,6 +128,7 @@ public class DictionaryManagementFacade {
|
|
dictionaryInfo.setCreator("程瑶-后期改");
|
|
dictionaryInfo.setCreator("程瑶-后期改");
|
|
return dictionaryInfoFacade.save(dictionaryInfo);
|
|
return dictionaryInfoFacade.save(dictionaryInfo);
|
|
}
|
|
}
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* @Description: 修改字典
|
|
* @Description: 修改字典
|
|
* @Param: [dictionaryInfo]
|
|
* @Param: [dictionaryInfo]
|
|
@@ -149,11 +153,11 @@ public class DictionaryManagementFacade {
|
|
public List<String> getCodeCategory(String groupType) {
|
|
public List<String> getCodeCategory(String groupType) {
|
|
LambdaQueryChainWrapper<DictionaryInfo> dictionaryInfoLambdaQuery = dictionaryInfoFacade.lambdaQuery();
|
|
LambdaQueryChainWrapper<DictionaryInfo> dictionaryInfoLambdaQuery = dictionaryInfoFacade.lambdaQuery();
|
|
dictionaryInfoLambdaQuery.eq(DictionaryInfo::getIsDeleted, IsDeleteEnum.N.getKey());
|
|
dictionaryInfoLambdaQuery.eq(DictionaryInfo::getIsDeleted, IsDeleteEnum.N.getKey());
|
|
- if(StringUtil.isNotBlank(groupType)){
|
|
|
|
|
|
+ if (StringUtil.isNotBlank(groupType)) {
|
|
dictionaryInfoLambdaQuery.like(DictionaryInfo::getGroupType, groupType);
|
|
dictionaryInfoLambdaQuery.like(DictionaryInfo::getGroupType, groupType);
|
|
}
|
|
}
|
|
return dictionaryInfoLambdaQuery.groupBy(DictionaryInfo::getGroupType).list()
|
|
return dictionaryInfoLambdaQuery.groupBy(DictionaryInfo::getGroupType).list()
|
|
- .stream().filter(obj->null != obj.getGroupType())
|
|
|
|
|
|
+ .stream().filter(obj -> null != obj.getGroupType())
|
|
.map(obj -> obj.getGroupType().toString()).sorted().collect(Collectors.toList());
|
|
.map(obj -> obj.getGroupType().toString()).sorted().collect(Collectors.toList());
|
|
}
|
|
}
|
|
}
|
|
}
|