|
@@ -1,5 +1,6 @@
|
|
|
package com.ruoyi.gljt.controller;
|
|
|
|
|
|
+import com.ruoyi.common.core.exception.ServiceException;
|
|
|
import com.ruoyi.common.core.utils.StringUtils;
|
|
|
import com.ruoyi.common.core.utils.poi.ExcelUtil;
|
|
|
import com.ruoyi.common.core.web.controller.BaseController;
|
|
@@ -17,7 +18,9 @@ import com.ruoyi.gljt.service.IGljtQxpzService;
|
|
|
import com.ruoyi.gljt.utils.GljtSqUtils;
|
|
|
import com.ruoyi.system.api.domain.SysDictData;
|
|
|
import com.ruoyi.system.validate.group.AddGroup;
|
|
|
+import org.apache.commons.collections4.CollectionUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.util.ObjectUtils;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
@@ -26,6 +29,8 @@ import java.math.BigDecimal;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
+import java.util.stream.Collectors;
|
|
|
+import java.util.stream.Stream;
|
|
|
|
|
|
/**
|
|
|
* 高龄津贴_区县配置信息Controller
|
|
@@ -43,7 +48,6 @@ public class GljtQxpzController extends BaseController
|
|
|
@Autowired
|
|
|
private GljtSqUtils gljtSqUtils;
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
* 查询高龄津贴_区县配置信息列表
|
|
|
*/
|
|
@@ -56,6 +60,22 @@ public class GljtQxpzController extends BaseController
|
|
|
return getDataTable(list);
|
|
|
}
|
|
|
|
|
|
+ @GetMapping("/getKhyh")
|
|
|
+ public AjaxResult getKhyh(GljtQxpz gljtQxpz) {
|
|
|
+ if (StringUtils.isEmpty(gljtQxpz.getXzqh())) throw new ServiceException("行政区划不能为空");
|
|
|
+ List<SysDictData> dictDataList = DictUtils.getDictCache("C0044");
|
|
|
+ GljtQxpz pz = gljtSqUtils.getQxpz(gljtQxpz.getXzqh());
|
|
|
+ if (ObjectUtils.isEmpty(pz)) {
|
|
|
+ return AjaxResult.success(new ArrayList<>());
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotEmpty(pz.getKhyh()) && CollectionUtils.isNotEmpty(dictDataList)) {
|
|
|
+ List<String> khh = Stream.of(pz.getKhyh().split(",")).collect(Collectors.toList());
|
|
|
+ dictDataList = dictDataList.stream().filter(d -> khh.contains(d.getDictValue())).collect(Collectors.toList());
|
|
|
+ return AjaxResult.success(dictDataList);
|
|
|
+ }
|
|
|
+ return AjaxResult.success(new ArrayList<>());
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 导出高龄津贴_区县配置信息列表
|
|
|
*/
|