ÎļþÃû´Ó eims/ruoyi-modules/lb-eims/src/main/java/org/dromara/eims/controller/SysEquTypeController.java ÐÞ¸Ä |
| | |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import jakarta.validation.constraints.*; |
| | | import cn.dev33.satoken.annotation.SaCheckPermission; |
| | | import org.dromara.eims.domain.vo.EimsEquTypeVo; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.dromara.common.idempotent.annotation.RepeatSubmit; |
| | | import org.dromara.common.log.annotation.Log; |
| | | import org.dromara.common.web.core.BaseController; |
| | | import org.dromara.common.mybatis.core.page.PageQuery; |
| | | import org.dromara.common.core.domain.R; |
| | | import org.dromara.common.core.validate.AddGroup; |
| | | import org.dromara.common.core.validate.EditGroup; |
| | | import org.dromara.common.log.enums.BusinessType; |
| | | import org.dromara.common.excel.utils.ExcelUtil; |
| | | import org.dromara.eims.domain.vo.SysEquTypeVo; |
| | | import org.dromara.eims.domain.bo.SysEquTypeBo; |
| | | import org.dromara.eims.service.ISysEquTypeService; |
| | | import org.dromara.eims.domain.bo.EimsEquTypeBo; |
| | | import org.dromara.eims.service.IEimsEquTypeService; |
| | | |
| | | /** |
| | | * 设å¤ç±»å |
| | |
| | | @RequiredArgsConstructor |
| | | @RestController |
| | | @RequestMapping("/eims/equType") |
| | | public class SysEquTypeController extends BaseController { |
| | | public class EimsEquTypeController extends BaseController { |
| | | |
| | | private final ISysEquTypeService sysEquTypeService; |
| | | private final IEimsEquTypeService eimsEquTypeService; |
| | | |
| | | /** |
| | | * æ¥è¯¢è®¾å¤ç±»åå表 |
| | | */ |
| | | @SaCheckPermission("eims:equType:list") |
| | | @GetMapping("/list") |
| | | public R<List<SysEquTypeVo>> list(SysEquTypeBo bo) { |
| | | List<SysEquTypeVo> list = sysEquTypeService.queryList(bo); |
| | | public R<List<EimsEquTypeVo>> list(EimsEquTypeBo bo) { |
| | | List<EimsEquTypeVo> list = eimsEquTypeService.queryList(bo); |
| | | return R.ok(list); |
| | | } |
| | | |
| | |
| | | */ |
| | | @SaCheckPermission("eims:equType:list") |
| | | @GetMapping("/tree") |
| | | public R<List<Tree<Long>>> equTypeTree(SysEquTypeBo bo) { |
| | | return R.ok(sysEquTypeService.selectEquTypeTreeList(bo)); |
| | | public R<List<Tree<Long>>> equTypeTree(EimsEquTypeBo bo) { |
| | | return R.ok(eimsEquTypeService.selectEquTypeTreeList(bo)); |
| | | } |
| | | |
| | | /** |
| | |
| | | @SaCheckPermission("eims:equType:export") |
| | | @Log(title = "设å¤ç±»å", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export") |
| | | public void export(SysEquTypeBo bo, HttpServletResponse response) { |
| | | List<SysEquTypeVo> list = sysEquTypeService.queryList(bo); |
| | | ExcelUtil.exportExcel(list, "设å¤ç±»å", SysEquTypeVo.class, response); |
| | | public void export(EimsEquTypeBo bo, HttpServletResponse response) { |
| | | List<EimsEquTypeVo> list = eimsEquTypeService.queryList(bo); |
| | | ExcelUtil.exportExcel(list, "设å¤ç±»å", EimsEquTypeVo.class, response); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @SaCheckPermission("eims:equType:query") |
| | | @GetMapping("/{equTypeId}") |
| | | public R<SysEquTypeVo> getInfo(@NotNull(message = "主é®ä¸è½ä¸ºç©º") |
| | | public R<EimsEquTypeVo> getInfo(@NotNull(message = "主é®ä¸è½ä¸ºç©º") |
| | | @PathVariable Long equTypeId) { |
| | | return R.ok(sysEquTypeService.queryById(equTypeId)); |
| | | return R.ok(eimsEquTypeService.queryById(equTypeId)); |
| | | } |
| | | |
| | | /** |
| | |
| | | @Log(title = "设å¤ç±»å", businessType = BusinessType.INSERT) |
| | | @RepeatSubmit() |
| | | @PostMapping() |
| | | public R<Void> add(@Validated(AddGroup.class) @RequestBody SysEquTypeBo bo) { |
| | | return toAjax(sysEquTypeService.insertByBo(bo)); |
| | | public R<Void> add(@Validated(AddGroup.class) @RequestBody EimsEquTypeBo bo) { |
| | | return toAjax(eimsEquTypeService.insertByBo(bo)); |
| | | } |
| | | |
| | | /** |
| | |
| | | @Log(title = "设å¤ç±»å", businessType = BusinessType.UPDATE) |
| | | @RepeatSubmit() |
| | | @PutMapping() |
| | | public R<Void> edit(@Validated(EditGroup.class) @RequestBody SysEquTypeBo bo) { |
| | | return toAjax(sysEquTypeService.updateByBo(bo)); |
| | | public R<Void> edit(@Validated(EditGroup.class) @RequestBody EimsEquTypeBo bo) { |
| | | return toAjax(eimsEquTypeService.updateByBo(bo)); |
| | | } |
| | | |
| | | /** |
| | |
| | | return R.warn("è¯·éæ©éè¦å é¤çæ°æ®"); |
| | | } |
| | | for (int i = 0; i < equTypeIds.length; i++) { |
| | | if (sysEquTypeService.hasChildByEquTypeId(equTypeIds[i])) { |
| | | if (eimsEquTypeService.hasChildByEquTypeId(equTypeIds[i])) { |
| | | return R.warn("åå¨åèå,ä¸å
许å é¤"); |
| | | } |
| | | } |
| | | |
| | | return toAjax(sysEquTypeService.deleteWithValidByIds(List.of(equTypeIds), true)); |
| | | return toAjax(eimsEquTypeService.deleteWithValidByIds(List.of(equTypeIds), true)); |
| | | } |
| | | } |