| | |
| | | package com.ruoyi.web.controller.api; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.system.model.*; |
| | |
| | | private final TLargeVolunteerService largeVolunteerService; |
| | | private final TLargeKeyGridUserService largeKeyGridUserService; |
| | | private final TLargeKeyPersonnelTypeService largeKeyPersonnelTypeService; |
| | | private final THelpNeedsService tHelpNeedsService; |
| | | @Autowired |
| | | public DataStatisticsController(TAppealServicesService appealServicesService, TOldsterWarningService oldsterWarningService, THtmlConfigService htmlConfigService, TLargeDeptService largeDeptService, TLargeUserService largeUserService, TLargeOrganizationService largeOrganizationService, TLargeResourceService largeResourceService, TLargeSocialWorkerService largeSocialWorkerService, TLargeVolunteerService largeVolunteerService, TLargeKeyGridUserService largeKeyGridUserService, TLargeKeyPersonnelTypeService largeKeyPersonnelTypeService) { |
| | | public DataStatisticsController(TAppealServicesService appealServicesService, TOldsterWarningService oldsterWarningService, THtmlConfigService htmlConfigService, TLargeDeptService largeDeptService, TLargeUserService largeUserService, TLargeOrganizationService largeOrganizationService, TLargeResourceService largeResourceService, TLargeSocialWorkerService largeSocialWorkerService, TLargeVolunteerService largeVolunteerService, TLargeKeyGridUserService largeKeyGridUserService, TLargeKeyPersonnelTypeService largeKeyPersonnelTypeService, THelpNeedsService tHelpNeedsService) { |
| | | this.appealServicesService = appealServicesService; |
| | | this.oldsterWarningService = oldsterWarningService; |
| | | this.htmlConfigService = htmlConfigService; |
| | |
| | | this.largeVolunteerService = largeVolunteerService; |
| | | this.largeKeyGridUserService = largeKeyGridUserService; |
| | | this.largeKeyPersonnelTypeService = largeKeyPersonnelTypeService; |
| | | this.tHelpNeedsService = tHelpNeedsService; |
| | | } |
| | | |
| | | /** |
| | |
| | | long appealServicesCount = appealServicesService.count(); |
| | | // 养老告警事件 |
| | | long warningCount = oldsterWarningService.count(); |
| | | // 随手拍 |
| | | long photoCount = appealServicesService.count(new LambdaQueryWrapper<TAppealServices>().eq(TAppealServices::getAppealType,2)); |
| | | // 诉求服务 |
| | | long appealCount = appealServicesService.count(new LambdaQueryWrapper<TAppealServices>().eq(TAppealServices::getAppealType,1)); |
| | | // 助需 |
| | | long helpNeedsCount = tHelpNeedsService.count(); |
| | | Map<String,Long> map = new HashMap<>(); |
| | | map.put("appealServicesCount",appealServicesCount); |
| | | map.put("warningCount",warningCount); |
| | | map.put("photoCount",photoCount); |
| | | map.put("appealCount",appealCount); |
| | | map.put("helpNeedsCount",helpNeedsCount); |
| | | return R.ok(map); |
| | | } |
| | | |
| | |
| | | @PostMapping("/getMicroWishList") |
| | | public R<Page<TMicroWish>> getMicroWishList(@RequestBody MicroWishListQuery query) { |
| | | Page<TMicroWish> page = new Page<>(query.getPageNum(), query.getPageSize()); |
| | | Page<TMicroWish> tMicroWishPage = tMicroWishService.page(page, new LambdaQueryWrapper<TMicroWish>().eq(TMicroWish::getWishType, 1).eq(TMicroWish::getStatus, 2).like(Objects.nonNull(query.getWishDescription()), TMicroWish::getWishDescription, query.getWishDescription()).orderByDesc(BaseModel::getCreateTime)); |
| | | Page<TMicroWish> tMicroWishPage = tMicroWishService.page(page, new LambdaQueryWrapper<TMicroWish>().eq(TMicroWish::getWishType, 1).eq(TMicroWish::getState,1).eq(TMicroWish::getStatus, 2).like(Objects.nonNull(query.getWishDescription()), TMicroWish::getWishDescription, query.getWishDescription()).orderByDesc(BaseModel::getCreateTime)); |
| | | List<TMicroWish> records = tMicroWishPage.getRecords(); |
| | | List<String> appUserIds = records.stream().map(TMicroWish::getAppUserId).collect(Collectors.toList()); |
| | | if(!CollectionUtils.isEmpty(appUserIds)){ |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.core.domain.BaseModel; |
| | | import com.ruoyi.common.core.domain.BasePage; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.framework.web.service.TokenService; |
| | | import com.ruoyi.system.dto.UpdateMicroWishStateDto; |
| | | import com.ruoyi.system.dto.UpdatePhoneDto; |
| | | import com.ruoyi.system.dto.UpdateUserDto; |
| | | import com.ruoyi.system.model.TAppUser; |
| | |
| | | return R.ok(microWishPage); |
| | | } |
| | | |
| | | @ApiOperation(value = "个人中心--微心愿上下架",response = TMicroWish.class) |
| | | @PostMapping(value = "/updateMicroWishState") |
| | | public R<?> updateMicroWishState(@RequestBody UpdateMicroWishStateDto dto) { |
| | | String userId = tokenService.getLoginUserApplet().getUserId(); |
| | | TMicroWish microWish = tMicroWishService.getById(dto.getId()); |
| | | if(!userId.equals(microWish.getAppUserId())){ |
| | | return R.fail("无权限操作"); |
| | | } |
| | | microWish.setState(dto.getState()); |
| | | tMicroWishService.updateById(microWish); |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "个人中心--微心愿详情",response = TMicroWish.class) |
| | | @GetMapping(value = "/getMicroWishDetail/{id}") |
| | | public R<TMicroWish> getMicroWishDetail(@PathVariable String id) { |
| | |
| | | return R.ok(microWish); |
| | | } |
| | | |
| | | @ApiOperation(value = "个人中心--微心愿删除",response = TMicroWish.class) |
| | | @DeleteMapping(value = "/delMicroWish/{id}") |
| | | public R<TMicroWish> delMicroWish(@PathVariable String id) { |
| | | boolean b = tMicroWishService.removeById(id); |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "个人中心--修改手机号") |
| | | @PostMapping(value = "/updatePhone") |
| | |
| | | "/t-large-user/pageListLarge","/t-large-volunteer/pageListLarge", |
| | | "/pension/getAssistedDiningList", |
| | | "/pension/getAssistedDiningDetail", |
| | | "/statistics/**","/course/**","/wx/**" |
| | | "/statistics/**","/course/**","/wx/**","/t-help-needs/pageList" |
| | | ).permitAll() |
| | | // 静态资源,可匿名访问 |
| | | .antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll() |
| New file |
| | |
| | | package com.ruoyi.system.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel("修改微心愿上下架状态DTO") |
| | | public class UpdateMicroWishStateDto { |
| | | @ApiModelProperty(value = "微心愿id") |
| | | private String id; |
| | | |
| | | @ApiModelProperty(value = "状态 1=上架 2=下架") |
| | | private Integer state; |
| | | } |
| | |
| | | @TableField("id_card") |
| | | private String idCard; |
| | | |
| | | @ApiModelProperty(value = "1上架 2下架") |
| | | @TableField("state") |
| | | private Integer state; |
| | | |
| | | @ApiModelProperty(value = "头像") |
| | | @TableField(exist = false) |
| | | private String avatar; |