| | |
| | | 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; |
| | |
| | | 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; |
| | |
| | | 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; |
| | |
| | | * btmTypeDTO 链接类型的保存对象 |
| | | * @return 保存结果 |
| | | */ |
| | | @PostMapping("/addBtmTypes") |
| | | /*@PostMapping("/addBtmTypes") |
| | | public BaseResult addBtmTypes(@RequestBody List<BizType> bizTypes){ |
| | | try { |
| | | return btmService.addBtmTypes(bizTypes) ? BaseResult.success("业务类型批量创建成功!"):BaseResult.fail("业务类型批量创建失败!"); |
| | |
| | | logger.error(exceptionMessage); |
| | | return BaseResult.fail(exceptionMessage); |
| | | } |
| | | } |
| | | }*/ |
| | | |
| | | /** |
| | | * 修改业务类型 |
| | |
| | | } |
| | | |
| | | /** |
| | | * 获取当前业务类型下的索引 |
| | | * @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 属性的信息 |