| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.ltkj.framework.config.MatchUtils; |
| | | import com.ltkj.hosp.domain.TjAskHistorys; |
| | | import com.ltkj.hosp.domain.TjCustomer; |
| | | import com.ltkj.hosp.service.ITjAskHistorysService; |
| | | import com.ltkj.hosp.service.ITjCustomerService; |
| | | import com.ltkj.hosp.domain.*; |
| | | import com.ltkj.hosp.service.*; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.val; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.*; |
| | | 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.TjAskMedicalHistory; |
| | | import com.ltkj.hosp.service.ITjAskMedicalHistoryService; |
| | | import com.ltkj.common.utils.poi.ExcelUtil; |
| | | import com.ltkj.common.core.page.TableDataInfo; |
| | | |
| | |
| | | @Resource |
| | | private ITjCustomerService tjCustomerService; |
| | | |
| | | @Autowired |
| | | private ITjAskWorkLogService tjAskWorkLogService; |
| | | @Autowired |
| | | private ITjHarmTypeLogService tjHarmTypeLogService; |
| | | |
| | | |
| | | /** |
| | | * 查询问诊列表 |
| | | */ |
| | | // @PreAuthorize("@ss.hasPermi('hosp:history:list')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(TjAskMedicalHistory tjAskMedicalHistory) { |
| | | startPage(); |
| | |
| | | /** |
| | | * 导出问诊列表 |
| | | */ |
| | | // @PreAuthorize("@ss.hasPermi('hosp:history:export')") |
| | | @Log(title = "问诊", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, TjAskMedicalHistory tjAskMedicalHistory) { |
| | |
| | | /** |
| | | * 获取问诊详细信息 |
| | | */ |
| | | // @PreAuthorize("@ss.hasPermi('hosp:history:query')") |
| | | @GetMapping(value = "/{askId}") |
| | | public AjaxResult getInfo(@PathVariable("askId") Long askId) { |
| | | return success(tjAskMedicalHistoryService.selectTjAskMedicalHistoryByAskId(askId)); |
| | |
| | | /** |
| | | * 新增问诊 |
| | | */ |
| | | //@PreAuthorize("@ss.hasPermi('hosp:history:add')") |
| | | @Transactional |
| | | @Log(title = "问诊", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@RequestBody TjAskMedicalHistory tjAskMedicalHistory) { |
| | | return toAjax(tjAskMedicalHistoryService.insertTjAskMedicalHistory(tjAskMedicalHistory)); |
| | | tjAskMedicalHistoryService.insertTjAskMedicalHistory(tjAskMedicalHistory); |
| | | final List<TjAskWorkLog> workLogs = tjAskMedicalHistory.getWorkLogs(); |
| | | for (TjAskWorkLog workLog : workLogs) { |
| | | final boolean save = tjAskWorkLogService.save(workLog); |
| | | if (!save){ |
| | | return AjaxResult.error(); |
| | | } |
| | | List<TjHarmTypeLog> harmTypeLogs = workLog.getHarmTypeLogs(); |
| | | for (TjHarmTypeLog harmTypeLog : harmTypeLogs) { |
| | | final boolean save1 = tjHarmTypeLogService.save(harmTypeLog); |
| | | if (!save1){ |
| | | return AjaxResult.error(); |
| | | } |
| | | } |
| | | } |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | |
| | |
| | | * pc端修改问诊 |
| | | */ |
| | | @ApiOperation(value = "pc端修改问诊") |
| | | //@PreAuthorize("@ss.hasPermi('hosp:history:edit')") |
| | | @Log(title = "问诊", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | @Transactional |
| | | public AjaxResult edit(@RequestBody TjAskMedicalHistory tjAskMedicalHistory) { |
| | | boolean b =false; |
| | | tjAskMedicalHistory.setFromBy("PC端"); |
| | |
| | | for (TjAskHistorys tjAskHistorys : tjAskMedicalHistory.getTjAskHistorysList()) { |
| | | tjAskHistorys.setAskId(tjAskMedicalHistory.getAskId()); |
| | | boolean b1 = historysService.saveOrUpdate(tjAskHistorys); |
| | | if (!b1){ |
| | | return AjaxResult.error(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | List<TjAskWorkLog> askWorkLogs = tjAskMedicalHistory.getWorkLogs(); |
| | | if (askWorkLogs!=null&&askWorkLogs.size()>0){ |
| | | for (TjAskWorkLog askWorkLog : askWorkLogs) { |
| | | askWorkLog.setAskId(tjAskMedicalHistory.getAskId()); |
| | | boolean b1 = tjAskWorkLogService.saveOrUpdate(askWorkLog); |
| | | List<TjHarmTypeLog> harmTypeLogs = askWorkLog.getHarmTypeLogs(); |
| | | for (TjHarmTypeLog harmTypeLog : harmTypeLogs) { |
| | | tjHarmTypeLogService.saveOrUpdate(harmTypeLog); |
| | | } |
| | | if (!b1){ |
| | | return AjaxResult.error(); |
| | | } |
| | |
| | | /** |
| | | * 删除问诊 |
| | | */ |
| | | // @PreAuthorize("@ss.hasPermi('hosp:history:remove')") |
| | | @Log(title = "问诊", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{askIds}") |
| | | public AjaxResult remove(@PathVariable Long[] askIds) { |