zjh
2024-06-05 66a1d779057d1c9fc75abd30218546a419b7b442
zjh 本地 2024/06/05 --1
8个文件已修改
1个文件已添加
257 ■■■■ 已修改文件
ltkj-admin/src/main/java/com/ltkj/web/controller/his/HisApiGetMethodService.java 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ltkj-admin/src/main/java/com/ltkj/web/controller/his/HisApiMethod.java 78 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ltkj-admin/src/main/java/com/ltkj/web/controller/his/HisApiMethodService.java 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ltkj-admin/src/main/java/com/ltkj/web/controller/his/HisMzJysqController.java 99 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjOrderController.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ltkj-admin/src/main/java/com/ltkj/web/wxUtils/HttpClientUtils.java 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ltkj-hosp/src/main/java/com/ltkj/hosp/domain/TjCustomer.java 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ltkj-hosp/src/main/java/com/ltkj/hosp/hisDto/OutpinregapplyDto.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ltkj-hosp/src/main/java/com/ltkj/hosp/hisDto/OutpintestapplyDto.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ltkj-admin/src/main/java/com/ltkj/web/controller/his/HisApiGetMethodService.java
@@ -30,16 +30,16 @@
     * @param code 接口代码
     * @return 执行是否成功
     */
    public AjaxResult save(String json, String code) {
    public AjaxResult save(JSONObject object, String code) {
        code = code.toLowerCase();
        JSONObject jsonObject = JSONUtil.parseObj(json);
        JSONObject response = jsonObject.getJSONObject("Response");
//        JSONObject jsonObject = JSONUtil.parseObj(json);
//        JSONObject response = jsonObject.getJSONObject("Response");
        String tabName = "ltkj_" + code;
        if (response.getStr("ResultCode").equals("0")) {
            JSONArray resultData = response.getJSONArray("ResultData");
//        if (response.getStr("ResultCode").equals("0")) {
//            JSONObject  object = response.getJSONObject("ResultData");
            Connection connection = getConnection();
            for (Object resultDatum : resultData) {
                JSONObject object = (JSONObject) resultDatum;
//            for (Object resultDatum : resultData) {
//                JSONObject object = (JSONObject) resultDatum;
                Boolean isExists = tabIsExists(connection, tabName);
                if (null == isExists)
                    return AjaxResult.error();
@@ -58,13 +58,13 @@
                    throwables.printStackTrace();
                    return AjaxResult.error();
                }
            }
//            }
            try {
                if (connection != null)
                    connection.close();
            } catch (SQLException throwables) {
            }
        }
//        }
        return AjaxResult.success();
    }
ltkj-admin/src/main/java/com/ltkj/web/controller/his/HisApiMethod.java
@@ -2,6 +2,8 @@
import cn.hutool.core.date.DateUtil;
import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@@ -48,7 +50,8 @@
    //将方法返回值解析成json格式
    public JSONObject getJSONObject(String builder) {
        return JSONUtil.parseObj(builder);
        String Response = JSONUtil.parseObj(builder).getStr("Response");
        return JSONUtil.parseObj(Response);
    }
    //获取方法返回值信息
@@ -61,61 +64,63 @@
    public void HisApiMethods(TjCustomer customer, Long orderId) {
        HisApiGetMethodService hisApiGetMethodService=new HisApiGetMethodService();
        Date date = new Date();
        Date dates = new Date();
        final String date = DateUtil.format(dates, "yyyy-MM-dd HH:mm:ss");
        AjaxResult result = controller.Outpincreateapply(customer);
        String result1 = getAjaxResult(result);
        JSONObject object = getJSONObject(result1);
        String code = object.getStr("ResultCode");
        if (code.equals("0")) {
            Map<String, Object> resultData = (Map<String, Object>) object.get("ResultData");
            JSONArray resultDatass = object.getJSONArray("ResultData");
            Map<String, Object> resultData = (Map<String, Object>) resultDatass.get(0);
            if (null != resultData && resultData.size() > 0) {
                String cardId = resultData.get("pationid").toString();
                if (null != cardId) {
                    customer.setCardId(cardId);
                String pationid = resultData.get("PationId").toString();
                if (null != pationid) {
                    customer.setPationId(pationid);
                    customerService.updateById(customer);
                    OutpinregapplyDto outpinregapplyDto = new OutpinregapplyDto();
                    outpinregapplyDto.setPationid(cardId);
                    outpinregapplyDto.setHisRegistrationId(cardId);
                    outpinregapplyDto.setPationid(pationid);
//                    outpinregapplyDto.setHisRegistrationId(pationid);
                    outpinregapplyDto.setSqysbm(SecurityUtils.getUsername());
                    outpinregapplyDto.setMzksbm("");
                    outpinregapplyDto.setCzybm(SecurityUtils.getUsername());
                    outpinregapplyDto.setSfjz("是");
                    outpinregapplyDto.setGhzlbm("");
                    outpinregapplyDto.setYwckbm("");
                    outpinregapplyDto.setMzksbm("0101");
                    outpinregapplyDto.setCzybm("00029");
                    outpinregapplyDto.setSfjz("0");
                    outpinregapplyDto.setGhzlbm("01");
                    outpinregapplyDto.setYwckbm("0001");
                    outpinregapplyDto.setSflstd("0");
                    outpinregapplyDto.setGhrq(date);
                    //门诊挂号
                    AjaxResult ajaxResult = controller.Outpinregapply(outpinregapplyDto);
                    String result2 = getAjaxResult(ajaxResult);
                    JSONObject object1 = getJSONObject(result2);
                    String code1 = object1.getStr("ResultCode");
                    if (code1.equals("0")) {
                        List<Map<String, Object>> resultDatas = (List<Map<String, Object>>) object.get("ResultData");
                        JSONArray resultDatas = object1.getJSONArray("ResultData");
                        if (null != resultDatas && resultDatas.size() > 0) {
                            String hisRegistrationId = resultDatas.get(0).get("his_registration_id").toString();
                            Map<String, Object> resultDatasss = (Map<String, Object>) resultDatas.get(0);
                            String hisRegistrationId = resultDatasss.get("his_registration_id").toString();
                            if (null != hisRegistrationId) {
                                //门诊检验申请
                                //门诊医生接诊
                                AjaxResult result3 = controller.Outpinconapply(hisRegistrationId, date, SecurityUtils.getUsername());
                                String result4 = getAjaxResult(result3);
                                JSONObject object2 = getJSONObject(result4);
                                String code2 = object2.getStr("ResultCode");
                                if (code2.equals("0")) {
                                    Map<String, Object> data = (Map<String, Object>) object.get("ResultData");
                                    Map<String, Object> data = object2.getJSONObject("ResultData");
                                    String toString = data.get("his_registration_id").toString();
                                    if (null != toString) {
                                        //检验申请
                                        OutpintestapplyDto dto = new OutpintestapplyDto();
                                        dto.setHisRegistrationId(hisRegistrationId);
                                        dto.setSfjz(customer.getCusIdcard());
                                        dto.setSqysbm(SecurityUtils.getUsername());
                                        dto.setMzksbm("");
                                        dto.setMzksbm("0101");
                                        dto.setSjrq(date);
                                        dto.setCzybm(SecurityUtils.getUsername());
                                        dto.setCzyksbm("");
                                        dto.setCzybm("00029");
                                        dto.setCzyksbm("0101");
                                        dto.setSfjz("1");
                                        List<TjOrderDetail> detailList = detailService.getTjOrderDetailListByOrderId(orderId.toString());
                                        List<OutpintestapplyDetailsDto> detailsDtos = new ArrayList<>();
                                        if (null != detailList && detailList.size() > 0) {
                                            LambdaQueryWrapper<TjProject> wq = new LambdaQueryWrapper<>();
                                            wq.in(TjProject::getProId, detailList.stream().map(TjOrderDetail::getProId).collect(Collectors.toList()));
@@ -123,7 +128,12 @@
                                            if (null != projects && projects.size() > 0) {
                                                for (TjProject project : projects) {
                                                    OutpintestapplyDetailsDto detailsDto = new OutpintestapplyDetailsDto();
                                                    detailsDto.setMxfyxmbm(project.getHisXmbm());
//                                                    if(null !=project.getHisXmbm()){
//                                                        detailsDto.setMxfyxmbm(project.getHisXmbm());
//                                                    }else {
//                                                        detailsDto.setMxfyxmbm(null);
//                                                    }
                                                    detailsDto.setMxfyxmbm("tj001");
                                                    detailsDto.setSfzhfy("1");
                                                    detailsDto.setSl(1);
                                                    detailsDtos.add(detailsDto);
@@ -136,18 +146,18 @@
                                        JSONObject object3 = getJSONObject(result5);
                                        String code3 = object3.getStr("ResultCode");
                                        if (code3.equals("0")) {
                                            Map<String, Object> datas = (Map<String, Object>) object.get("ResultData");
                                            datas.put("cardId",cardId);
                                            Map<String, Object> datas = object3.getJSONObject("ResultData");
                                            datas.put("cardId",hisRegistrationId);
                                            JSONObject object4 = JSONUtil.parseObj(datas);
                                            hisApiGetMethodService.save(object4.toString(),"Outpintestapply");
                                            hisApiGetMethodService.save(object4,"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());
                                            outpinexamapplyDto.setMzksbm("0101");
                                            outpinexamapplyDto.setCzybm("00029");
                                            outpinexamapplyDto.setCzyksbm("0101");
                                            List<TjOrderDetail> detailLists = detailService.getTjOrderDetailListByOrderId(orderId.toString());
                                            List<OutpintestapplyDetailsDto> detailsDtoss = new ArrayList<>();
                                            if (null != detailList && detailList.size() > 0) {
@@ -157,7 +167,7 @@
                                                if (null != projects && projects.size() > 0) {
                                                    for (TjProject project : projects) {
                                                        OutpintestapplyDetailsDto detailsDto = new OutpintestapplyDetailsDto();
                                                        detailsDto.setMxfyxmbm(project.getHisXmbm());
                                                        detailsDto.setMxfyxmbm("tj001");
                                                        detailsDto.setSfzhfy("1");
                                                        detailsDto.setSl(1);
                                                        detailsDtoss.add(detailsDto);
@@ -170,10 +180,10 @@
                                            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);
                                                Map<String, Object> map = object5.getJSONObject("ResultData");
                                                map.put("cardId",hisRegistrationId);
                                                JSONObject jsonObject = JSONUtil.parseObj(map);
                                                hisApiGetMethodService.save(jsonObject.toString(),"Outpinexamapply");
                                                hisApiGetMethodService.save(jsonObject,"Outpinexamapply");
                                            }
                                        }
                                    }
ltkj-admin/src/main/java/com/ltkj/web/controller/his/HisApiMethodService.java
@@ -1,6 +1,7 @@
package com.ltkj.web.controller.his;
import cn.hutool.core.date.DateUtil;
import com.ltkj.common.core.domain.AjaxResult;
import com.ltkj.hosp.domain.TjCustomer;
import com.ltkj.hosp.hisDto.*;
@@ -51,14 +52,14 @@
    //    @ApiOperation(value = "新增/修改门诊注册信息")
    public AjaxResult Outpincreateapply (TjCustomer customer) {
        Map<String, Object> map = new HashMap<> ();
        if (null != customer.getCusId ()) {
            map.put ("pationid", customer.getCusId ());
        if (null != customer.getPationId () && !customer.getPationId().equals("0")) {
            map.put ("pationid", customer.getPationId ());
        } else {
            map.put ("pationid", null);
        }
        map.put ("brxm", customer.getCusName ());
        map.put ("brxb", customer.getCusSex ());
        map.put ("csrq", customer.getCusBrithday ());
        map.put ("csrq", DateUtil.format(customer.getCusBrithday(),"yyyy-MM-dd"));
        map.put ("brnl", customer.getAge ());
        map.put ("brnldw", customer.getAgeUnit ());
        map.put ("addr", customer.getAddr ());
@@ -70,12 +71,14 @@
        map.put ("sfzh", customer.getCusIdcard ());
        map.put ("jhrxm", null);
        map.put ("jhrsfzh", null);
        map.put ("mz", customer.getCusNational ());
        map.put ("zy", customer.getCareer ());
        map.put ("mz", null);
        map.put ("zy","职员");
        map.put ("fbbm", null);
        map.put ("czy", customer.getCreateBy ());
        map.put ("jkkkh", customer.getIndexCard ());
        map.put ("mindex_id", customer.getIndexCard ());
        map.put ("czy", "00029");
        map.put ("jkkkh",null);
        map.put ("mindex_id",null);
//        map.put ("zybm","职员");
        //职业编码
        String post = HttpClientUtils.sendPost (HIS_URL+"Outpincreateapply", map);
        return AjaxResult.success ().put ("data", post);
    }
@@ -86,7 +89,7 @@
//jzrq = "接诊日期"
//jzysbm = "接诊医师"
    public AjaxResult Outpinconapply (String jzh,
                                      Date jzrq,
                                      String jzrq,
                                      String jzysbm) {
        Map<String, Object> map = new HashMap<> ();
        map.put ("his_registration_id", jzh);
ltkj-admin/src/main/java/com/ltkj/web/controller/his/HisMzJysqController.java
New file
@@ -0,0 +1,99 @@
package com.ltkj.web.controller.his;/*
 * @作者  zjh
 * @时间  2024-06-04  16:00
 门诊检验申请
 * */
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.hosp.domain.TjOrderDetail;
import com.ltkj.hosp.domain.TjProject;
import com.ltkj.hosp.hisDto.OutpintestapplyDetailsDto;
import com.ltkj.hosp.hisDto.OutpintestapplyDto;
import com.ltkj.hosp.service.ITjCustomerService;
import com.ltkj.hosp.service.ITjOrderDetailService;
import com.ltkj.hosp.service.ITjOrderService;
import com.ltkj.hosp.service.ITjProjectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@Component
public class HisMzJysqController {
    @Autowired
    private HisApiMethodService controller;
    @Resource
    private ITjOrderService orderService;
    @Autowired
    private ITjCustomerService customerService;
    @Resource
    private ITjOrderDetailService detailService;
    @Resource
    private ITjProjectService projectService;
    //将方法返回值解析成json格式
    public JSONObject getJSONObject(String builder) {
        String Response = JSONUtil.parseObj(builder).getStr("Response");
        return JSONUtil.parseObj(Response);
    }
    //获取方法返回值信息
    public String getAjaxResult(AjaxResult result) {
        return result.get("data").toString();
    }
    public void getHisMzJysq(String sfzh, String cardId, String orderId) {
        Date dates = new Date();
        final String date = DateUtil.format(dates, "yyyy-MM-dd HH:mm:ss");
        //门诊检验申请
            OutpintestapplyDto dto = new OutpintestapplyDto();
            dto.setHisRegistrationId(cardId);
            dto.setSfjz(sfzh);
            dto.setSqysbm(SecurityUtils.getUsername());
            dto.setMzksbm("0101");
            dto.setSjrq(date);
            dto.setCzybm("00029");
            dto.setCzyksbm("0101");
            dto.setSfjz("1");
            List<TjOrderDetail> detailList = detailService.getTjOrderDetailListByOrderId(orderId);
            List<OutpintestapplyDetailsDto> detailsDtos = new ArrayList<>();
            if (null != detailList && detailList.size() > 0) {
                LambdaQueryWrapper<TjProject> wq = new LambdaQueryWrapper<>();
                wq.in(TjProject::getProId, detailList.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);
                        detailsDtos.add(detailsDto);
                    }
                }
            }
            dto.setDetails(detailsDtos);
            AjaxResult ajaxResult1 = controller.Outpintestapply(dto);
            String result5 = getAjaxResult(ajaxResult1);
            JSONObject object3 = getJSONObject(result5);
            String code3 = object3.getStr("ResultCode");
            System.out.println(code3);
        }
    }
ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjOrderController.java
@@ -60,6 +60,7 @@
import com.ltkj.system.service.ISysDeptService;
import com.ltkj.system.service.ISysUserService;
import com.ltkj.web.controller.his.HisApiMethod;
import com.ltkj.web.controller.his.HisMzJysqController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
@@ -173,6 +174,9 @@
    @Autowired
    private HisApiMethod hisApiMethod;
    @Autowired
    private HisMzJysqController hisMzJysqController;
    /**
@@ -1022,6 +1026,7 @@
            tjCustomerService.updateById(tjCustomer);
            //调用his接口
            hisApiMethod.HisApiMethods(tjCustomer,tjOrder.getOrderId());
//            hisMzJysqController.getHisMzJysq(tjCustomer.getCusIdcard(),tjCustomer.getCardId(),tjOrder.getOrderId().toString());
            return AjaxResult.success(tjNumber);
        }
        return AjaxResult.error();
ltkj-admin/src/main/java/com/ltkj/web/wxUtils/HttpClientUtils.java
@@ -1,6 +1,8 @@
package com.ltkj.web.wxUtils;
import cn.hutool.json.JSONUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.NameValuePair;
@@ -35,6 +37,7 @@
 * @create 2019-02-10 下午 2:49
 */
@Component
@Slf4j
public class HttpClientUtils {
    /**
@@ -99,27 +102,19 @@
            URL url = new URL(httpUrl);
            // 2. 创建 HttpURLConnection 对象
            HttpURLConnection connection = (HttpURLConnection) url.openConnection();
            // 3. 设置请求方法为 POST
            connection.setRequestMethod("POST");
            // 4. 设置 Content-Type 头部字段
            connection.setRequestProperty("Content-Type", "application/json");
            // 5. 设置其他请求头部字段(可选)
//            connection.setRequestProperty("Authorization", "Bearer token");
//            connection.setRequestProperty("User-Agent", "Mozilla/5.0");
            // 6. 向服务器发送数据
            String requestBody = maps.toString();
            String requestBody = JSONUtil.toJsonStr(maps);
            log.info(httpUrl+"入参:   "+requestBody);
//            String requestBody1 = maps.toString();
            byte[] postData = requestBody.getBytes("UTF-8");
            connection.setDoOutput(true);
            try (OutputStream outputStream = connection.getOutputStream()) {
                outputStream.write(postData);
            }
            // 7. 获取响应码
            int responseCode = connection.getResponseCode();
            // 8. 获取响应数据
            try (BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream()))) {
@@ -128,7 +123,9 @@
                while ((line = reader.readLine()) != null) {
                    response.append(line);
                }
                System.out.println(response.toString());
                log.info("=====================================================");
                log.info(httpUrl+"出参");
                log.info(response.toString());
                connection.disconnect();
                return response.toString();
            }
ltkj-hosp/src/main/java/com/ltkj/hosp/domain/TjCustomer.java
@@ -48,6 +48,14 @@
    @ExcelImport(value = "姓名", required = true)
    private String cusName;
    @ApiModelProperty("就诊编号")
    private String cardId;
    @ApiModelProperty("患者his ID,患者唯一号")
    private String pationId;
    /**
     * 客户性别
     */
@@ -306,9 +314,6 @@
    @ApiModelProperty("座机")
    private String dwPhone;
    @ApiModelProperty("就诊编号")
    private String cardId;
    @ApiModelProperty("文化程度")
    private String wenHua;
ltkj-hosp/src/main/java/com/ltkj/hosp/hisDto/OutpinregapplyDto.java
@@ -19,5 +19,5 @@
    private String ywckbm;
    private String sflstd;
    @JsonFormat(pattern = "yyyy-mm-dd")
    private Date ghrq;
    private String ghrq;
}
ltkj-hosp/src/main/java/com/ltkj/hosp/hisDto/OutpintestapplyDto.java
@@ -15,7 +15,7 @@
    private String sqysbm;
    private String mzksbm;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date sjrq;
    private String sjrq;
    private String czybm;
    private String czyksbm;
    private String sfjz;