| | |
| | | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.framework.web.service.TokenService; |
| | | import com.ruoyi.system.domain.TIndexMenu; |
| | | import com.ruoyi.system.domain.TUserChange; |
| | | import com.ruoyi.system.domain.TUserChangeDetail; |
| | | import com.ruoyi.system.domain.*; |
| | | import com.ruoyi.system.dto.AllertTitleDto; |
| | | import com.ruoyi.system.dto.RegionDto; |
| | | import com.ruoyi.system.service.TIndexMenuService; |
| | | import com.ruoyi.system.service.TRegionService; |
| | | import com.ruoyi.system.service.TUserChangeDetailService; |
| | | import com.ruoyi.system.service.TUserChangeService; |
| | | import com.ruoyi.system.service.*; |
| | | import com.ruoyi.web.controller.query.CityQueryDto; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.nio.file.LinkOption; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | @RestController |
| | | @RequestMapping("/web") |
| | |
| | | private TUserChangeService changeService; |
| | | @Resource |
| | | private TUserChangeDetailService changeDetailService; |
| | | @Resource |
| | | private TAppUserService appUserService; |
| | | |
| | | @ApiOperation(value = "获取地区树状图",tags = "web端偏好设置") |
| | | @PostMapping(value = "/region/tree") |
| | |
| | | |
| | | @ApiOperation(value = "通过cityCodes查职称分类",tags = "web端偏好设置") |
| | | @PostMapping(value = "/title/tree") |
| | | public R<List<AllertTitleDto>> list(@RequestBody CityQueryDto cityQueryDto) { |
| | | |
| | | public R<List<AllertTitleDto>> list(@Validated @RequestBody CityQueryDto cityQueryDto) { |
| | | String[] split = cityQueryDto.getStrings().split(","); |
| | | cityQueryDto.getCityCode().addAll(Arrays.asList(split)); |
| | | List<AllertTitleDto> allertTitleDtos = indexMenuService.allert(cityQueryDto.getCityCode()); |
| | | |
| | | return R.ok(allertTitleDtos); |
| | | } |
| | | |
| | |
| | | @PostMapping(value = "/title/set") |
| | | public R<List<AllertTitleDto>> set(@RequestBody List<TUserChangeDetail> userChangeDetails) { |
| | | Long userId = tokenService.getLoginUser().getUserId(); |
| | | TAppUser byId = appUserService.getById(userId); |
| | | if(Objects.nonNull(byId)){ |
| | | byId.setIsSetPreference(1); |
| | | appUserService.updateById(byId); |
| | | } |
| | | |
| | | //保存一次变更记录 |
| | | |