| | |
| | | package com.ruoyi.web.controller.api; |
| | | |
| | | |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.core.domain.model.LoginUser; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.bean.BeanUtils; |
| | | import com.ruoyi.framework.web.service.TokenService; |
| | | import com.ruoyi.system.dto.HandleProblemEscalationDTO; |
| | | import com.ruoyi.system.model.TDictData; |
| | | import com.ruoyi.system.model.TProblemEscalation; |
| | | import com.ruoyi.system.model.TSystemBulletin; |
| | | import com.ruoyi.system.query.FeedbackQuery; |
| | | import com.ruoyi.system.query.ProblemEscalationQuery; |
| | | import com.ruoyi.system.service.ISysUserService; |
| | | import com.ruoyi.system.service.TDictDataService; |
| | | import com.ruoyi.system.service.TProblemEscalationService; |
| | | import com.ruoyi.system.vo.system.FeedbackListVO; |
| | | import com.ruoyi.system.vo.system.ProblemEscalationDetailVO; |
| | | import com.ruoyi.system.vo.system.ProblemEscalationListVO; |
| | | import io.swagger.annotations.Api; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @RestController |
| | | @RequestMapping("/t-problem-escalation") |
| | | public class TProblemEscalationController { |
| | | @Resource |
| | | private TProblemEscalationService problemEscalationService; |
| | | @Resource |
| | | private TokenService tokenService; |
| | | @Resource |
| | | private TDictDataService dictDataService; |
| | | @ApiOperation(value = "问题上报分页列表") |
| | | @PostMapping(value = "/pageList") |
| | | public R<PageInfo<ProblemEscalationListVO>> pageList(@RequestBody ProblemEscalationQuery query) { |
| | | return R.ok(problemEscalationService.pageList(query)); |
| | | } |
| | | @Log(title = "问题上报-处理", businessType = BusinessType.OTHER) |
| | | @ApiOperation(value = "问题上报-处理") |
| | | @PostMapping(value = "/handle") |
| | | public R<Boolean> handle(@RequestBody HandleProblemEscalationDTO dto) { |
| | | LoginUser loginUser = tokenService.getLoginUser(); |
| | | dto.setHandleId(loginUser.getUserId()+""); |
| | | dto.setHandleTime(LocalDateTime.now()); |
| | | problemEscalationService.updateById(dto); |
| | | return R.ok(); |
| | | } |
| | | @Resource |
| | | private ISysUserService sysUserService; |
| | | |
| | | @ApiOperation(value = "详情") |
| | | @GetMapping(value = "/detail") |
| | | public R<ProblemEscalationDetailVO> detail(@RequestParam String id) { |
| | | ProblemEscalationDetailVO problemEscalationDetailVO = new ProblemEscalationDetailVO(); |
| | | TProblemEscalation byId = problemEscalationService.getById(id); |
| | | BeanUtils.copyProperties(byId,problemEscalationDetailVO); |
| | | TDictData byId1 = dictDataService.getById(byId.getEscalationType()); |
| | | SysUser sysUser = sysUserService.selectUserById(Long.valueOf(byId.getHandleId())); |
| | | if (sysUser!=null){ |
| | | problemEscalationDetailVO.setHandleName(sysUser.getUserName()); |
| | | } |
| | | problemEscalationDetailVO.setEscalationTypeName(byId1.getDataContent()); |
| | | return R.ok(problemEscalationDetailVO); |
| | | } |
| | | } |
| | | |