zjh
2025-02-27 c0926979c08651d5920fe4f0fb04097d044129ad
ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjOrderController.java
@@ -1212,16 +1212,16 @@
            /*调用his接口*/
            String config = configService.selectConfigByKey("sfkqdyhis");
            if (null != config && config.equals("Y")) {
//                AjaxResult result = hisApiMethod.HisApiMethods(tjCustomer, tjOrder);
//                if (!result.get("code").toString().equals("200")) {
//                    TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
//                    Object jzh = result.get("jzh");
//                    if (null != jzh && null != jzh.toString()) {
//                        hisApiMethod.ZfHisApiMethod(jzh.toString());
//                    }
//                    log.info("该登记人挂号失败, 就诊号为: " + tjOrder.getCardId());
//                    return AjaxResult.error("挂号失败!" + result.get("msg").toString());
//                }
                AjaxResult result = hisApiMethod.HisApiMethods(tjCustomer, tjOrder);
                if (!result.get("code").toString().equals("200")) {
                    TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
                    Object jzh = result.get("jzh");
                    if (null != jzh && null != jzh.toString()) {
                        hisApiMethod.ZfHisApiMethod(jzh.toString());
                    }
                    log.info("该登记人挂号失败, 就诊号为: " + tjOrder.getCardId());
                    return AjaxResult.error("挂号失败!" + result.get("msg").toString());
                }
                log.info("该登记人的his就诊号是: " + tjOrder.getCardId());
                //团体
@@ -4033,5 +4033,44 @@
        }
        return AjaxResult.error();
    }
    @PostMapping("/addBlTransition")
    @ApiOperation(value = "补录添加过渡表数据")
    @Transactional
    public AjaxResult addBlTransition(@RequestBody Map<String, Object> map) {
        Object packId = map.get("pacId");
        if (null == map.get("cusId")) return AjaxResult.error("请选择体检人");
        String cusId = map.get("cusId").toString();
        Object proIds1 = map.get("proIds");
        List<Long> proIds = null;
        if (null != proIds1 && !proIds1.equals("")) {
            proIds = JSON.parseArray(proIds1.toString(), Long.class);
        }
        TjCustomer tjCustomer = tjCustomerService.getTjCustomerByCusIdCard(cusId);
        String cardId = "0";
        if (null != tjCustomer) {
            cardId = tjCustomer.getCardId();
        }
        if ((null == proIds || proIds.isEmpty()) && (null == packId || packId.equals(""))) {
            transitionService.deletedTbTransitionByCusId(cusId);
        }
        //单项
        if (null != proIds && !proIds.isEmpty()) {
            //异步保存数据库表
            for (Long proId : proIds) {
                TjProject project = projectService.selectTjProjectByProId(proId);
                if (null != project) {
                    List<TbTransition> transitionList = transitionService.getTbTransitionListByCusIdAndPacIdAndProId(cusId, String.valueOf(proId));
                    if (null == transitionList || transitionList.isEmpty()) {
                        transitionService.saveRedisTransitionByProId(cusId, cardId, proId);
                    }
                }
            }
        }
        return AjaxResult.success();
    }
}