whyclxw
2025-01-02 3feb52d58b43e9c6d13b734d9045ec954072b6d6
当前人所在区域的所有id卡钥匙
2个文件已修改
22 ■■■■■ 已修改文件
src/main/java/com/whyc/controller/KeyInfController.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/service/KeyInfService.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/controller/KeyInfController.java
@@ -52,4 +52,10 @@
    public Response updateKey(@RequestBody KeyInf kinf){
        return service.updateKey(kinf);
    }
    @ApiOperation(value = "当前人所在区域的所有id卡钥匙")
    @GetMapping("getKeyInAreaByIdCard")
    public Response getKeyInAreaByIdCard(){
        return service.getKeyInAreaByIdCard();
    }
}
src/main/java/com/whyc/service/KeyInfService.java
@@ -8,6 +8,8 @@
import com.whyc.mapper.KeyInfMapper;
import com.whyc.pojo.db_area.KeyInf;
import com.whyc.pojo.db_area.LockInf;
import com.whyc.pojo.db_user.UserInf;
import com.whyc.util.ActionUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -133,4 +135,18 @@
                .collect(Collectors.toList()); // 转换为列表*/
        return new Response().setII(1,list!=null,lnameList,"查询所有钥匙名信息(用于下拉)");
    }
    //当前人所在区域的所有id卡钥匙
    public Response getKeyInAreaByIdCard() {
        //获取当前用户管理的区域
        UserInf uinf= ActionUtil.getUser();
        List areaList=new ArrayList();
        areaList.add(uinf.getAreaId());
        areaInfService.getAllAreaId(uinf.getAreaId(),areaList);
        //查询区域下的钥匙
        QueryWrapper wrapper=new QueryWrapper();
        wrapper.in("area_id",areaList);
        wrapper.eq("key_type",1);
        List<KeyInf> list=mapper.selectList(wrapper);
        return new Response().setII(1,list!=null,list,"当前人所在区域的所有id卡钥匙");
    }
}