zhaowenxuan
2025-06-05 b7adb9e5316030aabfb90a8ff1b43c848aa550ec
ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjOrderController.java
@@ -15,6 +15,7 @@
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.codec.Base64;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
@@ -125,8 +126,8 @@
    private ITbTransitionService transitionService;
    @Resource
    private ISysConfigService configService;
    @Value("${path.filePath}")
    private String value;
//    @Value("${path.filePath}")
//    private String value;
    @Resource
    private ITjOrderRemarkService remarkService;
    @Resource
@@ -1373,6 +1374,23 @@
            /*调用his接口*/
            String config = configService.selectConfigByKey("sfkqdyhis");
            if (null != config && config.equals("Y")) {
                if(tjCustomer.getPationId().equals("0")){
                    AjaxResult result = controller.Outpincreateapply(tjCustomer);
                    String result1 = getAjaxResult(result);
                    JSONObject object = getJSONObject(result1);
                    String code = object.getStr("ResultCode");
                    if (code.equals("0")) {
                        JSONArray resultDatass = object.getJSONArray("ResultData");
                        Map<String, Object> resultData = (Map<String, Object>) resultDatass.get(0);
                        if (null != resultData && !resultData.isEmpty()) {
                            String pationid = resultData.get("PationId").toString();
                            if (null != pationid) {
                                tjCustomer.setPationId(pationid);
                                tjCustomerService.updateById(tjCustomer);
                            }
                        }
                    }
                }
                AjaxResult result = hisApiMethod.HisApiMethods(tjCustomer, tjOrder);
                if (!result.get("code").toString().equals("200")) {
                    TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
@@ -1398,8 +1416,8 @@
                        remarkService.updateTjOrderRemarkSfbzByJxbzisnull(tjOrder.getOrderId().toString(), tjFlowingWater.getTjSerialNumber().toString());
                        List<TjXdPicture> xdPictureList = xdPictureService.saveTjXdPicture(tjOrder.getTjNumber());
                        xdPictureService.saveBatch(xdPictureList);
                        List<TjOrderDetail> detailList = tjOrderDetailService.getCaiYangDengJi(tjOrder.getOrderId());
                        addCaiYangDengJi(detailList, !detailList.isEmpty(), tjOrder, sysUser, null);
//                        List<TjOrderDetail> detailList = tjOrderDetailService.getCaiYangDengJi(tjOrder.getOrderId());
//                        addCaiYangDengJi(detailList, !detailList.isEmpty(), tjOrder, sysUser, null);
                        log.info("调用his开启 进入不收费方法 该方法执行完毕");
                    } else {
                        log.info("调用his开启 进入收费方法 该体检人员收费:"+tjOrder.getTjNumber());
@@ -1412,7 +1430,7 @@
                        else hisApiMethod.tijianshenqingJinchuanNew(tjCustomer, DateUtil.format(date1, "yyyy-MM-dd HH:mm:ss"), tjOrder.getCardId());
                    }
                } catch (Exception e) {
                    log.error(e.getMessage());
                    log.error("发生错误 ->{}"+String.valueOf(e),e.getMessage());
                    throw new IllegalStateException();
                }
                return AjaxResult.success(tjNumber);
@@ -1536,7 +1554,6 @@
                    newSaveextracted(tjOrder, tjCustomer, discount, sysUser, tjReservation, tjFlowingWater);
                    isRequestCommonHisApi(tjOrder, tjCustomer, tjFlowingWater);
                } catch (Exception e) {
//                    TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
                    log.error("processOrderWithTransaction 方法异常"+e.getMessage());
                    throw new RuntimeException("调用公共方法失败 强制触发回滚");
//                    return AjaxResult.error();
@@ -3203,7 +3220,7 @@
            TjReport tjReport = new TjReport();
            tjReport.setTjNumber(String.valueOf(tjNumber));
            tjReport.setPath(urlValue + outputFileName1);
            String outputPath1 = value + File.separator;
//            String outputPath1 = value + File.separator;
//            String pdfBinary = getPDFBinary(outputPath1 + outputFileName1);
//            tjReport.setReport(pdfBinary);
            tjReport.setType("体检报告");