Browse Source

fix: 解决安全工器具扫描导出的二维码报错的问题

zhongwei
liwen 4 months ago
parent
commit
809aad8d3e
  1. 11
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/SafetyToolController.java
  2. 7
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/ISafetyToolService.java
  3. 15
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/SafetyToolServiceImpl.java

11
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<SafetyToolVO> 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);
}
/**

7
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/ISafetyToolService.java

@ -45,4 +45,11 @@ public interface ISafetyToolService extends IService<SafetyToolEntity> {
* @return
*/
R remove(List<Long> idList);
/**
* 详情
* @param id 安全工器具id
* @return 安全工器具VO类
*/
SafetyToolVO detail(Long id);
}

15
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<SafetyToolMapper, SafetyT
return R.status(removeByIds(idList));
}
/**
* 详情
*/
@Override
public SafetyToolVO detail(Long id) {
SafetyToolEntity detail = this.getOne(Condition.getQueryWrapper(new SafetyToolEntity() {{
setId(id);
}}));
if (cn.hutool.core.util.ObjectUtil.isEmpty(detail)) {
throw new ServiceException(ResultCode.REQ_REJECT, "没有访问该安全工器具的权限");
}
return SafetyToolWrapper.build().entityVO(detail);
}
/**
* 工器具Code唯一性校验

Loading…
Cancel
Save