zhaowenxuan
2025-03-31 1ef5f262ec24d1a38a192903a4c0b707fb7f96e1
ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjXdPictureController.java
@@ -13,12 +13,15 @@
import com.ltkj.framework.config.MatchUtils;
import com.ltkj.hosp.domain.*;
import com.ltkj.hosp.service.*;
import com.ltkj.hosp.vodomain.CsProVo;
import com.ltkj.system.service.ISysConfigService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import jodd.util.StringUtil;
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;
@@ -189,4 +192,173 @@
    public AjaxResult remove(@PathVariable String[] ids) {
        return toAjax(tjXdPictureService.deleteTjXdPictureByIds(ids));
    }
    @GetMapping ("/getYxJcList")
    @ApiOperation (value = "影像检查列表(骨密度和心电图)")//0待1已
    @Transactional
    public AjaxResult getYxJcList(@ApiParam (value = "页码数(默认1)") @RequestParam (defaultValue = "1") Integer page,
                                @ApiParam (value = "显示条数(默认10)") @RequestParam (defaultValue = "10") Integer pageSize,
                                @ApiParam (value = "体检单号") @RequestParam (required = false) String tjNumber,
                                @ApiParam (value = "单位") @RequestParam (required = false) Long compId,
                                @ApiParam (value = "姓名)") @RequestParam (required = false) String name,
                                @ApiParam (value = "套餐名)") @RequestParam (required = false) String tcm,
                                @ApiParam (value = "开始时间") @RequestParam (required = false) String beginTime,
                                @ApiParam (value = "结束时间") @RequestParam (required = false) String endTime) {
//        DateTime beginTimes = null;
//        DateTime endTimes = null;
//        if (null != beginTime && null != endTime) {
//            beginTimes = DateUtil.beginOfDay(DateUtil.parse(beginTime));
//            endTimes = DateUtil.endOfDay(DateUtil.parse(endTime));
//        }
//        //初始化体检订单表
//        List<TjOrder> orderList = null;
//        List<TjCustomer> customerList = new ArrayList<>();
//        Map<String, Object> map = new HashMap<>();
//
//        if (checkStatus == 0)
//            asyncService.wCScheckSetCustomerLisByRedis(orderService.getCsTjOrderList(tjNumber, checkStatus, compId, beginTimes, endTimes));
//        if (checkStatus == 1)
//            asyncService.yCScheckSetCustomerLisByRedis(orderService.getCsTjOrderList(tjNumber, checkStatus, compId, beginTimes, endTimes));
//
//        //根据姓名查询
//        if (null != name && !"".equals(name)) {
//            List<TjCustomer> list = customerService.getTjCustomerList(name);
//            if (null != list && list.size() > 0) {
//                List<TjCustomer> lists = new ArrayList<>();
//                for (TjCustomer customer : list) {
//                    orderList = orderService.getCsTjOrderListByCusId(customer.getCusId());
//                    if (null != orderList && orderList.size() > 0) {
//                        for (TjOrder tjOrder : orderList) {
//                            customer.setTjNumber(tjOrder.getTjNumber());
//                            customer.setTjStatus(Long.valueOf(tjOrder.getCheckStatus()));
//                            customer.setOrderId(tjOrder.getOrderId());
//                            customer.setTjTime(tjOrder.getCreateTime());
//                            customer.setFinishTime(tjOrder.getFinishTime());
//                            customer.setCusName(MatchUtils.hideCusName(customer.getCusName()));
//                            customer.setCusPhone(MatchUtils.hidePhoneNum(customer.getCusPhone()));
//                            customer.setCusIdcard(MatchUtils.hideIdCardNum(customer.getCusIdcard()));
//                            customer.setConfirmStatus(String.valueOf(tjOrder.getStatus()));
//                            if (tjOrder.getFirmId().equals("0")) {
//                                customer.setTjCompName(null);
//                            } else {
//                                customer.setTjCompName(compService.selectDictCompByDrugManufacturerId(tjOrder.getFirmId()).getCnName());
//                            }
//                            lists.add(customer);
//                        }
//                    }
//                }
//                List<TjCustomer> customers = null;
//                if (lists.size() > 0) {
//                    customers = lists.stream().skip((long) (page - 1) * pageSize).limit(pageSize).collect(Collectors.toList());
//                }
//                map.put("customers", customers);
//                map.put("total", lists.size());
//                return AjaxResult.success(map);
//            }
//            return AjaxResult.success("暂无数据");
//        }
//
//        //条件查询
//        if (null != tjNumber || null != compId || (null != beginTime && null != endTime)) {
//            orderList = orderService.getCsTjOrderList(tjNumber, checkStatus, compId, beginTimes, endTimes);
//            return getResult(page, pageSize, orderList, customerList, map);
//        }
//
//        List<TjCustomer> customers = null;
//        if (checkStatus == 0) {
//            customers = redisCache.getCacheMapValue("cScheck", "ws");
//        }
//        if (checkStatus == 1) {
//            customers = redisCache.getCacheMapValue("cScheck", "ys");
//        }
//        if (customers != null && customers.size() > 0) {
//            List<TjCustomer> customerLists = customers.stream().skip((long) (page - 1) * pageSize).limit(pageSize).collect(Collectors.toList());
//            map.put("customers", customerLists);
//            map.put("total", customers.size());
//            return AjaxResult.success(map);
//        } else {
//            orderList = orderService.getCsTjOrderList(tjNumber, checkStatus, compId, beginTimes, endTimes);
//            return getResult(page, pageSize, orderList, customerList, map);
//        }
        String value = String.valueOf(compId);
        if (tjNumber == null) tjNumber = "";
        if (compId == null) value = "";
        if (name == null) name = "";
        if (beginTime == null) beginTime = "";
        if (endTime == null) endTime = "";
        if (tcm == null) tcm = "";
        return AjaxResult.success(orderService.getYxJcList(tjNumber, page, pageSize, value, beginTime, endTime, name,tcm));
    }
    @GetMapping ("/getYxJcXx")
    @ApiOperation (value = "影像检查骨密度心电图页面点击体检人员展示体检项目接口")
    public AjaxResult getYxJcXx(@ApiParam (value = "体检号") @RequestParam String tjNumber) {
        List<CsProVo> list = remarkService.getYxJcXx(tjNumber);
        return AjaxResult.success(list);
    }
    @GetMapping ("/addYxJcXx")
    @ApiOperation (value = "提交影像检查骨密度心电图结果接口")
    @Transactional
    public AjaxResult addYxJcXx(@ApiParam (value = "体检号") @RequestParam String tjNumber,
                                @ApiParam (value = "项目id") @RequestParam String proId,
                                @ApiParam (value = "检查所见") @RequestParam String jcsj,
                                @ApiParam (value = "检查结论") @RequestParam String jcjl) {
        TjOrder order = orderService.getOrderByTjNum(tjNumber);
        if(null !=order){
            TjProject project = projectService.getById(proId);
            if(null !=project){
                List<TjProject> projects = projectService.getTjProjectListBySoneId(proId);
                LambdaQueryWrapper<TjOrderDetail>wq1=new LambdaQueryWrapper<>();
                wq1.eq(TjOrderDetail::getProId,projects.get(0).getProParentId());
                wq1.eq(TjOrderDetail::getOrderId,order.getOrderId());
                TjOrderDetail detail = detailService.getOne(wq1);
                if(null !=detail){
                    detail.setProResult(jcjl+"。"+jcsj);
                    detail.setTjStatus(1L);
                    detailService.updateById(detail);
                    LambdaQueryWrapper<TjOrderRemark>wq2=new LambdaQueryWrapper<>();
                    wq2.eq(TjOrderRemark::getProId,proId);
                    wq2.eq(TjOrderRemark::getTjNumber,tjNumber);
                    TjOrderRemark orderRemark = remarkService.getOne(wq2);
                    if(null !=orderRemark){
                        orderRemark.setType(1);
                        remarkService.updateById(orderRemark);
                    }
                }
            }
            return AjaxResult.success();
        }
        return AjaxResult.error("暂无体检记录");
    }
    @GetMapping ("/getYxJcXxJg")
    @ApiOperation (value = "获取影像检查骨密度心电图结果接口")
    @Transactional
    public AjaxResult getYxJcXxJg(@ApiParam (value = "体检号") @RequestParam String tjNumber,
                                @ApiParam (value = "项目id") @RequestParam String proId) {
        TjOrder order = orderService.getOrderByTjNum(tjNumber);
        if(null !=order){
            TjProject project = projectService.getById(proId);
            if(null !=project){
                List<TjProject> projects = projectService.getTjProjectListBySoneId(proId);
                LambdaQueryWrapper<TjOrderDetail>wq1=new LambdaQueryWrapper<>();
                wq1.eq(TjOrderDetail::getProId,projects.get(0).getProParentId());
                wq1.eq(TjOrderDetail::getOrderId,order.getOrderId());
                TjOrderDetail detail = detailService.getOne(wq1);
                if(null !=detail && StringUtil.isNotBlank(detail.getProResult())){
                    Map<String,Object> map=new HashMap<>();
                    String string = detail.getProResult();
                }
            }
            return AjaxResult.success();
        }
        return AjaxResult.error("暂无体检记录");
    }
}