zjh
2025-04-15 971162978842f8cf87d34f99da8c529e2e945da8
ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjPureToneTestController.java
@@ -11,11 +11,9 @@
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.ltkj.common.core.redis.RedisCache;
import com.ltkj.framework.config.MatchUtils;
import com.ltkj.hosp.domain.TjCustomer;
import com.ltkj.hosp.domain.TjXdPicture;
import com.ltkj.hosp.service.ITjCustomerService;
import com.ltkj.hosp.service.ITjProjectService;
import com.ltkj.hosp.service.TjAsyncService;
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;
import io.swagger.annotations.ApiOperation;
@@ -27,8 +25,6 @@
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.TjPureToneTest;
import com.ltkj.hosp.service.ITjPureToneTestService;
import com.ltkj.common.utils.poi.ExcelUtil;
import com.ltkj.common.core.page.TableDataInfo;
@@ -40,7 +36,7 @@
 */
@RestController
@RequestMapping("/pureToneTest/pureToneTest")
@Api(tags = "纯音听阈测试")
@Api(tags = "C==============纯音听阈测试")
public class TjPureToneTestController extends BaseController {
    @Resource
    private ITjPureToneTestService tjPureToneTestService;
@@ -48,12 +44,66 @@
    private ITjCustomerService customerService;
    @Autowired
    private ISysConfigService configService;
    @Resource
    private ITjOrderService orderService;
    @Resource
    private TjPureToneTestDetilService toneTestDetilService;
    @Autowired
    private ITjAskWorkLogService tjAskWorkLogService;
    @Resource
    private ITjOrderRemarkService remarkService;
    @PostMapping("/saveTjPureToneTestDetil")
    @ApiOperation(value = "保存纯音听阈结果测定值接口")
    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(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("请输入数据!");
    }
    @GetMapping("/getTjPureToneTestDetilList")
    @ApiOperation(value = "获取纯音听阈结果测定值接口")
    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);
    }
    /**
     * 查询纯音听阈测试列表
     */
    @PreAuthorize("@ss.hasPermi('pureToneTest:pureToneTest:list')")
    //@PreAuthorize("@ss.hasPermi('pureToneTest:pureToneTest:list')")
    @GetMapping("/list")
    @ApiOperation(value = "纯音听阈查询(默认自带)")
    public TableDataInfo list(TjPureToneTest tjPureToneTest) {
@@ -81,10 +131,22 @@
            for (Map.Entry<String, List<TjPureToneTest>> entry : stringListMap.entrySet()) {
                Map<String,Object>map=new HashMap<>();
                TjCustomer customer = customerService.getById(entry.getKey());
                if(customer==null) continue;
                customer.setCusName(MatchUtils.hideCusName(customer.getCusName()));
                customer.setCusPhone(MatchUtils.hidePhoneNum(customer.getCusPhone()));
                customer.setCusIdcard(MatchUtils.hideIdCardNum(customer.getCusIdcard()));
                customer.setTjNumber(entry.getValue().get(0).getTjNum());
                TjOrder order = orderService.getOrderByTjNum(entry.getValue().get(0).getTjNum());
                if(null !=order){
                    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"));
@@ -105,7 +167,7 @@
    /**
     * 导出纯音听阈测试列表
     */
    @PreAuthorize("@ss.hasPermi('pureToneTest:pureToneTest:export')")
    //@PreAuthorize("@ss.hasPermi('pureToneTest:pureToneTest:export')")
    @Log(title = "纯音听阈测试", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    @ApiOperation(value = "导出纯音听阈测试列表")
@@ -118,7 +180,7 @@
    /**
     * 获取纯音听阈测试详细信息
     */
    @PreAuthorize("@ss.hasPermi('pureToneTest:pureToneTest:query')")
    //@PreAuthorize("@ss.hasPermi('pureToneTest:pureToneTest:query')")
    @GetMapping(value = "/{id}")
    @ApiOperation(value = "获取纯音听阈测试详细信息")
    public AjaxResult getInfo(@PathVariable("id") String id) {
@@ -128,7 +190,7 @@
    /**
     * 新增纯音听阈测试
     */
    @PreAuthorize("@ss.hasPermi('pureToneTest:pureToneTest:add')")
    //@PreAuthorize("@ss.hasPermi('pureToneTest:pureToneTest:add')")
    @Log(title = "纯音听阈测试", businessType = BusinessType.INSERT)
    @PostMapping
    @ApiOperation(value = "新增纯音听阈测试")
@@ -139,7 +201,7 @@
    /**
     * 修改纯音听阈测试
     */
    @PreAuthorize("@ss.hasPermi('pureToneTest:pureToneTest:edit')")
    //@PreAuthorize("@ss.hasPermi('pureToneTest:pureToneTest:edit')")
    @Log(title = "纯音听阈测试", businessType = BusinessType.UPDATE)
    @PutMapping
    @ApiOperation(value = "修改纯音听阈测试")
@@ -150,7 +212,7 @@
    /**
     * 删除纯音听阈测试
     */
    @PreAuthorize("@ss.hasPermi('pureToneTest:pureToneTest:remove')")
    //@PreAuthorize("@ss.hasPermi('pureToneTest:pureToneTest:remove')")
    @Log(title = "纯音听阈测试", businessType = BusinessType.DELETE)
    @DeleteMapping("/{ids}")
    @ApiOperation(value = "删除纯音听阈测试")