package com.ltkj.web.controller.system;
|
|
import java.util.Arrays;
|
import java.util.List;
|
import javax.annotation.Resource;
|
import javax.servlet.http.HttpServletResponse;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.ltkj.common.core.domain.entity.SysDept;
|
import com.ltkj.hosp.domain.TjHzLog;
|
import com.ltkj.system.service.ISysDeptService;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
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;
|
import org.springframework.web.bind.annotation.RestController;
|
import com.ltkj.common.annotation.Log;
|
import com.ltkj.common.core.controller.BaseController;
|
import com.ltkj.common.core.domain.AjaxResult;
|
import com.ltkj.common.enums.BusinessType;
|
import com.ltkj.hosp.domain.TjHzReplyLog;
|
import com.ltkj.hosp.service.ITjHzReplyLogService;
|
import com.ltkj.common.utils.poi.ExcelUtil;
|
import com.ltkj.common.core.page.TableDataInfo;
|
|
/**
|
* 会诊回复记录Controller
|
*
|
* @author ltkj_赵佳豪&李格
|
* @date 2023-11-22
|
*/
|
@RestController
|
@RequestMapping("/hosp/replylog")
|
public class TjHzReplyLogController extends BaseController {
|
@Autowired
|
private ITjHzReplyLogService tjHzReplyLogService;
|
|
@Resource
|
private ISysDeptService deptService;
|
|
/**
|
* 查询会诊回复记录列表
|
*/
|
@GetMapping("/list")
|
public TableDataInfo list(TjHzReplyLog tjHzReplyLog) {
|
startPage();
|
LambdaQueryWrapper<TjHzReplyLog> wq=new LambdaQueryWrapper<>();
|
if (tjHzReplyLog.getTjNumber()!=null){
|
wq.eq(TjHzReplyLog::getHzId,tjHzReplyLog.getHzId());
|
}
|
List<TjHzReplyLog> list = tjHzReplyLogService.list(wq);
|
return getDataTable(list);
|
}
|
|
/**
|
* 导出会诊回复记录列表
|
*/
|
@Log(title = "会诊回复记录", businessType = BusinessType.EXPORT)
|
@PostMapping("/export")
|
public void export(HttpServletResponse response, TjHzReplyLog tjHzReplyLog) {
|
List<TjHzReplyLog> list = tjHzReplyLogService.selectTjHzReplyLogList(tjHzReplyLog);
|
ExcelUtil<TjHzReplyLog> util = new ExcelUtil<TjHzReplyLog>(TjHzReplyLog.class);
|
util.exportExcel(response, list, "会诊回复记录数据");
|
}
|
|
/**
|
* 获取会诊回复记录详细信息
|
*/
|
@GetMapping(value = "/{id}")
|
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
return success(tjHzReplyLogService.selectTjHzReplyLogById(id));
|
}
|
|
/**
|
* 新增会诊回复记录
|
*/
|
@Log(title = "会诊回复记录", businessType = BusinessType.INSERT)
|
@PostMapping
|
public AjaxResult add(@RequestBody TjHzReplyLog tjHzReplyLog) {
|
if (tjHzReplyLog.getReplyDeptId()!=null){
|
final SysDept byId = deptService.getById(tjHzReplyLog.getReplyDeptId());
|
if (byId!=null){
|
tjHzReplyLog.setReplyDeptName(byId.getDeptName());
|
}
|
}
|
return toAjax(tjHzReplyLogService.save(tjHzReplyLog));
|
}
|
|
/**
|
* 修改会诊回复记录
|
*/
|
@Log(title = "会诊回复记录", businessType = BusinessType.UPDATE)
|
@PutMapping
|
public AjaxResult edit(@RequestBody TjHzReplyLog tjHzReplyLog) {
|
return toAjax(tjHzReplyLogService.saveOrUpdate(tjHzReplyLog));
|
}
|
|
/**
|
* 删除会诊回复记录
|
*/
|
@Log(title = "会诊回复记录", businessType = BusinessType.DELETE)
|
@DeleteMapping("/{ids}")
|
public AjaxResult remove(@PathVariable Long[] ids) {
|
return toAjax(tjHzReplyLogService.removeByIds(Arrays.asList(ids)));
|
}
|
}
|