| | |
| | | package com.ruoyi.web.controller.smartor; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import com.github.pagehelper.ISelect; |
| | | import com.ruoyi.common.annotation.AddOrgId; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.core.domain.model.LoginUser; |
| | | import com.ruoyi.common.utils.PageUtils; |
| | | import com.smartor.domain.VO.PatSatisfactionReqVO; |
| | | import com.smartor.domain.VO.PatSatisfactionResVO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.apache.commons.collections4.CollectionUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | |
| | | */ |
| | | @ApiOperation("查询患者满意度列表") |
| | | //@PreAuthorize("@ss.hasPermi('smartor:satisfaction:list')") |
| | | @PostMapping("/list") |
| | | @AddOrgId(field = "orgid", paramIndex = 0, campusField = "campusid") |
| | | @PostMapping("list") |
| | | public TableDataInfo list(@RequestBody PatSatisfaction patSatisfaction) { |
| | | startPage(); |
| | | PageUtils.startPageByPost(patSatisfaction.getPageNum(), patSatisfaction.getPageSize()); |
| | | List<PatSatisfaction> list = patSatisfactionService.selectPatSatisfactionList(patSatisfaction); |
| | | return getDataTable(list); |
| | | //获取total |
| | | long total = PageUtils.count(new ISelect() { |
| | | @Override |
| | | public void doSelect() { |
| | | patSatisfaction.setPageNum(null); |
| | | patSatisfaction.setPageSize(null); |
| | | patSatisfactionService.selectPatSatisfactionList(patSatisfaction); |
| | | } |
| | | }); |
| | | return getDataTable2(total, list); |
| | | } |
| | | |
| | | /** |
| | |
| | | @Log(title = "患者满意度", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, PatSatisfaction patSatisfaction) { |
| | | LoginUser loginUser = getLoginUser(); |
| | | String orgid = loginUser.getUser().getOrgid(); |
| | | String campusid = loginUser.getUser().getCampusid(); |
| | | patSatisfaction.setOrgid(orgid); |
| | | patSatisfaction.setCampusid(campusid); |
| | | |
| | | List<PatSatisfaction> list = patSatisfactionService.selectPatSatisfactionList(patSatisfaction); |
| | | ExcelUtil<PatSatisfaction> util = new ExcelUtil<PatSatisfaction>(PatSatisfaction.class); |
| | | util.exportExcel(response, list, "患者满意度数据"); |
| | |
| | | @ApiOperation("新增患者满意度") |
| | | //@PreAuthorize("@ss.hasPermi('smartor:satisfaction:add')") |
| | | @Log(title = "患者满意度", businessType = BusinessType.INSERT) |
| | | @AddOrgId(field = "orgid", paramIndex = 0, campusField = "campusid") |
| | | @PostMapping("/add") |
| | | public AjaxResult add(@RequestBody PatSatisfaction patSatisfaction) { |
| | | LoginUser loginUser = getLoginUser(); |
| | |
| | | @ApiOperation("修改患者满意度") |
| | | //@PreAuthorize("@ss.hasPermi('smartor:satisfaction:edit')") |
| | | @Log(title = "患者满意度", businessType = BusinessType.UPDATE) |
| | | @AddOrgId(field = "orgid", paramIndex = 0, campusField = "campusid") |
| | | @PostMapping("/edit") |
| | | public AjaxResult edit(@RequestBody PatSatisfaction patSatisfaction) { |
| | | LoginUser loginUser = getLoginUser(); |
| | |
| | | public AjaxResult remove(@PathVariable Long[] ids) { |
| | | return toAjax(patSatisfactionService.deletePatSatisfactionByIds(ids)); |
| | | } |
| | | |
| | | /** |
| | | * 患者满意度统计 |
| | | */ |
| | | @ApiOperation("患者满意度统计") |
| | | @PostMapping("/statistics") |
| | | public Map<String, Object> statistics(@RequestBody PatSatisfactionReqVO patSatisfactionReqVO) { |
| | | //后端不做分页了,由前端做 |
| | | PatSatisfactionResVO statistics = patSatisfactionService.statistics(patSatisfactionReqVO); |
| | | return getDataTable3(CollectionUtils.isNotEmpty(statistics.getPatSatisfactionDetailEntities()) ? statistics.getPatSatisfactionDetailEntities().size() : 0, statistics); |
| | | } |
| | | /** |
| | | * 患者满意度柱状图信息 |
| | | */ |
| | | @ApiOperation("患者满意度柱状图信息") |
| | | @PostMapping("/satisfactionGraph") |
| | | public Map<String, Object> satisfactionGraph(@RequestBody PatSatisfactionReqVO patSatisfactionReqVO) { |
| | | Map<String, Object> patSatisfactionGraphResVOS = patSatisfactionService.satisfactionGraph(patSatisfactionReqVO); |
| | | return getDataTable3(0, patSatisfactionGraphResVOS); |
| | | } |
| | | |
| | | |
| | | } |