瀏覽代碼

分类、数据字典

全业务考评 1 年之前
父節點
當前提交
185facd6cf

+ 4 - 1
ims-service/ims-eval/src/main/java/com/ims/eval/controller/BinSectionController.java

@@ -53,6 +53,10 @@ public class BinSectionController {
 			list = list.stream().filter(s -> !s.getType().equals(type)).collect(Collectors.toList());
 		}
 
+		if(StringUtils.isNotEmpty(sectionName)){
+			list = list.stream().filter(s -> s.getSectionName().contains(sectionName)).collect(Collectors.toList());
+		}
+
 		return R.ok().data(list);
 	}
 
@@ -68,7 +72,6 @@ public class BinSectionController {
 	@PostMapping(value = "/save")
 	@ApiOperation(value = "新增(修改)", notes = "新增(修改)")
 	public R addAll(@RequestBody BinSection binSection) {
-
 		try {
 			boolean b = binSectionService.saveOrUpdate(binSection);
 			if (b) {

+ 11 - 7
ims-service/ims-eval/src/main/java/com/ims/eval/controller/BinStageController.java

@@ -1,6 +1,7 @@
 package com.ims.eval.controller;
 
 
+import com.ims.common.utils.StringUtils;
 import com.ims.eval.cache.CacheContext;
 import com.ims.eval.config.CustomException;
 import com.ims.eval.entity.BinStage;
@@ -38,21 +39,24 @@ public class BinStageController {
 	/**
 	 * 查询
 	 *
-	 * @param id         主键ID
+	 * @param stageName  名称
 	 * @param type       类型
 	 * @return
 	 */
 	//@ImsPreAuth("eval:binStage:view")
 	@GetMapping(value = "list")
-	public R list(@RequestParam(value = "id", required = false) String id,
+	public R list(@RequestParam(value = "stageName", required = false) String stageName,
 				  @RequestParam(value = "type", required = false) String type) {
-		List<BinStage> list =null;
-		if(null != type&&type.length()>0){
-			 list =CacheContext.bseList.stream().filter(t->t.getType().equals(type)).collect(Collectors.toList());
-		}else {
-			list =CacheContext.bseList;
+		List<BinStage> list = CacheContext.bseList;
+		if(StringUtils.isNotEmpty(type)){
+			 list =list.stream().filter(t->t.getType().equals(type)).collect(Collectors.toList());
 		}
 
+		if(StringUtils.isNotEmpty(stageName)){
+			list =list.stream().filter(t->t.getStageName().contains(stageName)).collect(Collectors.toList());
+		}
+
+
 		return R.ok().data(list);
 	}
 

+ 22 - 0
ims-service/ims-eval/src/main/java/com/ims/eval/controller/DataDictionaryController.java

@@ -1,6 +1,7 @@
 package com.ims.eval.controller;
 
 
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.ims.eval.cache.CacheContext;
 import com.ims.eval.config.CustomException;
 import com.ims.eval.entity.dto.result.R;
@@ -52,6 +53,27 @@ public class DataDictionaryController {
 
 
 	/**
+	 * 分页查询
+	 * @param pageNum
+	 * @param pageSize
+	 * @param dataKey
+	 * @param keyName
+	 * @param superKey
+	 * @return
+	 */
+	//@ImsPreAuth("eval:dataDictionary:view")
+	@GetMapping(value = "listPage")
+	public R listPage(@RequestParam(value = "pageNum") Integer pageNum,
+					  @RequestParam(value = "pageSize") Integer pageSize,
+					  @RequestParam(value = "dataKey", required = false) String dataKey,
+					  @RequestParam(value = "keyName", required = false) String keyName,
+					  @RequestParam(value = "superKey", required = false) String superKey) {
+		IPage<DataDictionary> list = dataDictionaryService.listPage(pageNum,pageSize, dataKey, keyName,superKey);
+		return R.ok().data(list);
+	}
+
+
+	/**
 	 * 添加
 	 *
 	 * @param dictionary

+ 11 - 7
ims-service/ims-eval/src/main/java/com/ims/eval/controller/IndicatorTypeController.java

@@ -1,6 +1,7 @@
 package com.ims.eval.controller;
 
 
+import com.ims.common.utils.StringUtils;
 import com.ims.eval.cache.CacheContext;
 import com.ims.eval.config.CustomException;
 import com.ims.eval.entity.DataDictionary;
@@ -39,21 +40,24 @@ public class IndicatorTypeController {
 	 *
 	 * @param id       主键ID
 	 * @param type  type
-	 * @param typeCode  code
+	 * @param typeName  typeName
 	 * @return
 	 */
 	//@ImsPreAuth("eval:indicatorType:view")
 	@GetMapping(value = "list")
 	public R list(@RequestParam(value = "id", required = false) String id,
 				  @RequestParam(value = "type", required = false) String type,
-				  @RequestParam(value = "typeCode", required = false) String typeCode) {
+				  @RequestParam(value = "typeName", required = false) String typeName) {
 //		List<IndicatorType> list = iIndicatorTypeService.list(id, typeName, typeCode);
-		List<IndicatorType> list =null;
-		if(null != type&&type.length()>0){
-			list =CacheContext.itList.stream().filter(t->t.getType().equals(type)).collect(Collectors.toList());;
-		}else{
-			list =CacheContext.itList;
+		List<IndicatorType> list =CacheContext.itList;
+		if(StringUtils.isNotEmpty(type)){
+			list =list.stream().filter(t->t.getType().equals(type)).collect(Collectors.toList());;
 		}
+
+		if(StringUtils.isNotEmpty(typeName)){
+			list =list.stream().filter(t->t.getTypeName().contains(typeName)).collect(Collectors.toList());;
+		}
+
 		return R.ok().data(list);
 	}
 

+ 3 - 0
ims-service/ims-eval/src/main/java/com/ims/eval/service/IDataDictionaryService.java

@@ -1,5 +1,6 @@
 package com.ims.eval.service;
 
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.ims.eval.entity.DataDictionary;
 
@@ -18,5 +19,7 @@ public interface IDataDictionaryService extends IService<DataDictionary> {
 	List<DataDictionary> list(String id,String dataKey,String keyName,String superKey);
 
 
+	IPage<DataDictionary> listPage(Integer pageNum, Integer pageSize, String dataKey, String keyName, String superKey);
+
 
 }

+ 27 - 1
ims-service/ims-eval/src/main/java/com/ims/eval/service/impl/DataDictionaryServiceImpl.java

@@ -1,11 +1,14 @@
 package com.ims.eval.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.ims.common.utils.StringUtils;
 import com.ims.eval.dao.DataDictionaryMapper;
 import com.ims.eval.config.CustomException;
 import com.ims.eval.entity.DataDictionary;
+import com.ims.eval.entity.Indicator;
 import com.ims.eval.service.IDataDictionaryService;
 import org.springframework.stereotype.Service;
 
@@ -31,7 +34,7 @@ public class DataDictionaryServiceImpl extends ServiceImpl<DataDictionaryMapper,
 			qw.lambda().eq(DataDictionary::getId, id);
 		}
 		if (StringUtils.isNotEmpty(dataKey)) {
-			qw.lambda().eq(DataDictionary::getDataKey, dataKey);
+			qw.lambda().like(DataDictionary::getDataKey, dataKey);
 		}
 		if (StringUtils.isNotEmpty(keyName)) {
 			qw.lambda().like(DataDictionary::getKeyName, keyName);
@@ -45,6 +48,29 @@ public class DataDictionaryServiceImpl extends ServiceImpl<DataDictionaryMapper,
 		return list;
 	}
 
+	@Override
+	public IPage<DataDictionary> listPage(Integer pageNum, Integer pageSize, String dataKey, String keyName,String superKey) {
+		QueryWrapper<DataDictionary> qw = new QueryWrapper<>();
+		Page<DataDictionary> page = new Page<>(pageNum, pageSize);
+
+		if (null == pageNum || null == pageSize) {
+			throw new CustomException("分页参数为空");
+		}
+		if (StringUtils.isNotEmpty(dataKey)) {
+			qw.lambda().like(DataDictionary::getDataKey, dataKey);
+		}
+		if (StringUtils.isNotEmpty(keyName)) {
+			qw.lambda().like(DataDictionary::getKeyName, keyName);
+		}
+		if (StringUtils.isNotEmpty(superKey)) {
+			qw.lambda().eq(DataDictionary::getSuperKey, superKey);
+		}
+		qw.lambda().orderByAsc(DataDictionary::getOrderNum);
+
+		IPage<DataDictionary> list = baseMapper.selectPage(page, qw);
+		return list;
+	}
+
 
 	@Override
 	public boolean saveOrUpdate(DataDictionary entity) {

+ 21 - 0
ims-service/ims-eval/src/main/java/com/ims/eval/service/impl/IndicatorTypeServiceImpl.java

@@ -11,6 +11,8 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
+import java.io.Serializable;
+import java.util.Collection;
 import java.util.List;
 
 /**
@@ -61,4 +63,23 @@ public class IndicatorTypeServiceImpl extends ServiceImpl<IndicatorTypeMapper, I
 		entity.setDelFlag(false);
 		return super.saveOrUpdate(entity);
 	}
+
+	@Override
+	public boolean removeByIds(Collection<? extends Serializable> idList) {
+
+		try {
+			if (idList.size()>0) {
+				for (Object  id : idList){
+					IndicatorType type = baseMapper.selectById(id.toString());
+					type.setDelFlag(true);
+					baseMapper.updateById(type);
+				}
+			}
+		} catch (Exception e) {
+			e.printStackTrace();
+			return false;
+		}
+
+		return true;
+	}
 }

+ 9 - 0
ims-service/ims-eval/src/main/java/com/ims/eval/service/impl/OrganizationStructureServiceImpl.java

@@ -92,10 +92,19 @@ public class OrganizationStructureServiceImpl extends ServiceImpl<OrganizationSt
 
 		List<OrganizationStructure> list = arr.toJavaList(OrganizationStructure.class);
 		list.addAll(list2);
+
+
 		List<OrganizationStructure> filteredList = list.stream()
 			.filter(structure -> null != structure.getType() && (structure.getType().equals("100")||structure.getType().equals("160")||structure.getType().equals("130")||structure.getType().equals("3")))
 			.collect(Collectors.toList());
 
+		if (null != id){
+			filteredList = list.stream()
+				.filter(structure -> null != structure.getParentId() && id.equals(structure.getParentId()))
+				.collect(Collectors.toList());
+		}
+
+
 		return filteredList;
 
 	}