From 5f1d1c462bbf49bc6a22b9e17b49733bcc1e0bc6 Mon Sep 17 00:00:00 2001 From: zjh <1084500556@qq.com> Date: 星期五, 20 六月 2025 19:01:13 +0800 Subject: [PATCH] zjh20250620 --- ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjOrderController.java | 50 +++++++++++++++++++++++++++++++------------------- 1 files changed, 31 insertions(+), 19 deletions(-) diff --git a/ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjOrderController.java b/ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjOrderController.java index 8b39ed1..31ff890 100644 --- a/ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjOrderController.java +++ b/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 @@ -556,13 +557,9 @@ order.setIdType(tjCustomer.getIdType()); order.setAgeUnit(tjCustomer.getAgeUnit()); order.setTjCount(String.valueOf(tjCustomer.getCusNumber())); - if (null != tjCustomer.getCompName()) { - order.setDictCompName(tjCustomer.getCompName()); - } else { - String firmId = order.getFirmId(); - if (firmId != null && null != iDictCompService.getById(String.valueOf(order.getFirmId()))) { - order.setDictCompName(iDictCompService.getById(String.valueOf(order.getFirmId())).getCnName()); - } + String firmName = order.getFirmName(); + if (StringUtil.isNotBlank(firmName)) { + order.setDictCompName(firmName); } if (null != order.getPacId()) { if (null != tjPackageService.getById(order.getPacId())) { @@ -1175,7 +1172,7 @@ tjOrder.setFirmId("0"); } - if (null != tjOrder.getPhoto()) { + if (StringUtil.isNotBlank(tjOrder.getPhoto())) { File file = new File(tjOrder.getPhoto()); if (file.isFile()) { FileInputStream fileInputStream = new FileInputStream(file); @@ -1187,10 +1184,10 @@ tjOrder.setPhoto(encode); } } + String pacId = transitionService.getTbTransitionPacIdByCusIdAndPac(String.valueOf(tjCustomer.getCusIdcard())); - - if (null == tjOrder.getPacId() && null != transitionService.getTbTransitionPacIdByCusIdAndPac(String.valueOf(tjOrder.getUserId()))) { - tjOrder.setPacId(transitionService.getTbTransitionPacIdByCusIdAndPac(String.valueOf(tjOrder.getUserId()))); + if (StringUtil.isNotBlank(tjOrder.getPacId()) && StringUtil.isNotBlank(pacId) ) { + tjOrder.setPacId(pacId); } //鍒ゆ柇灏忕▼搴忎笂棰勭害鏄惁浠橀挶 if (null != mallOrder) tjOrder.setMallOrderId(String.valueOf(mallOrder.getId())); @@ -1200,7 +1197,6 @@ tjOrder.setFinishTime(new Date()); tjOrder.setCheckStatus(1); tjOrder.setStatus(TjConstants.TJ_WAIT); - // tjFlowingWater.setPayStasus(1L); } tjFlowingWater.setPayStasus(0L); @@ -1373,6 +1369,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 +1411,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 +1425,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 +1549,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 +3215,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("浣撴鎶ュ憡"); -- Gitblit v1.8.0