app接口修改

This commit is contained in:
张博 2024-11-08 13:32:37 +08:00
parent 06f8a78e6a
commit a796a44185
4 changed files with 5 additions and 32 deletions

View File

@ -16,10 +16,6 @@ import net.shapelight.common.utils.PageUtils;
import net.shapelight.common.utils.R;
import net.shapelight.modules.appparent.annotation.Login;
import net.shapelight.modules.appparent.annotation.LoginUser;
import net.shapelight.modules.appparent.entity.AppUserEntity;
import net.shapelight.modules.appparent.entity.AppUserScopeEntity;
import net.shapelight.modules.appparent.service.AppUserScopeService;
import net.shapelight.modules.appparent.service.AppUserService;
import net.shapelight.modules.ten.entity.*;
import net.shapelight.modules.ten.service.*;
import org.springframework.beans.factory.annotation.Autowired;
@ -45,8 +41,6 @@ public class AppInfoApiController {
@Autowired
private TenCellService tenCellService;
@Autowired
private AppUserScopeService appUserScopeService;
@Autowired
private TenNoticeService tenNoticeService;
@Autowired
private TenRecordService tenRecordService;
@ -105,13 +99,11 @@ public class AppInfoApiController {
// @ApiImplicitParam(name="recordTimeStart",value = "开始时间",paramType = "query",dataType = "String",required = true),
// @ApiImplicitParam(name="recordTimeEnd",value = "结束时间",paramType = "query",dataType = "String",required = true),
})
public R openDoorRecordList(@LoginUser AppUserEntity user, @RequestBody Map<String, Object> params){
public R openDoorRecordList(@LoginUser TenParent user, @RequestBody Map<String, Object> params){
if(user == null){
return R.error("用户不存在");
}
AppUserScopeEntity scope = appUserScopeService.getById(user.getCurrentScopeId());
TenCellEntity cellEntity = tenCellService.getById(scope.getCellId());
TenCellEntity cellEntity = tenCellService.getById(user.getCellId());
if(cellEntity!=null){
params.put("cellId",cellEntity.getCellId());
int during = Integer.parseInt((String)params.get("during"));
@ -129,26 +121,16 @@ public class AppInfoApiController {
}
params.put("recordTimeStart",recordTimeStart);
params.put("recordTimeEnd",recordTimeEnd);
///小区管理员
if(scope.getRoleId() == Constant.ROLE_TEN_CELL){
params.put("cellId",scope.getCellId().toString());
PageUtils page = tenRecordService.queryPage(params);
return R.ok().put("data", page);
}
//业主
else if(scope.getRoleId() == Constant.PERSON_TYPE_PARENT){
List<TenRelation> relationList = relationService.list(new LambdaQueryWrapper<TenRelation>()
.eq(TenRelation::getParentId,user.getUserId()).eq(TenRelation::getStatus,1));
if(!relationList.isEmpty()) {
List<Long> list = relationList.stream().map(TenRelation::getStudentId).collect(Collectors.toList());
params.put("tenantId",user.getTenantId());
params.put("cellId",user.getCellId());
params.put("personIds",list);
PageUtils page = tenRecordService.getByPersonIds(params);
return R.ok().put("data", page);
}
}
}
return R.ok().put("data",new PageUtils(new ArrayList<>(),0,0,0));
}

View File

@ -10,9 +10,7 @@ import net.shapelight.common.utils.ServletUtils;
import net.shapelight.common.validator.ValidatorUtils;
import net.shapelight.modules.appparent.annotation.Login;
import net.shapelight.modules.appparent.annotation.LoginUser;
import net.shapelight.modules.appparent.entity.AppUserEntity;
import net.shapelight.modules.appparent.form.LoginForm;
import net.shapelight.modules.appparent.service.AppUserService;
import net.shapelight.modules.appparent.utils.JwtUtils;
import net.shapelight.modules.ten.entity.TenParent;
import net.shapelight.modules.ten.service.TenParentService;
@ -29,8 +27,6 @@ import java.util.Date;
@RequestMapping("/parent/app")
@Api("APP登录接口")
public class AppLoginController {
@Autowired
private AppUserService userService;
@Autowired
private JwtUtils jwtUtils;
// @Autowired

View File

@ -11,8 +11,6 @@ import net.shapelight.common.utils.R;
import net.shapelight.common.utils.RedisUtils;
import net.shapelight.modules.appparent.annotation.Login;
import net.shapelight.modules.appparent.annotation.LoginUser;
import net.shapelight.modules.appparent.entity.AppUserEntity;
import net.shapelight.modules.appparent.service.AppUserService;
import net.shapelight.modules.appparent.utils.MonyunSmsUtils;
import net.shapelight.modules.ten.entity.TenParent;
import net.shapelight.modules.ten.service.TenParentService;
@ -36,8 +34,6 @@ import java.util.Random;
@RequestMapping("/parent/app")
@Api("APP注册接口")
public class AppRegisterController {
@Autowired
private AppUserService userService;
@Autowired
private RedisUtils redisUtils;
@Autowired
@ -58,12 +54,12 @@ public class AppRegisterController {
//type=2 //忘记密码
//type=1 //修改绑定的手机
if (type == 1) {//注册//修改绑定的手机
AppUserEntity user = userService.findByMobile(mobile);
TenParent user = parentService.findByMobile(mobile);
if (user != null) {
return R.error("手机号码已注册");
}
} else if (type == 2) {//忘记密码
AppUserEntity user = userService.findByMobile(mobile);
TenParent user = parentService.findByMobile(mobile);
if (user == null) {
return R.error("当前手机号未被使用");
}

View File

@ -8,7 +8,6 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import net.shapelight.common.exception.RRException;
import net.shapelight.common.utils.PageUtils;
import net.shapelight.common.validator.Assert;
import net.shapelight.modules.appparent.entity.AppUserEntity;
import net.shapelight.modules.appparent.form.LoginForm;
import net.shapelight.modules.ten.dao.TenParentMapper;
import net.shapelight.modules.ten.entity.TenParent;