From c9a3c90c074704de573f0024d5a695b5a04095f2 Mon Sep 17 00:00:00 2001 From: ludc Date: 星期四, 22 八月 2024 17:50:02 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/WebBtmTypeController.java | 88 +++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 83 insertions(+), 5 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 7e6b5cf..270d46a 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 @@ -4,6 +4,7 @@ import com.vci.corba.omd.btm.BizType; import com.vci.corba.omd.ltm.LinkType; import com.vci.dto.OsBtmTypeDTO; +import com.vci.model.IndexObject; import com.vci.starter.web.annotation.controller.VciUnCheckRight; import com.vci.starter.web.annotation.log.VciBusinessLog; import com.vci.starter.web.enumpck.BooleanEnum; @@ -30,6 +31,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Lazy; import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; import javax.servlet.http.HttpServletResponse; import java.io.FileNotFoundException; @@ -39,6 +41,7 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import java.util.Map; import java.util.stream.Collectors; import static com.vci.constant.FrameWorkBusLangCodeConstant.DATA_OID_NOT_EXIST; @@ -51,7 +54,6 @@ @RequestMapping("/btmTypeController") @VciBusinessLog(modelName="涓氬姟绫诲瀷") @RestController -@VciUnCheckRight public class WebBtmTypeController { /** @@ -171,7 +173,7 @@ * btmTypeDTO 閾炬帴绫诲瀷鐨勪繚瀛樺璞� * @return 淇濆瓨缁撴灉 */ - @PostMapping("/addBtmTypes") + /*@PostMapping("/addBtmTypes") public BaseResult addBtmTypes(@RequestBody List<BizType> bizTypes){ try { return btmService.addBtmTypes(bizTypes) ? BaseResult.success("涓氬姟绫诲瀷鎵归噺鍒涘缓鎴愬姛锛�"):BaseResult.fail("涓氬姟绫诲瀷鎵归噺鍒涘缓澶辫触锛�"); @@ -181,14 +183,14 @@ logger.error(exceptionMessage); return BaseResult.fail(exceptionMessage); } - } + }*/ /** * 淇敼涓氬姟绫诲瀷 * btmTypeDTO 閾炬帴绫诲瀷淇敼鐨勫璞� * @return 淇濆瓨缁撴灉 */ - @PostMapping("/updateBtmType") + @PutMapping("/updateBtmType") public BaseResult updateBtmType(@RequestBody OsBtmTypeDTO btmTypeDTO){ try { return btmService.updateBtmType(btmTypeDTO) ? BaseResult.success("涓氬姟绫诲瀷淇敼鎴愬姛锛�"):BaseResult.fail("涓氬姟绫诲瀷淇敼澶辫触锛�"); @@ -318,6 +320,82 @@ } /** + * 鑾峰彇褰撳墠涓氬姟绫诲瀷涓嬬殑绱㈠紩 + * @return + * @throws PLException + */ + @GetMapping("/getIndexByCondition") + public BaseResult getIndexByCondition(BaseQueryObject baseQueryObject){ + try { + return BaseResult.dataList(btmService.getIndexByCondition(baseQueryObject.getConditionMap())); + } catch (Exception e) { + e.printStackTrace(); + String exceptionMessage = "鏌ヨ褰撳墠涓氬姟绫诲瀷涓嬬殑绱㈠紩鏃舵椂鍑虹幇閿欒锛屽師鍥狅細" + VciBaseUtil.getExceptionMessage(e); + logger.error(exceptionMessage); + return BaseResult.fail(exceptionMessage); + } + } + + /** + * 鍒涘缓绱㈠紩 + * @param indexObjectList + * @return + */ + @PostMapping("/addIndex") + public BaseResult addIndex(@RequestBody List<IndexObject> indexObjectList){ + try { + return btmService.addIndex(indexObjectList) ? BaseResult.success("鍒涘缓绱㈠紩鎴愬姛!"):BaseResult.fail("鍒涘缓绱㈠紩澶辫触!"); + } catch (Exception e) { + e.printStackTrace(); + String exceptionMessage = "鍒涘缓绱㈠紩鏃舵椂鍑虹幇閿欒锛屽師鍥狅細" + VciBaseUtil.getExceptionMessage(e); + logger.error(exceptionMessage); + return BaseResult.fail(exceptionMessage); + } + } + + /** + * 鍒犻櫎绱㈠紩 + * @param btmName + * @param indexName + * @return + */ + @DeleteMapping("/delIndex") + public BaseResult delIndex(String btmName,String indexName){ + try { + return btmService.delIndex(btmName,indexName) ? BaseResult.success("鍒犻櫎绱㈠紩鎴愬姛!"):BaseResult.fail("鍒犻櫎绱㈠紩澶辫触!"); + } catch (Exception e) { + e.printStackTrace(); + String exceptionMessage = "鍒犻櫎绱㈠紩鏃舵椂鍑虹幇閿欒锛屽師鍥狅細" + VciBaseUtil.getExceptionMessage(e); + logger.error(exceptionMessage); + return BaseResult.fail(exceptionMessage); + } + } + + /** + * 瀵煎嚭涓氬姟绫诲瀷 + * name 閾炬帴绫诲瀷鍚嶇О + * @return + */ + @GetMapping("/expData") + public void expData(String name,HttpServletResponse response) throws PLException, IOException { + btmService.expData(name, response); + } + + /** + * 瀵煎叆涓氬姟绫诲瀷 + * @param file 涓婁紶鐨勬枃浠� + * @return + */ + @PostMapping("/impData") + @VciUnCheckRight + public BaseResult impData(MultipartFile file){try { + return btmService.impData(file); + }catch (Throwable e) { + throw new VciBaseException(VciBaseUtil.getExceptionMessage(e),new String[0],e); + } + } + + /** * 鑾峰彇涓氬姟绫诲瀷鍖呭惈鐨勫睘鎬у叏閮ㄤ负灏忓啓 * @param btmId 涓氬姟绫诲瀷鍚嶇О * @return 灞炴�х殑淇℃伅 @@ -390,7 +468,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); -- Gitblit v1.9.3