zjh
2024-12-03 06ef175a1e9f72b3863757319b2f6ff76c5a2f05
ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjPureToneTestController.java
@@ -12,6 +12,7 @@
import com.ltkj.common.core.redis.RedisCache;
import com.ltkj.framework.config.MatchUtils;
import com.ltkj.hosp.domain.*;
import com.ltkj.hosp.dto.SaveTjPureToneTestDetil;
import com.ltkj.hosp.service.*;
import com.ltkj.system.service.ISysConfigService;
import io.swagger.annotations.Api;
@@ -47,18 +48,31 @@
    private ITjOrderService orderService;
    @Resource
    private TjPureToneTestDetilService toneTestDetilService;
    @Autowired
    private ITjAskWorkLogService tjAskWorkLogService;
    @Resource
    private ITjOrderRemarkService remarkService;
    @PostMapping("/saveTjPureToneTestDetil")
    @ApiOperation(value = "保存纯音听阈结果测定值接口")
    public AjaxResult saveTjPureToneTestDetil(@RequestBody List<TjPureToneTestDetil> pureToneTestDetils) {
        if(null !=pureToneTestDetils && pureToneTestDetils.size()>0){
            String pureTestId = pureToneTestDetils.get(0).getPureTestId();
    public AjaxResult saveTjPureToneTestDetil(@RequestBody SaveTjPureToneTestDetil detil) {
        if(null !=detil.getPureToneTestDetils() && detil.getPureToneTestDetils().size()>0){
            String pureTestId = detil.getPureToneTestDetils().get(0).getPureTestId();
            if(null==pureTestId){
                return AjaxResult.error("参数格式有误请检查核对!");
            }
            toneTestDetilService.deletedTjPureToneTestDetilByPureTestId(pureTestId);
            toneTestDetilService.saveBatch(pureToneTestDetils);
            toneTestDetilService.saveBatch(detil.getPureToneTestDetils());
            String selectConfigByKey = configService.selectConfigByKey("cyty_pro_id");
            if(null !=selectConfigByKey){
                TjOrderRemark orderRemark = remarkService.getTjOrderRemarkByTjNumAndProParentId(detil.getTjNum(),selectConfigByKey);
                if(null !=orderRemark){
                    orderRemark.setRemark(detil.getRemark());
                    orderRemark.setDoctorName(detil.getDoctorName());
                    remarkService.updateById(orderRemark);
                }
            }
            return AjaxResult.success();
        }
        return AjaxResult.error("请输入数据!");
@@ -66,8 +80,22 @@
    @GetMapping("/getTjPureToneTestDetilList")
    @ApiOperation(value = "获取纯音听阈结果测定值接口")
    public AjaxResult getTjPureToneTestDetilList(@RequestParam String pureTestId) {
        return AjaxResult.success(toneTestDetilService.list(new LambdaQueryWrapper<TjPureToneTestDetil>().eq(TjPureToneTestDetil::getPureTestId,pureTestId)));
    public AjaxResult getTjPureToneTestDetilList(@RequestParam String pureTestId,@RequestParam String tjNum) {
        Map<String,Object> map=new HashMap<>();
        map.put("detilList",null);
        map.put("remark",null);
        map.put("doctorName",null);
        String selectConfigByKey = configService.selectConfigByKey("cyty_pro_id");
        if(null !=selectConfigByKey){
            TjOrderRemark orderRemark = remarkService.getTjOrderRemarkByTjNumAndProParentId(tjNum,selectConfigByKey);
            if(null !=orderRemark){
                map.put("remark",orderRemark.getRemark());
                map.put("doctorName",orderRemark.getDoctorName());
            }
        }
        List<TjPureToneTestDetil> detilList = toneTestDetilService.list(new LambdaQueryWrapper<TjPureToneTestDetil>().eq(TjPureToneTestDetil::getPureTestId, pureTestId));
        map.put("detilList",detilList);
        return AjaxResult.success(map);
    }
@@ -113,6 +141,12 @@
                    customer.setTjTime(order.getCreateTime());
                    customer.setTjType(order.getTjCategory());
                }
                LambdaQueryWrapper<TjAskWorkLog> wqq = new LambdaQueryWrapper<>();
                wqq.eq(TjAskWorkLog::getTjNumber, customer.getTjNumber());
                List<TjAskWorkLog> workLogs = tjAskWorkLogService.list(wqq);
                if(null !=workLogs && workLogs.size()>0){
                    customer.setWorkLogs(workLogs);
                }
                map.put("list",entry.getValue());
                map.put("customer",customer);
                map.put("picturePath",configService.selectConfigByKey("TjPureToneTest"));