| | |
| | | |
| | | import com.vci.constant.FrameWorkLangCodeConstant; |
| | | import com.vci.dto.OsEnumDTO; |
| | | import com.vci.starter.web.annotation.controller.VciUnCheckRight; |
| | | import com.vci.starter.web.annotation.log.VciBusinessLog; |
| | | import com.vci.starter.web.exception.VciBaseException; |
| | | import com.vci.starter.web.pagemodel.BaseQueryObject; |
| | |
| | | import com.vci.pagemodel.OsEnumItemVO; |
| | | import com.vci.pagemodel.OsEnumVO; |
| | | import com.vci.starter.web.util.ControllerUtil; |
| | | import com.vci.starter.web.util.LangBaseUtil; |
| | | import com.vci.starter.web.util.LocalFileUtil; |
| | | import com.vci.starter.web.util.VciBaseUtil; |
| | | import com.vci.web.service.OsEnumServiceI; |
| | | import com.vci.web.util.Func; |
| | | import com.vci.starter.web.util.Lcm.Func; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | |
| | | * @return 枚举的下拉值 |
| | | */ |
| | | @VciBusinessLog(notStore=true,operateName="获取枚举") |
| | | @VciUnCheckRight |
| | | @GetMapping("/getEnum") |
| | | public BaseResult<List<KeyValue>> getEnum(String comboxKey){ |
| | | return BaseResult.success(enumService.getEnum(comboxKey)); |
| | |
| | | @GetMapping("/getDataEnum") |
| | | public BaseResult<List<KeyValue>> getDataEnum(String oid,String btmname){ |
| | | return BaseResult.success(enumService.getDataEnum(oid,btmname)); |
| | | } |
| | | |
| | | /** |
| | | * 根据枚举类型获取枚举 |
| | | * @param enumType 查询条件name |
| | | * @return 列表的内容 |
| | | */ |
| | | @GetMapping( "/getEnumMapByType") |
| | | @VciBusinessLog(operateName = "枚举列表") |
| | | public BaseResult getEnumMapByType(String enumType) { |
| | | try { |
| | | return BaseResult.dataList(enumService.getEnumMapByType(enumType)); |
| | | }catch (Exception e) { |
| | | e.printStackTrace(); |
| | | String exceptionMessage = "枚举管理列表查询时出现错误,原因:" + VciBaseUtil.getExceptionMessage(e); |
| | | logger.error(exceptionMessage); |
| | | return BaseResult.fail(exceptionMessage); |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @GetMapping( "/exportEnumTypes") |
| | | @VciBusinessLog(operateName = "导出枚举类型") |
| | | @VciUnCheckRight |
| | | public void exportEnumTypes(String exportFileName,String enumNames, HttpServletResponse response){ |
| | | try { |
| | | String excelPath = enumService.exportEnumTypes(exportFileName,enumNames); |
| | | String excelPath = enumService.exportEnumTypes(exportFileName,enumNames,false); |
| | | ControllerUtil.writeFileToResponse(response,excelPath); |
| | | } catch (Exception e) { |
| | | String msg = "导出枚举时出现错误,原因:" + VciBaseUtil.getExceptionMessage(e); |
| | |
| | | */ |
| | | @GetMapping( "/downloadEnumTemplate") |
| | | @VciBusinessLog(operateName = "导出枚举类型") |
| | | @VciUnCheckRight |
| | | public void downloadEnumTemplate(String exportFileName, HttpServletResponse response){ |
| | | try { |
| | | String excelPath = enumService.downloadEnumTemplate(exportFileName); |
| | |
| | | return BaseResult.fail(FrameWorkLangCodeConstant.IMPORT_FAIL, new String[]{"无导入的文件"}); |
| | | } |
| | | }catch (Throwable e) { |
| | | throw new VciBaseException(e.getMessage(),new String[0],e); |
| | | throw new VciBaseException(VciBaseUtil.getExceptionMessage(e),new String[0],e); |
| | | }finally { |
| | | file1.delete(); |
| | | } |