diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/SafetyToolController.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/SafetyToolController.java index f8750e9..1e6bb6e 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/SafetyToolController.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/SafetyToolController.java @@ -1,5 +1,6 @@ package com.hnac.hzims.safeproduct.controller; +import cn.hutool.core.util.ObjectUtil; import com.baomidou.mybatisplus.core.metadata.IPage; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import com.hnac.hzims.common.logs.annotation.OperationAnnotation; @@ -26,6 +27,7 @@ import org.springblade.core.log.exception.ServiceException; import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Query; import org.springblade.core.tool.api.R; +import org.springblade.core.tool.api.ResultCode; import org.springblade.core.tool.utils.Func; import org.springblade.core.tool.utils.SpringUtil; import org.springframework.web.bind.annotation.*; @@ -84,18 +86,13 @@ public class SafetyToolController extends BladeController { return safetyToolService.doUpdate(safetyTool); } - /** - * 详情 - */ @GetMapping("/detail") @ApiOperationSupport(order = 40) @ApiOperation(value = "详情", notes = "传入safetyTool") @Operate(label = "详情", type = com.hnac.hzinfo.log.contants.BusinessType.QUERY, ignore = false) public R detail(@RequestParam("id") Long id) { - SafetyToolEntity detail = safetyToolService.getOne(Condition.getQueryWrapper(new SafetyToolEntity() {{ - setId(id); - }})); - return R.data(SafetyToolWrapper.build().entityVO(detail)); + SafetyToolVO safetyToolVO = safetyToolService.detail(id); + return R.data(safetyToolVO); } /** diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/ISafetyToolService.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/ISafetyToolService.java index 7731e49..862232c 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/ISafetyToolService.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/ISafetyToolService.java @@ -45,4 +45,11 @@ public interface ISafetyToolService extends IService { * @return */ R remove(List idList); + + /** + * 详情 + * @param id 安全工器具id + * @return 安全工器具VO类 + */ + SafetyToolVO detail(Long id); } diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/SafetyToolServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/SafetyToolServiceImpl.java index 6ad2f15..702c252 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/SafetyToolServiceImpl.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/SafetyToolServiceImpl.java @@ -38,6 +38,7 @@ import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Query; import org.springblade.core.secure.utils.AuthUtil; import org.springblade.core.tool.api.R; +import org.springblade.core.tool.api.ResultCode; import org.springblade.core.tool.utils.*; import org.springblade.system.feign.ISysClient; import org.springblade.system.user.entity.User; @@ -275,6 +276,20 @@ public class SafetyToolServiceImpl extends ServiceImpl