zjh
2024-07-17 e1c75c0a4f85219061a661f9330fd965d51e2a1b
ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjOrderController.java
@@ -966,7 +966,7 @@
            Long cusNumber = tjCustomer.getCusNumber();
            cusNumber += 1;
            tjCustomer.setCusNumber(cusNumber);
            BigDecimal discount = BigDecimal.valueOf(Double.parseDouble(tjOrder.getTjFlowingWater().getDiscount())).divide(BigDecimal.valueOf(10));
            BigDecimal discount = BigDecimal.valueOf(Double.parseDouble(tjOrder.getTjFlowingWater().getDiscount()));
            TjFlowingWater tjFlowingWater = new TjFlowingWater();
            tjFlowingWater.setPayStasus(0L);
            if ("1".equals(tjOrder.getTjType())) {
@@ -2548,31 +2548,31 @@
            tjCustomerService.updateById(customer);
            String configByKey = configService.selectConfigByKey("sfkqdyhis");
            if (configByKey.equals("Y")) {
                HashMap<String, Object> map = new HashMap<>();
                map.put("cardtype", "4");
//                map.put("input", order.getCardId());
                map.put("input", customer.getPationId());
                LocalDate currentDate = LocalDate.now();
                LocalDateTime startOfDay = currentDate.atStartOfDay();
                LocalDateTime nineteenOClock = currentDate.atTime(LocalTime.of(19, 0));
                DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
                String ksrq = startOfDay.format(formatter);
                String jsrq = nineteenOClock.format(formatter);
                map.put("ksrq", ksrq);
                map.put("jsrq", jsrq);
                AjaxResult result = hisApiGetMethodService.getHISDataNew("Getoutpatientcostinfo", map);
                if (Integer.parseInt(String.valueOf(result.get("code"))) == 200) {
                HashMap<String, Object> hisRequestParams = new HashMap<>();
                hisRequestParams.put("patientId", order.getCardId());
                AjaxResult queryPay = hisApiGetMethodService.getHISDataNew("QueryPay", hisRequestParams);
                if (Integer.parseInt(queryPay.get("code").toString()) == 200) {
                    List<Map<String, String>> data = (List<Map<String, String>>) queryPay.get("data");
                    BigDecimal cateFeeAll = BigDecimal.ZERO;
                    for (Map<String, String> datum : data) {
                        BigDecimal cateFee = new BigDecimal(datum.get("CateFee"));
                        cateFeeAll = cateFeeAll.add(cateFee);
                    }
                    if (cateFeeAll.compareTo(BigDecimal.ZERO) != 0) {
                    TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
                    return AjaxResult.error("撤销失败,该人员已缴费,请先退费!");
                } else {
                    }
                }
                    boolean zfHisApiMethods = hisApiMethod.ZfHisApiMethods(null, order);
                    if (zfHisApiMethods) {
                        return AjaxResult.success("撤销成功", map);
                    return AjaxResult.success("撤销成功");
                    } else {
                        TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
                        return AjaxResult.error("撤销失败,调用作废出现失败");
                    }
                }
            }
            return AjaxResult.success("撤销成功!!!");
        }