|
@@ -1,8 +1,15 @@
|
|
|
package cn.iocoder.yudao.module.pms.controller.admin.iotoperationplan;
|
|
|
|
|
|
+import cn.iocoder.yudao.module.pms.controller.admin.inspect.plan.vo.IotInspectPlanRespVO;
|
|
|
import cn.iocoder.yudao.module.pms.service.iotoperationplandev.IotOperationPlanDevService;
|
|
|
+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.api.user.AdminUserApi;
|
|
|
+import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
|
|
|
import cn.iocoder.yudao.module.system.controller.admin.user.vo.user.UserUpdateStatusReqVO;
|
|
|
import cn.iocoder.yudao.module.system.service.dept.DeptService;
|
|
|
+import com.xingyuv.captcha.util.StringUtils;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
import javax.annotation.Resource;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
@@ -16,6 +23,7 @@ import javax.validation.*;
|
|
|
import javax.servlet.http.*;
|
|
|
import java.util.*;
|
|
|
import java.io.IOException;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
|
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
|
@@ -44,6 +52,10 @@ public class IotOperationPlanController {
|
|
|
private IotOperationPlanDevService planDevService;
|
|
|
@Resource
|
|
|
private DeptService deptService;
|
|
|
+ @Resource
|
|
|
+ private AdminUserApi adminUserApi;
|
|
|
+ @Autowired
|
|
|
+ private DeptApi deptApi;
|
|
|
|
|
|
@PutMapping("/update-status")
|
|
|
@Operation(summary = "修改巡检计划状态")
|
|
@@ -98,7 +110,25 @@ public class IotOperationPlanController {
|
|
|
idList.add(pageReqVO.getDeptId());
|
|
|
}
|
|
|
PageResult<IotOperationPlanDO> pageResult = iotOperationPlanService.getIotOperationPlanPage(pageReqVO,idList);
|
|
|
- return success(BeanUtils.toBean(pageResult, IotOperationPlanRespVO.class));
|
|
|
+
|
|
|
+ List<IotOperationPlanRespVO> collect = pageResult.getList().stream().map(e -> {
|
|
|
+ IotOperationPlanRespVO planRespVO = new IotOperationPlanRespVO();
|
|
|
+ BeanUtils.copyProperties(e, planRespVO);
|
|
|
+ if (StringUtils.isNotBlank(e.getCreator())) {
|
|
|
+ AdminUserRespDTO user = adminUserApi.getUser(Long.valueOf(e.getCreator()));
|
|
|
+ if (Objects.nonNull(user)) {
|
|
|
+ planRespVO.setCreateName(user.getNickname());
|
|
|
+ if (Objects.nonNull(e.getDeptId())) {
|
|
|
+ DeptRespDTO dept = deptApi.getDept(e.getDeptId());
|
|
|
+ planRespVO.setDeptName(Objects.nonNull(dept)?dept.getName():"");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return planRespVO;
|
|
|
+ }).collect(Collectors.toList());
|
|
|
+
|
|
|
+
|
|
|
+ return success(new PageResult<>(collect, pageResult.getTotal()));
|
|
|
}
|
|
|
|
|
|
/*@GetMapping("/export-excel")
|