zjh
2025-06-03 37e2d3c73caac445d1d8e229747b439e3719c13b
ltkj-admin/src/main/java/com/ltkj/web/controller/api/DefaultController.java
@@ -3,20 +3,27 @@
import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.ltkj.common.core.domain.AjaxResult;
import com.ltkj.hosp.domain.TjOrder;
import com.ltkj.hosp.mapper.TjCustomerMapper;
import com.ltkj.hosp.service.ITjOrderDetailService;
import com.ltkj.hosp.service.ITjOrderService;
import com.ltkj.hosp.vodomain.ShenGaoTiZhongVo;
import com.ltkj.web.controller.system.TjCheckController;
import com.ltkj.web.controller.system.TjReportController;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import static com.ltkj.framework.datasource.DynamicDataSourceContextHolder.log;
/**
 * @Company: 西安路泰科技有限公司
@@ -33,6 +40,10 @@
    private TjCheckController tjCheckController;
    @Autowired
    private TjCustomerMapper tjCustomerMapper;
    @Autowired
    private ITjOrderService tjOrderService;
    @Autowired
    private ITjOrderDetailService detailService;
    /**
     * 提供给三方调用的报告查看接口
@@ -40,9 +51,16 @@
     * @param json
     */
    @PostMapping("/viewReport")
    public void viewReport(HttpServletResponse response, @RequestBody String json){
    public void viewReport(HttpServletResponse response, @RequestBody String json) throws IOException {
        JSONObject entries = JSONUtil.parseObj(json);
        String tjNum = entries.getStr("tjNum");
        LambdaQueryWrapper<TjOrder> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(TjOrder::getHeshouStatus,1);
        wrapper.eq(TjOrder::getTjNumber,tjNum);
        List<TjOrder> list = tjOrderService.list(wrapper);
        if (list.isEmpty()){
            return;
        }
        tjReportController.preview(response,true,tjNum);
    }
@@ -54,6 +72,13 @@
    @PostMapping("/reportData")
    public AjaxResult reportData(@RequestBody String json){
        String tjNum = JSONUtil.parseObj(json).getStr("tjNum");
        LambdaQueryWrapper<TjOrder> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(TjOrder::getHeshouStatus,1);
        wrapper.eq(TjOrder::getTjNumber,tjNum);
        List<TjOrder> list = tjOrderService.list(wrapper);
        if (list.isEmpty()){
            return AjaxResult.error("暂无数据!!");
        }
        JSONObject entries = JSONUtil.parseObj(tjCheckController.updateCheckType(tjNum));
        removeNullFields(entries);
        return JSONUtil.toBean(entries, AjaxResult.class);
@@ -125,4 +150,28 @@
        }
    }
    /**
     * 小程序点击体检报告查询详情,显示身高体重体重指数收缩压舒张压
     */
    @GetMapping("/getShenGaoTiZhong")
    @ApiOperation(value = "小程序-体检报告查询详情")
    public AjaxResult getShenGaoTiZhong(@RequestParam @ApiParam(value = "体检号") String tjNumber) {
//        Map<String, Object> objectMap = new HashMap<>();
        LambdaQueryWrapper<TjOrder> wq1 = new LambdaQueryWrapper<>();
        wq1.eq(TjOrder::getTjNumber, tjNumber);
        wq1.eq(TjOrder::getCheckStatus, 1);
        TjOrder one = tjOrderService.getOne(wq1);
        if (one == null) {
            return AjaxResult.success("体检暂未完成!!");
        }
        List<ShenGaoTiZhongVo> maps = detailService.getShenGaoTiZhongList(one.getTjNumber());
        log.info("ltkj {}的体检报告查询详情"+maps,tjNumber);
        return AjaxResult.success(maps);
    }
}