Browse Source

用户编辑处理

lipenghui 3 weeks ago
parent
commit
65e1f14dbe

+ 13 - 1
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/iotdeviceperson/IotDevicePersonController.java

@@ -131,4 +131,16 @@ public class IotDevicePersonController {
                         BeanUtils.toBean(list, IotDevicePersonRespVO.class));
                         BeanUtils.toBean(list, IotDevicePersonRespVO.class));
     }
     }
 
 
-}
+    @GetMapping("/if/duty/{id}")
+    @Operation(summary = "是否责任人")
+    public CommonResult<Long> ifDuty(@PathVariable("id") Long id) {
+        IotDevicePersonPageReqVO pageReqVO = new IotDevicePersonPageReqVO();
+        pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
+        pageReqVO.setPersonId(id);
+        PageResult<IotDevicePersonDO> iotDevicePersonPage = iotDevicePersonService.getIotDevicePersonPage(pageReqVO);
+        if (CollUtil.isNotEmpty(iotDevicePersonPage.getList())) {
+            return success(1L);
+        }
+        return success(0L);
+    }
+}

+ 4 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/mysql/IotProductClassifyMapper.java

@@ -10,6 +10,7 @@ import org.apache.ibatis.annotations.Mapper;
 
 
 import java.util.Collection;
 import java.util.Collection;
 import java.util.List;
 import java.util.List;
+import java.util.Set;
 
 
 /**
 /**
  * 设备分类 Mapper
  * 设备分类 Mapper
@@ -24,6 +25,9 @@ public interface IotProductClassifyMapper extends BaseMapperX<IotProductClassify
     default IotProductClassifyDO selectByParentIdAndName(Long parentId, String name) {
     default IotProductClassifyDO selectByParentIdAndName(Long parentId, String name) {
         return selectOne(IotProductClassifyDO::getParentId, parentId, IotProductClassifyDO::getName, name);
         return selectOne(IotProductClassifyDO::getParentId, parentId, IotProductClassifyDO::getName, name);
     }
     }
+    default List<IotProductClassifyDO> selectByName(Set<String> ids) {
+        return selectList(IotProductClassifyDO::getName, ids);
+    }
     default List<IotProductClassifyDO> selectList(IotProductClassifyListReqVO reqVO) {
     default List<IotProductClassifyDO> selectList(IotProductClassifyListReqVO reqVO) {
         return selectList(new LambdaQueryWrapperX<IotProductClassifyDO>()
         return selectList(new LambdaQueryWrapperX<IotProductClassifyDO>()
                 .likeIfPresent(IotProductClassifyDO::getName, reqVO.getName())
                 .likeIfPresent(IotProductClassifyDO::getName, reqVO.getName())