zjh
2024-06-19 2ece722bfafa27e3ef5dd5e060ee0624e6f263a6
ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjOrderController.java
@@ -1035,11 +1035,18 @@
            /*调用his接口*/
            String config = configService.selectConfigByKey("sfkqdyhis");
            if(null !=config && config.equals("Y")){
                hisApiMethod.HisApiMethods(tjCustomer,tjOrder.getOrderId());
                AjaxResult result = hisApiMethod.HisApiMethods(tjCustomer, tjOrder.getOrderId());
                if(!result.get("code").toString().equals("200")){
                    TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
                    return AjaxResult.error("挂号失败!"+result.get("msg").toString());
                }
            }else {
            tjCustomer.setCardId(tjOrder.getTjNumber());
            tjCustomerService.updateById(tjCustomer);
            transitionService.updateCardIdByTjNumAndIdCard(tjCustomer.getCusIdcard(),tjOrder.getTjNumber(),tjOrder.getTjNumber());
            tjOrder.setCardId(tjOrder.getTjNumber());
             tjOrderService.updateById(tjOrder);
            }
//            tjCustomer.setCardId("0");
//            tjCustomerService.updateById(tjCustomer);
            return AjaxResult.success(tjNumber);
        }
        return AjaxResult.error();
@@ -1686,7 +1693,7 @@
                    for (TjOrder order : list) {
                        TjCustomer tjCustomer = tjCustomerService.getById(order.getUserId());
                        if (null != tjCustomer) {
                            order.setTjCustomerName(MatchUtils.hideCusName(tjCustomer.getCusName()));
                            order.setTjCustomerName(tjCustomer.getCusName());
                            order.setTjCustomerSex(tjCustomer.getCusSex());
                            order.setTjCustomerAge(DateUtil.ageOfNow(tjCustomer.getCusBrithday()));
                            order.setTjCustomerPhone(MatchUtils.hidePhoneNum(tjCustomer.getCusPhone()));
@@ -1740,7 +1747,7 @@
            for (TjOrder order : list) {
                TjCustomer tjCustomer = tjCustomerService.getById(order.getUserId());
                if (null != tjCustomer) {
                    order.setTjCustomerName(MatchUtils.hideCusName(tjCustomer.getCusName()));
                    order.setTjCustomerName(tjCustomer.getCusName());
                    order.setTjCustomerSex(tjCustomer.getCusSex());
                    order.setTjCustomerAge(DateUtil.ageOfNow(tjCustomer.getCusBrithday()));
                    order.setTjCustomerPhone(MatchUtils.hidePhoneNum(tjCustomer.getCusPhone()));
@@ -2326,16 +2333,21 @@
        TjOrder order = tjOrderService.getOrderByTjNum(tjNum);
        if (null != order) {
            String payByTjNum = tjOrderService.isPayByTjNum(String.valueOf(order.getOrderId()));
            if (null != payByTjNum) {
                return AjaxResult.success("该用户已收费不可撤销签到!");
            }
//            String payByTjNum = tjOrderService.isPayByTjNum(String.valueOf(order.getOrderId()));
//            if (null != payByTjNum) {
//                return AjaxResult.error("该用户已收费不可撤销签到!");
//            }
            tjOrderService.deleteTjOrderByOrderId(order.getOrderId());
            tjOrderDetailService.deleteTjOrderDetailByOrderDetailId(String.valueOf(order.getOrderId()));
            remarkService.deletedOrderRemarkByTjNum(tjNum);
            tjFlowingWaterService.deleteTjFlowingWaterByOrderId(String.valueOf(order.getOrderId()));
            transitionService.deletedTbTransitionByTjNum(tjNum);
            transitionService.updateTbTransitionByTjNum(tjNum);
            TjCustomer customer = tjCustomerService.getById(order.getUserId());
            if(null !=customer){
                customer.setCardId("0");
                tjCustomerService.updateById(customer);
            }
            String configByKey = configService.selectConfigByKey("sfkqdyhis");
            if (configByKey.equals("Y")){
                HashMap<String, Object> map = new HashMap<>();