| | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.framework.web.service.TokenService; |
| | | import com.ruoyi.system.dto.UpdateDetailTeamDto; |
| | | import com.ruoyi.system.model.TAppUser; |
| | | import com.ruoyi.system.model.TAppUserEquipment; |
| | | import com.ruoyi.system.model.TAppUserLocation; |
| | | import com.ruoyi.system.service.TAppUserEquipmentService; |
| | | import com.ruoyi.system.service.TAppUserLocationService; |
| | | import com.ruoyi.system.service.TAppUserService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | private final TAppUserService appUserService; |
| | | private final TokenService tokenService; |
| | | private final PasswordEncoder passwordEncoder; |
| | | private final TAppUserEquipmentService appUserEquipmentService; |
| | | private final TAppUserLocationService appUserLocationService; |
| | | @Autowired |
| | | public TAppUserController(TAppUserService appUserService, TokenService tokenService, PasswordEncoder passwordEncoder) { |
| | | public TAppUserController(TAppUserService appUserService, TokenService tokenService, PasswordEncoder passwordEncoder, TAppUserEquipmentService appUserEquipmentService, TAppUserLocationService appUserLocationService) { |
| | | this.appUserService = appUserService; |
| | | this.tokenService = tokenService; |
| | | this.passwordEncoder = passwordEncoder; |
| | | this.appUserEquipmentService = appUserEquipmentService; |
| | | this.appUserLocationService = appUserLocationService; |
| | | } |
| | | |
| | | /** |
| | |
| | | return R.ok(appUser); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 查看人员管理详情--队伍情况 |
| | | */ |
| | | @ApiOperation(value = "查看人员管理详情--队伍情况",response = TAppUserEquipment.class) |
| | | @GetMapping(value = "/open/t-app-user/getDetailTeam") |
| | | public R<TAppUserEquipment> getDetailTeam() { |
| | | String userId = tokenService.getLoginUserApplet().getUserId(); |
| | | TAppUserEquipment tAppUserEquipment = appUserEquipmentService.getOne(Wrappers.lambdaQuery(TAppUserEquipment.class).eq(TAppUserEquipment::getAppUserId, userId)); |
| | | return R.ok(tAppUserEquipment); |
| | | } |
| | | |
| | | /** |
| | | * 查看人员管理详情--修改队伍情况 |
| | | */ |
| | | @ApiOperation(value = "查看人员管理详情--修改队伍情况",response = TAppUserEquipment.class) |
| | | @PostMapping(value = "/open/t-app-user/updateDetailTeam") |
| | | public R<?> updateDetailTeam(@RequestBody String param) { |
| | | String userId = tokenService.getLoginUserApplet().getUserId(); |
| | | UpdateDetailTeamDto dto = JSON.parseObject(param, UpdateDetailTeamDto.class); |
| | | TAppUserEquipment tAppUserEquipment = appUserEquipmentService.getOne(Wrappers.lambdaQuery(TAppUserEquipment.class).eq(TAppUserEquipment::getAppUserId, userId)); |
| | | tAppUserEquipment.setPersonCount(dto.getPersonCount()); |
| | | tAppUserEquipment.setEquipmentCount(dto.getEquipmentCount()); |
| | | appUserEquipmentService.updateById(tAppUserEquipment); |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 用户打点 |
| | | */ |
| | | @ApiOperation(value = "用户打点",response = TAppUserLocation.class) |
| | | @PostMapping(value = "/open/t-app-user/appUserLocation") |
| | | public R<?> appUserLocation(@RequestBody String param) { |
| | | TAppUserLocation location = JSON.parseObject(param,TAppUserLocation.class); |
| | | String userId = tokenService.getLoginUserApplet().getUserId(); |
| | | location.setAppUserId(userId); |
| | | appUserLocationService.save(location); |
| | | return R.ok(); |
| | | } |
| | | |
| | | } |
| | | |