From 6c391d600182930913b43e2f63b7d3cfa131cfc2 Mon Sep 17 00:00:00 2001 From: ludc Date: 星期三, 14 八月 2024 16:27:58 +0800 Subject: [PATCH] 业务类型创建索引、导出、导入等接口,属性池导入接口调整上传。 --- Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/WebBtmTypeController.java | 83 ++++++++++++++++++++++++++++++++++++++++- 1 files changed, 81 insertions(+), 2 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..5e6f1f0 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; @@ -171,7 +174,7 @@ * btmTypeDTO 閾炬帴绫诲瀷鐨勪繚瀛樺璞� * @return 淇濆瓨缁撴灉 */ - @PostMapping("/addBtmTypes") + /*@PostMapping("/addBtmTypes") public BaseResult addBtmTypes(@RequestBody List<BizType> bizTypes){ try { return btmService.addBtmTypes(bizTypes) ? BaseResult.success("涓氬姟绫诲瀷鎵归噺鍒涘缓鎴愬姛锛�"):BaseResult.fail("涓氬姟绫诲瀷鎵归噺鍒涘缓澶辫触锛�"); @@ -181,7 +184,7 @@ logger.error(exceptionMessage); return BaseResult.fail(exceptionMessage); } - } + }*/ /** * 淇敼涓氬姟绫诲瀷 @@ -318,6 +321,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 灞炴�х殑淇℃伅 -- Gitblit v1.9.3