From a3341bde43642fa146f97522ec327ef397998991 Mon Sep 17 00:00:00 2001 From: zjh <1084500556@qq.com> Date: 星期五, 13 六月 2025 14:17:28 +0800 Subject: [PATCH] zjh20250613 --- ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjOrderController.java | 78 ++++++++++++++++++++------------------ 1 files changed, 41 insertions(+), 37 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 51390db..d50faef 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 @@ -844,17 +845,7 @@ } - /** - * 瀵煎嚭浣撴璁板綍鍒楄〃 - */ - @Log(title = "浣撴璁板綍", businessType = BusinessType.EXPORT) - @PostMapping("/export") - @ApiOperation(value = "瀵煎嚭浣撴璁板綍鍒楄〃") - public void export(HttpServletResponse response, TjOrder tjOrder) { - List<TjOrder> list = tjOrderService.selectExportOrderList(tjOrder); - ExcelUtil<TjOrder> util = new ExcelUtil<TjOrder>(TjOrder.class); - util.exportExcel(response, list, "浣撴璁板綍鏁版嵁"); - } + @PostMapping("/exportOrderList") @ApiOperation(value = "瀵煎嚭浣撴璁板綍鍒楄〃") @@ -869,6 +860,7 @@ @ApiParam(value = "鎶ュ憡寮�濮嬫椂闂�") @RequestParam(required = false) Date bgbeginTime, @ApiParam(value = "鎶ュ憡缁撴潫鏃堕棿") @RequestParam(required = false) Date bgendTime, @ApiParam(value = "鍗曚綅") @RequestParam(required = false) String dw, + @ApiParam(value = "褰撳墠椤垫垨鍏ㄩ儴鏁版嵁") @RequestParam(required = false) String dqyorqbsj, HttpServletResponse response) { List<Long> cusIds = null; if (null != name) { @@ -992,9 +984,15 @@ } wq.orderByDesc(TjOrder::getCreateTime); - Page<TjOrder> page2 = tjOrderService.page(page1, wq); - List<TjOrder> list = page2.getRecords(); - if (list != null) { + + List<TjOrder> list =null; + if(StringUtil.isNotBlank(dqyorqbsj) && dqyorqbsj.equals("1")){ + list = tjOrderService.list(wq); + }else { + Page<TjOrder> page2 = tjOrderService.page(page1, wq); + list = page2.getRecords(); + } + if (!list.isEmpty()) { for (TjOrder order : list) { TjCustomer tjCustomer = tjCustomerService.getById(order.getUserId()); if (null != tjCustomer) { @@ -1162,8 +1160,9 @@ if (null != tjReservation.getPacId()) tjOrder.setPacId(tjReservation.getPacId()); if (null != tjReservation.getTjCategory()) tjOrder.setTjCategory(tjReservation.getTjCategory()); if (null != tjReservation.getGroupingId()) { + TjDwGrouping dwGrouping = dwGroupingService.getById(tjReservation.getGroupingId()); tjOrder.setGroupId(tjReservation.getGroupingId()); - tjOrder.setFirmDeptId(tjReservation.getPacId()); + tjOrder.setFirmDeptId(dwGrouping.getDwDeptId()); } tjReservation.setIsExpire(1); tjReservationService.updateById(tjReservation); @@ -1177,7 +1176,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); @@ -1189,10 +1188,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())); @@ -1202,7 +1201,6 @@ tjOrder.setFinishTime(new Date()); tjOrder.setCheckStatus(1); tjOrder.setStatus(TjConstants.TJ_WAIT); - // tjFlowingWater.setPayStasus(1L); } tjFlowingWater.setPayStasus(0L); @@ -1375,6 +1373,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(); @@ -1400,8 +1415,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()); @@ -1414,7 +1429,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); @@ -1538,7 +1553,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(); @@ -3205,7 +3219,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("浣撴鎶ュ憡"); @@ -4092,16 +4106,6 @@ @GetMapping(value = "newgetTransitionList") @ApiOperation(value = "鏈�鏂版煡璇㈣繃娓¤〃鏁版嵁") public AjaxResult newgetTransitionList(@RequestParam @ApiParam(value = "瀹㈡埛id") String cusId) { -// String pacId = transitionService.getTbTransitionPacId(cusId); -// if(StringUtil.isNotBlank(pacId)){ -// //琛ュ樊浠� -// List<Map<String,Object>> cjMaps = groupingProService.huoquxiangmuchajia(pacId, cusId); -// if(null !=cjMaps && !cjMaps.isEmpty()){ -// for (Map<String, Object> cjMap : cjMaps) { -// transitionService.buxiangmuchajia(cusId,pacId,cjMap.get("xmid").toString(),new BigDecimal(cjMap.get("cj").toString())); -// } -// } -// } List<TbTransition> list = transitionService.newgetTransitionList(cusId); return AjaxResult.success(list); } -- Gitblit v1.8.0