Commit 02fddc68 authored by 阎佳明's avatar 阎佳明

11

parent ab9f97c6
......@@ -39,13 +39,19 @@ import java.util.Map;
public class GridManController {
@Resource
private IGridManService gridManService;
@Resource
private IHomeService homeService;
@Resource
private IUserLoadService userLoadService;
@Resource
private IBuildingService buildingService;
@Resource
private GridManMapper gridManMapper;
@Resource
private HomeMapper homeMapper;
@Resource
private UserLoadMapper userLoadMapper;
@Resource
private BuildingMapper buildingMapper;
public GridManController() {
......@@ -96,7 +102,7 @@ public class GridManController {
@RequestParam("pageSize") Long pageSize) {
int id = Integer.parseInt(JwtUtils.getClaimByToken(token).getSubject());
LambdaQueryWrapper<Home> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(StringUtils.hasLength(String.valueOf(id)), Home::getGridmanId,id);
wrapper.eq(StringUtils.hasLength(String.valueOf(id)), Home::getUserId,id);
//分页
Page<Home> page = new Page<>(pageNo, pageSize);
homeService.page(page, wrapper);
......@@ -196,7 +202,7 @@ public class GridManController {
}
//网格员添加用户信息
@PostMapping("/addUser")
public Result<UserLoad> addHomeById(@RequestHeader("X-Token")String token,@RequestBody UserLoad userload) {
public Result<UserLoad> addUserById(@RequestHeader("X-Token")String token,@RequestBody UserLoad userload) {
int id = Integer.parseInt(JwtUtils.getClaimByToken(token).getSubject());
//添加新的房屋信息
userload.setGridmanId(id);
......@@ -206,7 +212,7 @@ public class GridManController {
}
//网格员修改用户信息
@PostMapping("/updateUser")
public Result<UserLoad> updateHomeById(@RequestHeader("X-Token")String token,@RequestBody UserLoad userload) {
public Result<UserLoad> updateUserById(@RequestHeader("X-Token")String token,@RequestBody UserLoad userload) {
int id = Integer.parseInt(JwtUtils.getClaimByToken(token).getSubject());
try{
userLoadService.updateById(userload);
......@@ -270,7 +276,7 @@ public class GridManController {
}
//网格员添加建筑物信息
@PostMapping("/addBuilding")
public Result<Building> addHomeById(@RequestHeader("X-Token")String token,@RequestBody Building building) {
public Result<Building> addBuildingById(@RequestHeader("X-Token")String token,@RequestBody Building building) {
int id = Integer.parseInt(JwtUtils.getClaimByToken(token).getSubject());
//添加新的房屋信息
building.setBuildingId(id);
......@@ -280,7 +286,7 @@ public class GridManController {
}
//网格员修改建筑物信息
@PostMapping("/updateBuilding")
public Result<Building> updateHomeById(@RequestHeader("X-Token")String token,@RequestBody Building building) {
public Result<Building> updateBuildingById(@RequestHeader("X-Token")String token,@RequestBody Building building) {
int id = Integer.parseInt(JwtUtils.getClaimByToken(token).getSubject());
try{
buildingService.updateById(building);
......
......@@ -2,6 +2,7 @@ package com.example.system.sys.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.system.sys.entity.Building;
import org.mapstruct.Mapper;
/**
* <p>
......@@ -11,6 +12,7 @@ import com.example.system.sys.entity.Building;
* @author xc
* @since 2023-06-29
*/
@Mapper
public interface BuildingMapper extends BaseMapper<Building> {
}
No preview for this file type
No preview for this file type
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment