From 54180822617097359aa63b48a7cbe3bf1b079caa Mon Sep 17 00:00:00 2001
From: zjh <1084500556@qq.com>
Date: 星期一, 03 六月 2024 18:10:22 +0800
Subject: [PATCH] zjh 2024/06/03-2

---
 ltkj-admin/src/main/java/com/ltkj/web/controller/his/HisApiMethod.java |   56 ++++++++++++++++++++++++++++++++++++++++++++++----------
 1 files changed, 46 insertions(+), 10 deletions(-)

diff --git a/ltkj-admin/src/main/java/com/ltkj/web/controller/his/HisApiMethod.java b/ltkj-admin/src/main/java/com/ltkj/web/controller/his/HisApiMethod.java
index bc420dc..a869192 100644
--- a/ltkj-admin/src/main/java/com/ltkj/web/controller/his/HisApiMethod.java
+++ b/ltkj-admin/src/main/java/com/ltkj/web/controller/his/HisApiMethod.java
@@ -1,17 +1,16 @@
 package com.ltkj.web.controller.his;
 
 
-import cn.hutool.core.date.DateUtil;
+
 import cn.hutool.json.JSONObject;
 import cn.hutool.json.JSONUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.ltkj.common.core.domain.AjaxResult;
 import com.ltkj.common.utils.SecurityUtils;
-import com.ltkj.framework.config.SecurityConfig;
-import com.ltkj.framework.config.UserHoder;
 import com.ltkj.hosp.domain.TjCustomer;
 import com.ltkj.hosp.domain.TjOrderDetail;
 import com.ltkj.hosp.domain.TjProject;
+import com.ltkj.hosp.hisDto.OutpinexamapplyDto;
 import com.ltkj.hosp.hisDto.OutpinregapplyDto;
 import com.ltkj.hosp.hisDto.OutpintestapplyDetailsDto;
 import com.ltkj.hosp.hisDto.OutpintestapplyDto;
@@ -21,6 +20,7 @@
 import com.ltkj.hosp.service.ITjProjectService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
+import org.springframework.transaction.annotation.Transactional;
 
 import javax.annotation.Resource;
 import java.util.ArrayList;
@@ -57,7 +57,9 @@
     }
 
     //瀵规帴his鎬绘帴鍙�
-    public AjaxResult HisApiMethods(TjCustomer customer, Long orderId) {
+    @Transactional
+    public void HisApiMethods(TjCustomer customer, Long orderId) {
+        HisApiGetMethodService hisApiGetMethodService=new HisApiGetMethodService();
 
         Date date = new Date();
         AjaxResult result = controller.Outpincreateapply(customer);
@@ -91,6 +93,8 @@
                         if (null != resultDatas && resultDatas.size() > 0) {
                             String hisRegistrationId = resultDatas.get(0).get("his_registration_id").toString();
                             if (null != hisRegistrationId) {
+
+                                //闂ㄨ瘖妫�楠岀敵璇�
                                 AjaxResult result3 = controller.Outpinconapply(hisRegistrationId, date, SecurityUtils.getUsername());
                                 String result4 = getAjaxResult(result3);
                                 JSONObject object2 = getJSONObject(result4);
@@ -133,11 +137,44 @@
                                         String code3 = object3.getStr("ResultCode");
                                         if (code3.equals("0")) {
                                             Map<String, Object> datas = (Map<String, Object>) object.get("ResultData");
-                                            //妫�楠岀敵璇峰彿锛圧esultData 鏁版嵁闆嗭級
-                                            String jysqdh = data.get("jysqdh").toString();
-                                            //璐圭敤鍚堣
-                                            String fyhj = data.get("fyhj").toString();
-
+                                            datas.put("cardId",cardId);
+                                            JSONObject object4 = JSONUtil.parseObj(datas);
+                                            hisApiGetMethodService.save(object4.toString(),"Outpintestapply");
+                                            //闂ㄨ瘖妫�鏌ョ敵璇�
+                                            OutpinexamapplyDto outpinexamapplyDto = new OutpinexamapplyDto();
+                                            outpinexamapplyDto.setHisRegistrationId(hisRegistrationId);
+                                            outpinexamapplyDto.setSfzh(customer.getCusIdcard());
+                                            outpinexamapplyDto.setSqysbm(SecurityUtils.getUsername());
+                                            outpinexamapplyDto.setMzksbm("");
+                                            outpinexamapplyDto.setCzybm(SecurityUtils.getUsername());
+                                            outpinexamapplyDto.setCzyksbm(SecurityUtils.getUsername());
+                                            List<TjOrderDetail> detailLists = detailService.getTjOrderDetailListByOrderId(orderId.toString());
+                                            List<OutpintestapplyDetailsDto> detailsDtoss = new ArrayList<>();
+                                            if (null != detailList && detailList.size() > 0) {
+                                                LambdaQueryWrapper<TjProject> wq = new LambdaQueryWrapper<>();
+                                                wq.in(TjProject::getProId, detailLists.stream().map(TjOrderDetail::getProId).collect(Collectors.toList()));
+                                                List<TjProject> projects = projectService.list(wq);
+                                                if (null != projects && projects.size() > 0) {
+                                                    for (TjProject project : projects) {
+                                                        OutpintestapplyDetailsDto detailsDto = new OutpintestapplyDetailsDto();
+                                                        detailsDto.setMxfyxmbm(project.getHisXmbm());
+                                                        detailsDto.setSfzhfy("1");
+                                                        detailsDto.setSl(1);
+                                                        detailsDtoss.add(detailsDto);
+                                                    }
+                                                }
+                                            }
+                                            outpinexamapplyDto.setDetails(detailsDtoss);
+                                            AjaxResult ajaxResult2 = controller.Outpinexamapply(outpinexamapplyDto);
+                                            String result6 = getAjaxResult(ajaxResult2);
+                                            JSONObject object5 = getJSONObject(result6);
+                                            String code4 = object5.getStr("ResultCode");
+                                            if(code4.equals("0")){
+                                                Map<String, Object> map = (Map<String, Object>) object.get("ResultData");
+                                                datas.put("cardId",cardId);
+                                                JSONObject jsonObject = JSONUtil.parseObj(map);
+                                                hisApiGetMethodService.save(jsonObject.toString(),"Outpinexamapply");
+                                            }
                                         }
                                     }
                                 }
@@ -149,7 +186,6 @@
             }
 
         }
-        return AjaxResult.success();
     }
 
 }

--
Gitblit v1.8.0