فهرست منبع

[task-833]记录分类获取接口调整

szjbdgzl 2 سال پیش
والد
کامیت
47bf684ea0

+ 8 - 0
ibps-common-root/modules/org-biz/src/main/java/com/lc/ibps/common/cat/repository/TypeRepository.java

@@ -79,6 +79,14 @@ public interface TypeRepository extends IRepository<String, TypePo,Type>{
 	 * @return
 	 */
 	List<TypePo> findByCategoryKey(String categoryKey, String useId);
+
+	/**
+	 * 根据 分类标识 和 用户id  地点 diDian 获取相关系统分类信息
+	 * @param categoryKey 分类标识: eg:FLOW_TYPE
+	 * @param useId
+	 * @return
+	 */
+	List<TypePo> findByCategoryKeyAndDiDian(String categoryKey, String useId,String diDian);
 	
 	/**
 	 * 根据分类标识key和业务类型key获取系统分类信息

+ 9 - 0
ibps-common-root/modules/org-biz/src/main/java/com/lc/ibps/common/cat/repository/impl/TypeRepositoryImpl.java

@@ -125,6 +125,15 @@ public class TypeRepositoryImpl extends AbstractRepository<String, TypePo, Type>
 		return typeList;
 	}
 
+	@Override
+	public List<TypePo> findByCategoryKeyAndDiDian(String categoryKey, String useId, String diDian) {
+		List<TypePo> typeList = findByKey("findByCategoryKey", "findIdsByCategoryKey",
+				b().a("categoryKey", categoryKey).
+					a("ownerId", useId).
+					a("diDian","%" + diDian + "%").p());
+		return typeList;
+	}
+
 	@Override
 	public TypePo getByCategoryKeyAndTypeKey(String categoryKey, String typeKey) {
 		TypePo po = typeQueryDao.getByKey("getByCategoryKeyAndTypeKey",

+ 6 - 0
ibps-model-root/modules/org-model/src/main/resources/com/lc/ibps/cat/persistence/mapping/Type.map.xml

@@ -129,6 +129,9 @@
 		<if test="ownerId!=null"> 
 			AND (t.OWNER_ID_= '0' or t.OWNER_ID_ = #{ownerId})
 		</if>
+		<if test="diDian!=null">
+			AND t.AUTHORITY_NAME like #{diDian}
+		</if>
 		order by t.SN_,t.ID_
 	</select>
 	
@@ -139,6 +142,9 @@
 		<if test="ownerId!=null"> 
 			AND (t.OWNER_ID_= '0' or t.OWNER_ID_ = #{ownerId})
 		</if>
+		<if test="diDian!=null">
+			AND t.AUTHORITY_NAME like #{diDian}
+		</if>
 		order by t.SN_,t.ID_
 	</select>
 	

+ 2 - 1
ibps-provider-base-root/modules/provider-platform-api/src/main/java/com/lc/ibps/common/api/ITypeService.java

@@ -68,7 +68,8 @@ public interface ITypeService {
 	@RequestMapping(value = "/findTreeData", method = { RequestMethod.GET })
 	public APIResult<List<TypePo>> findTreeData(
 			@NotBlank(message = "{com.lc.ibps.common.categoryKey}") 
-			@RequestParam(name = "categoryKey", required = true) String categoryKey);
+			@RequestParam(name = "categoryKey", required = true) String categoryKey,
+			@RequestParam(name = "diDian", required = false) String diDian);
 	
 	/**
 	 * 

+ 7 - 4
ibps-provider-root/modules/provider-platform-default/src/main/java/com/lc/ibps/common/provider/TypeProvider.java

@@ -83,14 +83,17 @@ public class TypeProvider extends GenericProvider implements ITypeService, IType
 	@Override
 	public APIResult<List<TypePo>> findTreeData(
 			@ApiParam(name = "categoryKey", value = "节点的分类Key", required = true) 
-			@RequestParam(name = "categoryKey", required = true) String categoryKey) {
+			@RequestParam(name = "categoryKey", required = true) String categoryKey,
+			@ApiParam(name = "diDian", value = "地点", required = false)
+			@RequestParam(name = "diDian", required = false) String diDian) {
 		APIResult<List<TypePo>> result = new APIResult<>();
 		try {
 			List<TypePo> list = null;
-			if(ContextUtil.isSuper()) {
-				list = typeRepository.findByCategoryKey(categoryKey);
+			String userId = ContextUtil.isSuper() ? "" : ContextUtil.getCurrentUserId();
+			if (BeanUtils.isNotEmpty(diDian)) {
+				list = typeRepository.findByCategoryKeyAndDiDian(categoryKey, userId, diDian);
 			} else {
-				list = typeRepository.findByCategoryKey(categoryKey, ContextUtil.getCurrentUserId());
+				list = typeRepository.findByCategoryKey(categoryKey, userId);
 			}
 			if (BeanUtils.isEmpty(list)) {
 				list = new ArrayList<TypePo>();