diff --git a/shapelight-admin/src/main/java/net/shapelight/modules/appparent/controller/AppInfoApiController.java b/shapelight-admin/src/main/java/net/shapelight/modules/appparent/controller/AppInfoApiController.java index 11e02eb..24be93e 100644 --- a/shapelight-admin/src/main/java/net/shapelight/modules/appparent/controller/AppInfoApiController.java +++ b/shapelight-admin/src/main/java/net/shapelight/modules/appparent/controller/AppInfoApiController.java @@ -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 params){ + public R openDoorRecordList(@LoginUser TenParent user, @RequestBody Map 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 relationList = relationService.list(new LambdaQueryWrapper() .eq(TenRelation::getParentId,user.getUserId()).eq(TenRelation::getStatus,1)); if(!relationList.isEmpty()) { List 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)); } diff --git a/shapelight-admin/src/main/java/net/shapelight/modules/appparent/controller/AppLoginController.java b/shapelight-admin/src/main/java/net/shapelight/modules/appparent/controller/AppLoginController.java index 563f202..11085d7 100644 --- a/shapelight-admin/src/main/java/net/shapelight/modules/appparent/controller/AppLoginController.java +++ b/shapelight-admin/src/main/java/net/shapelight/modules/appparent/controller/AppLoginController.java @@ -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 diff --git a/shapelight-admin/src/main/java/net/shapelight/modules/appparent/controller/AppRegisterController.java b/shapelight-admin/src/main/java/net/shapelight/modules/appparent/controller/AppRegisterController.java index 3b3f05e..459dbb8 100644 --- a/shapelight-admin/src/main/java/net/shapelight/modules/appparent/controller/AppRegisterController.java +++ b/shapelight-admin/src/main/java/net/shapelight/modules/appparent/controller/AppRegisterController.java @@ -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("当前手机号未被使用"); } diff --git a/shapelight-admin/src/main/java/net/shapelight/modules/ten/service/impl/TenParentServiceImpl.java b/shapelight-admin/src/main/java/net/shapelight/modules/ten/service/impl/TenParentServiceImpl.java index 0b92e3c..00a3266 100644 --- a/shapelight-admin/src/main/java/net/shapelight/modules/ten/service/impl/TenParentServiceImpl.java +++ b/shapelight-admin/src/main/java/net/shapelight/modules/ten/service/impl/TenParentServiceImpl.java @@ -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;