|
|
@@ -12,6 +12,8 @@ import cn.iocoder.yudao.module.pms.controller.admin.qhse.cert.vo.QhseOrgCertSave
|
|
|
import cn.iocoder.yudao.module.pms.dal.dataobject.qhse.cert.QhseOrgCertDO;
|
|
|
import cn.iocoder.yudao.module.pms.dal.mysql.qhse.cert.QhseOrgCertMapper;
|
|
|
import cn.iocoder.yudao.module.pms.service.qhse.cert.QhseOrgCertService;
|
|
|
+import cn.iocoder.yudao.module.system.api.dept.DeptApi;
|
|
|
+import cn.iocoder.yudao.module.system.api.dept.dto.DeptRespDTO;
|
|
|
import cn.iocoder.yudao.module.system.service.dept.DeptService;
|
|
|
import com.google.common.collect.ImmutableMap;
|
|
|
import io.swagger.v3.oas.annotations.Operation;
|
|
|
@@ -30,6 +32,7 @@ import java.util.HashSet;
|
|
|
import java.util.List;
|
|
|
import java.util.Objects;
|
|
|
import java.util.Set;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
|
|
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
|
|
@@ -47,6 +50,8 @@ public class QhseOrgCertController {
|
|
|
private DeptService deptService;
|
|
|
@Autowired
|
|
|
private QhseOrgCertMapper qhseOrgCertMapper;
|
|
|
+ @Autowired
|
|
|
+ private DeptApi deptApi;
|
|
|
|
|
|
@PostMapping("/create")
|
|
|
@Operation(summary = "创建QHSE组织证书管理")
|
|
|
@@ -86,7 +91,18 @@ public class QhseOrgCertController {
|
|
|
@PreAuthorize("@ss.hasPermission('rq:qhse-org-cert:query')")
|
|
|
public CommonResult<PageResult<QhseOrgCertRespVO>> getQhseOrgCertPage(@Valid QhseOrgCertPageReqVO pageReqVO) {
|
|
|
PageResult<QhseOrgCertDO> pageResult = qhseOrgCertService.getQhseOrgCertPage(pageReqVO);
|
|
|
- return success(BeanUtils.toBean(pageResult, QhseOrgCertRespVO.class));
|
|
|
+ List<QhseOrgCertRespVO> collect = pageResult.getList().stream().map(e -> {
|
|
|
+ QhseOrgCertRespVO qhseOrgCertRespVO = new QhseOrgCertRespVO();
|
|
|
+ BeanUtils.copyProperties(e, qhseOrgCertRespVO);
|
|
|
+ if (Objects.nonNull(qhseOrgCertRespVO.getDeptId())) {
|
|
|
+ DeptRespDTO dept = deptApi.getDept(qhseOrgCertRespVO.getDeptId());
|
|
|
+ if(Objects.nonNull(dept)){
|
|
|
+ qhseOrgCertRespVO.setDeptName(dept.getName());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return qhseOrgCertRespVO;
|
|
|
+ }).collect(Collectors.toList());
|
|
|
+ return success(new PageResult<>(collect, pageResult.getTotal()));
|
|
|
}
|
|
|
|
|
|
@GetMapping("/export-excel")
|