| | |
| | | |
| | | import java.util.List; |
| | | |
| | | import cn.hutool.core.date.DateUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.ltkj.framework.config.MatchUtils; |
| | | import com.ltkj.hosp.domain.TjCustomer; |
| | | import com.ltkj.hosp.domain.TjOrder; |
| | | import com.ltkj.hosp.service.ITjOrderDetailService; |
| | | import com.ltkj.hosp.service.ITjOrderService; |
| | | 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.PathVariable; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import com.ltkj.common.core.controller.BaseController; |
| | | import com.ltkj.common.core.domain.AjaxResult; |
| | | import com.ltkj.hosp.domain.TjDiscardInspection; |
| | | import com.ltkj.hosp.service.ITjDiscardInspectionService; |
| | | import com.ltkj.common.core.page.TableDataInfo; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * 弃检Controller |
| | |
| | | @Autowired |
| | | private ITjDiscardInspectionService tjDiscardInspectionService; |
| | | |
| | | /** |
| | | * 查询弃检列表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('hosp:inspection:list')") |
| | | @GetMapping("/list") |
| | | @Resource |
| | | private ITjOrderService tjOrderService; |
| | | @Resource |
| | | private ITjOrderDetailService tjOrderDetailService; |
| | | |
| | | /** |
| | | * 查询弃检列表 |
| | | */ |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(TjDiscardInspection tjDiscardInspection) { |
| | | startPage(); |
| | | List<TjDiscardInspection> list = tjDiscardInspectionService.selectTjDiscardInspectionList(tjDiscardInspection); |
| | | if(null !=list && list.size()>0){ |
| | | for (TjDiscardInspection discardInspection : list) { |
| | | discardInspection.setCusName(MatchUtils.hideCusName(discardInspection.getCusName())); |
| | | if (null != list && list.size() > 0) { |
| | | for (TjDiscardInspection discardInspection : list) { |
| | | discardInspection.setCusName(MatchUtils.hideCusName(discardInspection.getCusName())); |
| | | } |
| | | } |
| | | } |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | /** |
| | | * 获取弃检详细信息 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('hosp:inspection:query')") |
| | | @GetMapping(value = "/{id}") |
| | | public AjaxResult getInfo(@PathVariable("id") Long id) { |
| | | return success(tjDiscardInspectionService.selectTjDiscardInspectionById(id)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 恢复弃检 |
| | | */ |
| | | @PostMapping("/recall") |
| | | public AjaxResult recall(@RequestBody List<TjDiscardInspection> tjDiscardInspection) { |
| | | for (TjDiscardInspection discardInspection : tjDiscardInspection) { |
| | | //判断是否审核 |
| | | LambdaQueryWrapper<TjOrder> wq = new LambdaQueryWrapper<>(); |
| | | wq.eq(TjOrder::getTjNumber,discardInspection.getTjNum()); |
| | | final TjOrder one = tjOrderService.getOne(wq); |
| | | |
| | | if (one==null){ |
| | | return error("无该体检号"); |
| | | } |
| | | |
| | | if (one.getStatus()==301){ |
| | | return error("初审已通过,不可撤回"); |
| | | }else if (one.getStatus()==401){ |
| | | return error("总检已通过,不可撤回"); |
| | | }else if (one.getStatus()==402){ |
| | | return error("报告已发布,不可撤回"); |
| | | } |
| | | if (one.getHeshouStatus()==1){ |
| | | return error("报告已核收,不可撤回"); |
| | | } |
| | | if (one.getCheckStatus()==1){ |
| | | return error("总检已审核,不可撤回"); |
| | | } |
| | | //删除弃检记录 |
| | | final boolean b = tjDiscardInspectionService.removeById(discardInspection.getId()); |
| | | if(b){ |
| | | //将签离状态改回已签到 |
| | | one.setStatus(201); |
| | | tjOrderService.updateById(one); |
| | | } |
| | | } |
| | | return success("撤回成功"); |
| | | } |
| | | } |