From 4470052c3b6bdeb18e45987f8aa293d1e93d0552 Mon Sep 17 00:00:00 2001
From: Ludc <2870569285@qq.com>
Date: 星期二, 18 十一月 2025 11:59:12 +0800
Subject: [PATCH] 所有文件上传接口增加文件安全校验逻辑。
---
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeReferBtmTypeServiceImpl.java | 38 +++++++++++++++++---------------------
1 files changed, 17 insertions(+), 21 deletions(-)
diff --git a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeReferBtmTypeServiceImpl.java b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeReferBtmTypeServiceImpl.java
index 4b0cc5e..addcf4a 100644
--- a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeReferBtmTypeServiceImpl.java
+++ b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeReferBtmTypeServiceImpl.java
@@ -4,6 +4,7 @@
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.vci.ubcs.code.service.ICodeReferBtmTypeService;
import com.vci.ubcs.omd.feign.IAttributeClient;
+import com.vci.ubcs.omd.feign.IBtmAttributeClient;
import com.vci.ubcs.omd.feign.IBtmTypeClient;
import com.vci.ubcs.omd.vo.AttributeVO;
import com.vci.ubcs.omd.vo.BtmTypeAttributeVO;
@@ -18,7 +19,6 @@
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
-import java.rmi.ServerException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@@ -39,12 +39,6 @@
private IBtmTypeClient btmTypeClient;
/**
- * 涓氬姟绫诲瀷灞炴�ф湇鍔�
- */
- @Resource
- private IAttributeClient attributeClient;
-
- /**
* 鑾峰彇涓氬姟绫诲瀷鍒楄〃
* @param baseQueryObject 鏌ヨ鏉′欢
* @return 鍒楄〃鐨勫唴瀹�
@@ -54,13 +48,11 @@
Map<String, String> conditionMap = baseQueryObject.getConditionMap();
conditionMap.put("domain", AppConstant.APPLICATION_NAME_CODE);
baseQueryObject.setConditionMap(conditionMap);
- Page<BtmTypeVO> refPage = null;
- try {
- refPage = btmTypeClient.getRefPage(baseQueryObject).getData();
- }catch (Exception e){
+ R<Page<BtmTypeVO>> btmTypeClientRefPage = btmTypeClient.getRefPage(baseQueryObject);
+ if(!btmTypeClientRefPage.isSuccess()){
throw new ServiceException("涓氬姟绫诲瀷feign鎺ュ彛璋冪敤閿欒");
}
- return refPage;
+ return btmTypeClientRefPage.getData();
}
/**
@@ -69,25 +61,28 @@
* @return 灞炴�х殑淇℃伅
*/
@Override
- public Page<AttributeVO> gridAttributesByBtmId(BaseQueryObject baseQueryObject) {
+ public Page<BtmTypeAttributeVO> gridAttributesByBtmId(BaseQueryObject baseQueryObject) throws ServiceException {
String btmTypeId = baseQueryObject.getConditionMap().containsKey("btmTypeId")?baseQueryObject.getConditionMap().get("btmTypeId"):"";
if(StringUtils.isBlank(btmTypeId)){
- return new Page<AttributeVO>();
+ return new Page<>();
}
String hasDefaultAttr = baseQueryObject.getConditionMap().getOrDefault("hasDefaultAttr","false");
String attrId = baseQueryObject.getConditionMap().containsKey("name")?baseQueryObject.getConditionMap().get("name").replace("*",""):"";
String attrName = baseQueryObject.getConditionMap().containsKey("label") ? baseQueryObject.getConditionMap().get("label").replace("*","") : "";
- // TODO 鏍规嵁涓氬姟绫诲瀷id鑾峰彇鍏宠仈鐨勫睘鎬�
- List<BtmTypeAttributeVO> boAttrs = null; //attributeClient.get();
+ List<BtmTypeAttributeVO> boAttrs = null;
+ try {
+ boAttrs = btmTypeClient.getAllAttributeByBtmId(btmTypeId).getData().getAttributes();
+ }catch (Exception e){
+ throw new ServiceException("涓氬姟绫诲瀷feign鎺ュ彛璋冪敤閿欒");
+ }
if(boAttrs == null){
boAttrs = new ArrayList<>();
}
if(BooleanEnum.TRUE.getValue().equalsIgnoreCase(hasDefaultAttr)){
// TODO 鑾峰彇榛樿鐨勫睘鎬�
List<BtmTypeAttributeVO> finalBoAttrs = boAttrs;
-
- List<BtmTypeAttributeVO> btmTypeAttributeVOS = new ArrayList<>(); //attributeClient.getDefaultAttributeVOs();
- btmTypeAttributeVOS.stream().forEach(attr->{
+ BtmTypeVO btmTypeVO = btmTypeClient.getDefaultAttrByBtmId(btmTypeId).getData();
+ btmTypeVO.getAttributes().stream().forEach(attr->{
BtmTypeAttributeVO attributeVO = new BtmTypeAttributeVO();
BeanUtil.convert(attr,attributeVO);
attributeVO.setAttributeLength(attr.getAttributeLength());
@@ -108,8 +103,9 @@
}
return usedFlag;
}).collect(Collectors.toList());
-
- return new Page<>();
+ Page<BtmTypeAttributeVO> btmTypeAttributeVOPage = new Page<>();
+ btmTypeAttributeVOPage.setRecords(attrList);
+ return btmTypeAttributeVOPage;
}
--
Gitblit v1.9.3