zjh
2024-05-28 c9ab52e29d8f399b90017dd3bec22106445f1491
zjh 2024/05/28-1
3个文件已修改
3个文件已添加
319 ■■■■■ 已修改文件
ltkj-admin/src/main/java/com/ltkj/web/controller/his/HisApiController.java 168 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ltkj-admin/src/main/java/com/ltkj/web/wxUtils/HttpClientUtils.java 78 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ltkj-admin/src/test/java/ImageTextExtractor.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ltkj-framework/src/main/java/com/ltkj/framework/config/SecurityConfig.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ltkj-hosp/src/main/java/com/ltkj/hosp/hisDto/OutpinimpapplyDto.java 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ltkj-hosp/src/main/java/com/ltkj/hosp/hisDto/OutpinregapplyDto.java 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ltkj-admin/src/main/java/com/ltkj/web/controller/his/HisApiController.java
New file
@@ -0,0 +1,168 @@
package com.ltkj.web.controller.his;
import com.ltkj.common.core.controller.BaseController;
import com.ltkj.common.core.domain.AjaxResult;
import com.ltkj.common.core.page.TableDataInfo;
import com.ltkj.common.utils.http.HttpUtils;
import com.ltkj.hosp.domain.DictSsdm;
import com.ltkj.hosp.domain.TjCustomer;
import com.ltkj.hosp.hisDto.OutpinimpapplyDto;
import com.ltkj.hosp.hisDto.OutpinregapplyDto;
import com.ltkj.hosp.service.ITjCustomerService;
import com.ltkj.web.wxUtils.HttpClientUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Api(tags = "AAAAA-----HISAPI相关接口文档")
@RestController
@RequestMapping("/api/His")
public class HisApiController extends BaseController {
    @Autowired
    private ITjCustomerService tjCustomerService;
    private static final String HIS_URL = "https://mock.mengxuegu.com/mock/664d3dbce45d2156fa209c80/example/api/His/HisRequest";
    @PostMapping("/Outpincreateapply")
    @ApiOperation(value = "新增/修改门诊注册信息")
    public AjaxResult Outpincreateapply(@RequestBody TjCustomer customer) {
        Map<String, Object> map = new HashMap<>();
        if (null != customer.getCusId()) {
            map.put("pationid", customer.getCusId());
        } else {
            map.put("pationid", null);
        }
        map.put("brxm", customer.getCusName());
        map.put("brxb", customer.getCusSex());
        map.put("csrq", customer.getCusBrithday());
        map.put("brnl", customer.getAge());
        map.put("brnldw", customer.getAgeUnit());
        map.put("addr", customer.getAddr());
        map.put("gzdw", null);
        map.put("dwdz", null);
        map.put("lxr", customer.getCusName());
        map.put("lxrdh", customer.getCusPhone());
        map.put("lxrgx", "本人");
        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("fbbm", null);
        map.put("czy", customer.getCreateBy());
        map.put("jkkkh", customer.getIndexCard());
        map.put("mindex_id", customer.getIndexCard());
        String post = HttpClientUtils.sendPost(HIS_URL, map);
        return AjaxResult.success(post);
    }
    @PostMapping("/Outpinconapply")
    @ApiOperation(value = "门诊医生接诊")
    public AjaxResult Outpinconapply(@RequestParam @ApiParam(value = "就诊号") String jzh,
                                     @ApiParam(value = "接诊日期") @RequestParam Date jzrq,
                                     @ApiParam(value = "接诊医师") @RequestParam String jzysbm) {
        Map<String, Object> map = new HashMap<>();
        map.put("jzh",jzh);
        map.put("jzrq",jzrq);
        map.put("jzysbm",jzysbm);
        String post = HttpClientUtils.sendPost(HIS_URL, map);
        return AjaxResult.success(post);
    }
    @PostMapping("/Outpinunconapply")
    @ApiOperation(value = "门诊医生取消接诊")
    public AjaxResult Outpinunconapply(@RequestParam @ApiParam(value = "就诊号") String jzh,
                                     @ApiParam(value = "接诊日期") @RequestParam Date jzrq,
                                     @ApiParam(value = "接诊医师") @RequestParam String jzysbm) {
        Map<String, Object> map = new HashMap<>();
        map.put("jzh",jzh);
        map.put("jzrq",jzrq);
        map.put("jzysbm",jzysbm);
        String post = HttpClientUtils.sendPost(HIS_URL, map);
        return AjaxResult.success(post);
    }
    @PostMapping("/Outpinimpapply")
    @ApiOperation(value = "新增/修改门诊诊断")
    public AjaxResult Outpinimpapply(@RequestBody OutpinimpapplyDto dto ) {
        Map<String, Object> map = new HashMap<>();
        map.put("his_registration_id",dto.getHisRegistrationId());
        map.put("mzzdid",dto.getMzzdid());
        map.put("sqysbm",dto.getSqysbm());
        map.put("mzksbm",dto.getMzksbm());
        map.put("fbrq",dto.getFbrq());
        map.put("zdrq",dto.getZdrq());
        map.put("czybm",dto.getCzybm());
        map.put("czyksbm",dto.getCzyksbm());
        map.put("zs",dto.getZs());
        map.put("bs",dto.getBs());
        map.put("clyz",dto.getClyz());
        map.put("jws",dto.getJws());
        map.put("tgjc",dto.getTgjc());
        map.put("gms",dto.getGms());
        map.put("jbbm",dto.getJbbm());
        map.put("jbbm1",dto.getJbbm1());
        map.put("jbbm2",dto.getJbbm2());
        map.put("tw",dto.getTw());
        map.put("mb",dto.getMb());
        map.put("hx",dto.getHx());
        map.put("bp",dto.getBp());
        map.put("fzbz",dto.getFzbz());
        map.put("hzqx",dto.getHzqx());
        map.put("sfqc",dto.getSfqc());
        map.put("qchs",dto.getQchs());
        map.put("sfqj",dto.getSfqj());
        map.put("ckrq",dto.getCkrq());
        String post = HttpClientUtils.sendPost(HIS_URL, map);
        return AjaxResult.success(post);
    }
    @PostMapping("/Outpinmesapply")
    @ApiOperation(value = "门诊预交收费")
    public AjaxResult Outpinmesapply(@RequestParam @ApiParam(value = "门诊患者 ID") String pationid,
                                       @ApiParam(value = "操作员") @RequestParam String czybm,
                                       @ApiParam(value = "支付类型编码") @RequestParam String zflxbm,
                                       @ApiParam(value = "预交金额") @RequestParam int yjje) {
        Map<String, Object> map = new HashMap<>();
        map.put("pationid",pationid);
        map.put("czybm",czybm);
        map.put("zflxbm",zflxbm);
        map.put("yjje",yjje);
        String post = HttpClientUtils.sendPost(HIS_URL, map);
        return AjaxResult.success(post);
    }
    @PostMapping("/Outpinregapply")
    @ApiOperation(value = "新增/修改门诊挂号申请")
    public AjaxResult Outpinregapply(@RequestBody OutpinregapplyDto dao) {
        Map<String, Object> map = new HashMap<>();
        map.put("pationid",dao.getPationid());
        map.put("his_registration_id",dao.getHisRegistrationId());
        map.put("sqysbm",dao.getSqysbm());
        map.put("mzksbm",dao.getMzksbm());
        map.put("czybm",dao.getCzybm());
        map.put("sfjz",dao.getSfjz());
        map.put("ghzlbm",dao.getGhzlbm());
        map.put("ywckbm",dao.getYwckbm());
        map.put("sflstd",dao.getSflstd());
        map.put("ghrq",dao.getGhrq());
        String post = HttpClientUtils.sendPost(HIS_URL, map);
        return AjaxResult.success(post);
    }
}
ltkj-admin/src/main/java/com/ltkj/web/wxUtils/HttpClientUtils.java
@@ -21,8 +21,8 @@
import org.apache.http.message.BasicNameValuePair;
import org.apache.http.util.EntityUtils;
import org.springframework.stereotype.Component;
import java.io.*;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
@@ -31,6 +31,7 @@
/**
 * httpClient 工具类
 *
 * @create 2019-02-10 下午 2:49
 */
@Component
@@ -46,20 +47,24 @@
    /**
     * 静态内部类---作用:单例产生类的实例
     * @author Administrator
     *
     * @author Administrator
     */
    private static class LazyHolder {
        private static final HttpClientUtils INSTANCE = new HttpClientUtils();
    }
    HttpClientUtils(){}
    public static HttpClientUtils getInstance(){
    HttpClientUtils() {
    }
    public static HttpClientUtils getInstance() {
        return LazyHolder.INSTANCE;
    }
    /**
     * 发送 post请求
     *
     * @param httpUrl 地址
     */
    public String sendHttpPost(String httpUrl) {
@@ -69,8 +74,9 @@
    /**
     * 发送 post请求
     *
     * @param httpUrl 地址
     * @param params 参数(格式:key1=value1&key2=value2)
     * @param params  参数(格式:key1=value1&key2=value2)
     */
    public String sendHttpPost(String httpUrl, String params) {
        HttpPost httpPost = new HttpPost(httpUrl);// 创建httpPost
@@ -85,10 +91,59 @@
        return sendHttpPost(httpPost);
    }
    public static String sendPost(String httpUrl, Map<String, Object> maps) {
        try {
            // 1. 创建 URL 对象
            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();
            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()))) {
                String line;
                StringBuilder response = new StringBuilder();
                while ((line = reader.readLine()) != null) {
                    response.append(line);
                }
                System.out.println(response.toString());
                connection.disconnect();
                return response.toString();
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
        return null;
    }
    /**
     * 发送 post请求
     *
     * @param httpUrl 地址
     * @param maps 参数
     * @param maps    参数
     */
    public String sendHttpPost(String httpUrl, Map<String, String> maps) {
        HttpPost httpPost = new HttpPost(httpUrl);// 创建httpPost
@@ -105,8 +160,10 @@
        return sendHttpPost(httpPost);
    }
    /**
     * 发送Post请求
     *
     * @param httpPost
     * @return
     */
@@ -123,12 +180,12 @@
            long execStart = System.currentTimeMillis();
            response = httpClient.execute(httpPost);
            long execEnd = System.currentTimeMillis();
            System.out.println("=================执行post请求耗时:"+(execEnd-execStart)+"ms");
            System.out.println("=================执行post请求耗时:" + (execEnd - execStart) + "ms");
            long getStart = System.currentTimeMillis();
            entity = response.getEntity();
            responseContent = EntityUtils.toString(entity, "UTF-8");
            long getEnd = System.currentTimeMillis();
            System.out.println("=================获取响应结果耗时:"+(getEnd-getStart)+"ms");
            System.out.println("=================获取响应结果耗时:" + (getEnd - getStart) + "ms");
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
@@ -149,6 +206,7 @@
    /**
     * 发送 get请求
     *
     * @param httpUrl
     */
    public String sendHttpGet(String httpUrl) {
@@ -158,6 +216,7 @@
    /**
     * 发送 get请求Https
     *
     * @param httpUrl
     */
    public String sendHttpsGet(String httpUrl) {
@@ -167,6 +226,7 @@
    /**
     * 发送Get请求
     *
     * @param httpGet
     * @return
     */
@@ -206,6 +266,7 @@
    /**
     * 发送Get请求Https
     *
     * @param httpGet
     * @return
     */
@@ -244,6 +305,7 @@
    /**
     * 发送xml数据
     *
     * @param url
     * @param xmlData
     * @return
ltkj-admin/src/test/java/ImageTextExtractor.java
@@ -27,13 +27,13 @@
    }
    public static void main(String[] args) throws IOException {
        String imagePath = "C:\\Users\\w\\Pictures\\Saved Pictures\\a.png";
        String imagePath = "C:\\Users\\w\\Pictures\\Camera Roll\\a.png";
        String extractedText = extractTextFromImage(imagePath);
        System.out.println(extractedText);
        System.out.println("============================================================");
        String imagePath1 = "C:\\Users\\w\\Pictures\\Saved Pictures\\b.png";
        String extractedText1 = extractTextFromImage(imagePath1);
        System.out.println(extractedText1);
//        String imagePath1 = "C:\\Users\\w\\Pictures\\Saved Pictures\\b.png";
//        String extractedText1 = extractTextFromImage(imagePath1);
//        System.out.println(extractedText1);
    }
}
ltkj-framework/src/main/java/com/ltkj/framework/config/SecurityConfig.java
@@ -108,7 +108,7 @@
                // 过滤请求
                .authorizeRequests()
                // 对于登录login 注册register 验证码captchaImage 允许匿名访问
                .antMatchers("/login", "/register", "/captchaImage","/cus/**","/getCaptchaConfigKey","/report/jmreport/**","/sqlserver/getdata/**").permitAll()
                .antMatchers("/login", "/register", "/captchaImage","/cus/**","/getCaptchaConfigKey","/report/jmreport/**","/sqlserver/getdata/**","/api/His/**").permitAll()
                .antMatchers("/common/uploadImgExe","/common/listExeVal").permitAll()
                // 静态资源,可匿名访问
                .antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll()
ltkj-hosp/src/main/java/com/ltkj/hosp/hisDto/OutpinimpapplyDto.java
New file
@@ -0,0 +1,40 @@
package com.ltkj.hosp.hisDto;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.util.Date;
@Data
public class OutpinimpapplyDto {
    private String hisRegistrationId;
    private Integer mzzdid;
    private String sqysbm;
    private String mzksbm;
    @JsonFormat(pattern = "yyyy-mm-dd hh:mm:ss")
    private Date fbrq;
    @JsonFormat(pattern = "yyyy-mm-dd hh:mm:ss")
    private Date zdrq;
    private String czybm;
    private String czyksbm;
    private String zs;
    private String bs;
    private String clyz;
    private String jws;
    private String tgjc;
    private String gms;
    private String jbbm;
    private String jbbm1;
    private String jbbm2;
    private Integer tw;
    private Integer mb;
    private String hx;
    private String bp;
    private String fzbz;
    private String hzqx;
    private String sfqc;
    private String qchs;
    private String sfqj;
    @JsonFormat(pattern = "yyyy-mm-dd hh:mm:ss")
    private Date ckrq;
}
ltkj-hosp/src/main/java/com/ltkj/hosp/hisDto/OutpinregapplyDto.java
New file
@@ -0,0 +1,23 @@
package com.ltkj.hosp.hisDto;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.util.Date;
@Data
public class OutpinregapplyDto {
    private String pationid;
    private String hisRegistrationId;
    private String sqysbm;
    private String mzksbm;
    private String czybm;
    private String sfjz;
    private String ghzlbm;
    private String ywckbm;
    private String sflstd;
    @JsonFormat(pattern = "yyyy-mm-dd")
    private Date ghrq;
}