From e937d0111a52e2c13c50bbc3386d20a12d125899 Mon Sep 17 00:00:00 2001
From: wangting <675591594@qq.com>
Date: 星期五, 06 九月 2024 10:54:54 +0800
Subject: [PATCH] 链接类型查询模板
---
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/WebBtmTypeController.java | 36 +++++++++++++++++++++++++++++-------
1 files changed, 29 insertions(+), 7 deletions(-)
diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/WebBtmTypeController.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/WebBtmTypeController.java
index 5e6f1f0..f9490cd 100644
--- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/WebBtmTypeController.java
+++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/WebBtmTypeController.java
@@ -54,7 +54,6 @@
@RequestMapping("/btmTypeController")
@VciBusinessLog(modelName="涓氬姟绫诲瀷")
@RestController
-@VciUnCheckRight
public class WebBtmTypeController {
/**
@@ -105,7 +104,6 @@
*/
@GetMapping( "/getBizTypes")
@VciBusinessLog(operateName = "涓氬姟绫诲瀷鍒楄〃(涓昏鐢ㄤ簬瀵硅瘽妗嗕娇鐢�)")
- @VciUnCheckRight
public BaseResult getBizTypes(String btmName){
try {
return BaseResult.dataList(Arrays.asList(btmService.getBizTypes(btmName)));
@@ -191,7 +189,7 @@
* btmTypeDTO 閾炬帴绫诲瀷淇敼鐨勫璞�
* @return 淇濆瓨缁撴灉
*/
- @PostMapping("/updateBtmType")
+ @PutMapping("/updateBtmType")
public BaseResult updateBtmType(@RequestBody OsBtmTypeDTO btmTypeDTO){
try {
return btmService.updateBtmType(btmTypeDTO) ? BaseResult.success("涓氬姟绫诲瀷淇敼鎴愬姛锛�"):BaseResult.fail("涓氬姟绫诲瀷淇敼澶辫触锛�");
@@ -404,7 +402,15 @@
@GetMapping(value = "/getAllAttributesByBtmId")
@VciBusinessLog(operateName = "鏌ョ湅涓氬姟绫诲瀷鐨勫睘鎬�")
public BaseResult<List<OsBtmTypeAttributeVO>> getAllAttributesByBtmId(String btmId){
- List<OsBtmTypeAttributeVO> osBtmTypeAttributeVOS = btmService.listAttributeByBtmIdHasDefault(btmId);
+ List<OsBtmTypeAttributeVO> osBtmTypeAttributeVOS = null;
+ try {
+ osBtmTypeAttributeVOS = btmService.listAttributeByBtmIdHasDefault(btmId);
+ } catch (PLException e) {
+ e.printStackTrace();
+ String exceptionMessage = VciBaseUtil.getExceptionMessage(e);
+ logger.error(exceptionMessage);
+ throw new VciBaseException(exceptionMessage);
+ }
return BaseResult.dataList(osBtmTypeAttributeVOS);
}
@@ -458,7 +464,15 @@
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("*","") : "";
- List<OsBtmTypeAttributeVO> boAttrs = btmService.listAttributeByBtmId(btmTypeId);
+ List<OsBtmTypeAttributeVO> boAttrs = null;
+ try {
+ boAttrs = btmService.listAttributeByBtmId(btmTypeId);
+ } catch (PLException e) {
+ e.printStackTrace();
+ String exceptionMessage = VciBaseUtil.getExceptionMessage(e);
+ logger.error(exceptionMessage);
+ throw new VciBaseException(exceptionMessage);
+ }
if(boAttrs == null){
boAttrs = new ArrayList<>();
}
@@ -469,7 +483,7 @@
OsBtmTypeAttributeVO attributeVO = new OsBtmTypeAttributeVO();
BeanUtil.convert(attr,attributeVO);
attributeVO.setAttributeLength(attr.getAttrLength());
- attributeVO.setAttrDataType(attr.getAttributeDataType());
+ attributeVO.setAttributeDataType(attr.getAttributeDataType());
attributeVO.setReferBtmTypeId(attr.getBtmTypeId());
attributeVO.setReferBtmTypeName(attr.getBtmTypeName());
finalBoAttrs.add(attributeVO);
@@ -506,7 +520,15 @@
String attrId = baseQueryObject.getConditionMap().containsKey("name")?baseQueryObject.getConditionMap().get("name").replace("*",""):"";
String attrName = baseQueryObject.getConditionMap().containsKey("label") ? baseQueryObject.getConditionMap().get("label").replace("*","") : "";
OsBtmTypeVO btmTypeVO = btmService.selectByOid(btmTypeOid);
- List<OsBtmTypeAttributeVO> boAttrs = btmService.listAttributeByBtmId(btmTypeVO.getId());
+ List<OsBtmTypeAttributeVO> boAttrs = null;
+ try {
+ boAttrs = btmService.listAttributeByBtmId(btmTypeVO.getId());
+ } catch (PLException e) {
+ e.printStackTrace();
+ String exceptionMessage = VciBaseUtil.getExceptionMessage(e);
+ logger.error(exceptionMessage);
+ throw new VciBaseException(exceptionMessage);
+ }
List<OsBtmTypeAttributeVO> attrList = boAttrs.stream().filter(s->{
boolean usedFlag = true;
if(StringUtils.isNotBlank(attrId) && !s.getId().contains(attrId)){
--
Gitblit v1.9.3