Browse Source

淮海分支

lighter 1 month ago
parent
commit
204f40aac6

+ 2 - 0
src/main/java/thyyxxk/wxservice_server/config/properties/YmlConfig.java

@@ -8,6 +8,8 @@ import org.springframework.stereotype.Component;
 @Component
 @ConfigurationProperties(prefix = "thyy.config")
 public class YmlConfig {
+    // 电子发票存放目录
     private String dzfpdir;
+    // 电子发票下载地址
     private String dzfpurl;
 }

+ 0 - 15
src/main/java/thyyxxk/wxservice_server/constant/Constants.java

@@ -32,19 +32,4 @@ public class Constants {
             return false;
         }
     }
-
-    public static class Exception {
-        public static final String CONNECT_EXCEPTION = "ConnectException";
-        public static final String ILLEGAL_ID_START = "K";
-    }
-
-    public static class CommonLength {
-        public static final int PHONE = 11;
-        public static final int ID_CARD = 18;
-    }
-
-    public static class HealthCardBatchRegister {
-        public static final int SUCCESS = 1;
-        public static final int INVALID_ID_NUMBER = 2;
-    }
 }

+ 0 - 67
src/main/java/thyyxxk/wxservice_server/controller/ElectronicHealthCardController.java

@@ -1,67 +0,0 @@
-package thyyxxk.wxservice_server.controller;
-
-import com.alibaba.fastjson.JSONObject;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.*;
-import thyyxxk.wxservice_server.entity.ResultVo;
-import thyyxxk.wxservice_server.entity.analyzeidcard.UploadIdCardParam;
-import thyyxxk.wxservice_server.entity.electronichealthcard.ElectronicHealthCard;
-import thyyxxk.wxservice_server.entity.electronichealthcard.RegisterParams;
-import thyyxxk.wxservice_server.service.ElectronicHealthCardService;
-import thyyxxk.wxservice_server.utils.TokenUtil;
-
-import java.util.List;
-
-@RestController
-@RequestMapping("/electronicHealthCard")
-public class ElectronicHealthCardController {
-    private final ElectronicHealthCardService service;
-
-    @Autowired
-    public ElectronicHealthCardController(ElectronicHealthCardService service) {
-        this.service = service;
-    }
-
-    @GetMapping("/getRegisteredCards")
-    public ResultVo<List<ElectronicHealthCard>> getRegisteredCards() {
-        return service.getRegisteredCards();
-    }
-
-    @PostMapping("/analyseIdCard")
-    public ResultVo<JSONObject> analyseIdCard(@RequestBody UploadIdCardParam param) {
-        return service.analyseIdCard(param);
-    }
-
-    @GetMapping("/linkHealthCard")
-    public ResultVo<ElectronicHealthCard> linkHealthCard(@RequestParam("healthCode") String healthCode) {
-        return service.linkHealthCard(healthCode);
-    }
-
-    @PostMapping("/register")
-    public ResultVo<ElectronicHealthCard> register(@RequestBody @Validated RegisterParams params) {
-        return service.register(params);
-    }
-
-    @GetMapping("/registerBatchHealthCard")
-    public void registerBatchHealthCard() {
-        service.registerBatchHealthCard();
-    }
-
-    @GetMapping("/bindCardRelation")
-    ResultVo<String> bindCardRelation(@RequestParam("healthCardId") String healthCardId,
-                                      @RequestParam("qrCodeText") String qrCodeText,
-                                      @RequestParam("patId") String patId) {
-        return service.bindCardRelation(healthCardId, qrCodeText, patId);
-    }
-
-    @GetMapping("/getOrderIdByOutAppId")
-    public ResultVo<String> getOrderIdByOutAppId(@RequestParam("qrCodeText") String qrCodeText) {
-        return service.getOrderIdByOutAppId(qrCodeText);
-    }
-
-    @GetMapping("/getEncryptOpenid")
-    public ResultVo<String> getEncryptOpenid() {
-        return service.getEncryptOpenid();
-    }
-}

+ 0 - 1
src/main/java/thyyxxk/wxservice_server/controller/isolations/HealthEducationController.java

@@ -27,7 +27,6 @@ public class HealthEducationController {
     public ResultVo<LinkedHashMap<String, List<HealthEducation>>> getVideoUrls() {
         List<HealthEducation> urls = dao.selectHealthEducations();
 
-
         LinkedHashMap<String, List<HealthEducation>> map = new LinkedHashMap<>();
         for (HealthEducation item : urls) {
             String typeName = item.getTypeName();

+ 0 - 45
src/main/java/thyyxxk/wxservice_server/scheduled/GetWeChatAccessTokenTask.java

@@ -12,8 +12,6 @@ import org.springframework.web.client.RestTemplate;
 import thyyxxk.wxservice_server.config.auth.PassToken;
 import thyyxxk.wxservice_server.config.exception.ExceptionEnum;
 import thyyxxk.wxservice_server.entity.ResultVo;
-import thyyxxk.wxservice_server.entity.electronichealthcard.CommonIn;
-import thyyxxk.wxservice_server.utils.ElectronicHealthCardUtil;
 import thyyxxk.wxservice_server.utils.PropertiesUtil;
 import thyyxxk.wxservice_server.utils.ResultVoUtil;
 import thyyxxk.wxservice_server.utils.StringUtil;
@@ -67,13 +65,11 @@ public class GetWeChatAccessTokenTask {
     @GetMapping("/refreshToken")
     public ResultVo<String> refreshToken() {
         getAccessToken();
-        fetchElectronicHealthCardToken();
         return ResultVoUtil.success();
     }
 
     @Scheduled(fixedRate = 6900 * 1000)
     public void getAccessToken() {
-        fetchElectronicHealthCardToken();
         if (canScheduleRun && production) {
             String url = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&" +
                     "appid=" + PropertiesUtil.getLocalProperty("appId") +
@@ -91,52 +87,11 @@ public class GetWeChatAccessTokenTask {
             String ticket = json.getString("ticket");
             log.info("获取微信公众号JSAPI票据: {}", ticket);
             PropertiesUtil.writeAccessToken("ticket", ticket);
-
-            url = "https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid=" + PropertiesUtil.getLocalProperty("qywxCorpId") +
-                    "&corpsecret=" + PropertiesUtil.getLocalProperty("qywxSecret");
-            httpRes = template.getForObject(url, String.class);
-            json = JSONObject.parseObject(httpRes);
-            token = json.getString("access_token");
-            log.info("获取企业微信ACCESS_TOKEN: {}", token);
-            PropertiesUtil.writeAccessToken("qywxToken",token);
         }  else {
             String url = "https://staticweb.hnthyy.cn/wxserver/tokenSchedule/getToken?key=access_token";
             ResultVo<String> res = template.getForObject(url, ResultVo.class);
             log.info("从服务器获取公众号ACCESS_TOKEN:{}", res.getData());
             PropertiesUtil.writeAccessToken("access_token", res.getData());
-
-            url = "https://staticweb.hnthyy.cn/wxserver/tokenSchedule/getToken?key=qywxToken";
-            res = template.getForObject(url, ResultVo.class);
-            log.info("从服务器获取企业微信ACCESS_TOKEN:{}", res.getData());
-            PropertiesUtil.writeAccessToken("qywxToken", res.getData());
-        }
-    }
-
-    private void fetchElectronicHealthCardToken() {
-        if (canScheduleRun && production) {
-            CommonIn commonIn = ElectronicHealthCardUtil.createFetchTokenCommonIn();
-            JSONObject req = new JSONObject();
-            req.put("appId", ElectronicHealthCardUtil.PROGRAMMER_APP_ID);
-
-            JSONObject params = new JSONObject();
-            params.put("commonIn", JSONObject.toJSON(commonIn));
-            params.put("req", req);
-
-            String url = "https://p-healthopen.tengmed.com/rest/auth/HealthCard/HealthOpenAuth/AuthObj/getAppToken";
-            JSONObject response = template.postForObject(url, params, JSONObject.class);
-            if (null != response) {
-                JSONObject rsp = response.getJSONObject("rsp");
-                if (null != rsp) {
-                    String appToken = rsp.getString("appToken");
-                    log.info("获取电子健康卡appToken:{}", appToken);
-                    PropertiesUtil.writeAccessToken("appToken", appToken);
-                }
-            }
-        } else {
-            String url = "https://staticweb.hnthyy.cn/wxserver/tokenSchedule/getToken?key=appToken";
-            ResultVo<String> res = template.getForObject(url, ResultVo.class);
-            log.info("从服务器获取电子健康卡appToken:{}", res.getData());
-            PropertiesUtil.writeAccessToken("appToken", res.getData());
         }
     }
 }

+ 4 - 10
src/main/java/thyyxxk/wxservice_server/service/AppointmentService.java

@@ -5,6 +5,8 @@ import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.web.client.RestTemplate;
+import thyyxxk.wxservice_server.config.exception.BizException;
+import thyyxxk.wxservice_server.config.exception.ExceptionEnum;
 import thyyxxk.wxservice_server.constant.Constants;
 import thyyxxk.wxservice_server.constant.Gender;
 import thyyxxk.wxservice_server.dao.AppointmentDao;
@@ -29,7 +31,6 @@ public class AppointmentService {
     private static final List<MzClass> nightMzClasses = new ArrayList<>();
     private final AppointmentDao dao;
     private final RedisLikeService redis;
-    private final ElectronicHealthCardService healthCardService;
     private final WxRefundService wxRefundService;
     private final ThmzService thmzService;
     private final RestTemplate template;
@@ -38,10 +39,9 @@ public class AppointmentService {
     private static final String[] ampmLabel = new String[]{"a1","a2","a3","a4","a5","a6","a7","a8","p1","p2","p3","p4","p5","p6","p7"};
 
     @Autowired
-    public AppointmentService(AppointmentDao dao, RedisLikeService redis, ElectronicHealthCardService healthCardService, WxRefundService wxRefundService, ThmzService thmzService, RestTemplate template) {
+    public AppointmentService(AppointmentDao dao, RedisLikeService redis, WxRefundService wxRefundService, ThmzService thmzService, RestTemplate template) {
         this.dao = dao;
         this.redis = redis;
-        this.healthCardService = healthCardService;
         this.wxRefundService = wxRefundService;
         this.thmzService = thmzService;
         this.template = template;
@@ -254,16 +254,10 @@ public class AppointmentService {
     }
 
     public String getDoctorQrCode(String doctorCode) {
-        final String qywxToken = PropertiesUtil.getLocalProperty("qywxToken");
-        final String userid = redis.getEmployeeCodeRs(doctorCode);
-        final String url = String.format("https://qyapi.weixin.qq.com/cgi-bin/user/get?access_token=%s&userid=%s", qywxToken, userid);
-        final String result = template.getForObject(url, String.class);
-        JSONObject json = JSONObject.parseObject(result);
-        return json.getString("qr_code");
+        throw new BizException(ExceptionEnum.NETWORK_ERROR);
     }
 
     public List<Map<String, Object>> getPaidMzGhList(String patientId, String start, String end) {
-        healthCardService.reportHisData(patientId, "01010111", null, null);
         start = start + " 00:00:00";
         end = end + " 23:59:59";
         QueryReceiptRequest request = QueryReceiptRequest

+ 0 - 395
src/main/java/thyyxxk/wxservice_server/service/ElectronicHealthCardService.java

@@ -1,395 +0,0 @@
-package thyyxxk.wxservice_server.service;
-
-import com.alibaba.fastjson.JSONArray;
-import com.alibaba.fastjson.JSONObject;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import org.springframework.web.client.RestTemplate;
-import thyyxxk.wxservice_server.config.exception.ExceptionEnum;
-import thyyxxk.wxservice_server.constant.Constants;
-import thyyxxk.wxservice_server.dao.ElectronicHealthCardDao;
-import thyyxxk.wxservice_server.entity.ResultVo;
-import thyyxxk.wxservice_server.entity.analyzeidcard.IdCardAnalyzeResult;
-import thyyxxk.wxservice_server.entity.analyzeidcard.UploadIdCardParam;
-import thyyxxk.wxservice_server.entity.electronichealthcard.BatchRegisterParams;
-import thyyxxk.wxservice_server.entity.electronichealthcard.ElectronicHealthCard;
-import thyyxxk.wxservice_server.entity.electronichealthcard.RegisterParams;
-import thyyxxk.wxservice_server.entity.patientcards.WechatPatientBind;
-import thyyxxk.wxservice_server.utils.*;
-
-import java.util.*;
-
-/**
- * 电子健康卡卡面规范及素材 <a href="https://open.tengmed.com/openAccess/docs/access#28">...</a>
- * */
-@Slf4j
-@Service
-public class ElectronicHealthCardService {
-    private final ElectronicHealthCardDao dao;
-    private final IdCardAnalyzeService idCardAnalyzeService;
-    private final RestTemplate template;
-    private final RedisLikeService redis;
-
-    @Autowired
-    public ElectronicHealthCardService(ElectronicHealthCardDao dao, IdCardAnalyzeService idCardAnalyzeService, RestTemplate template, RedisLikeService redis) {
-        this.dao = dao;
-        this.idCardAnalyzeService = idCardAnalyzeService;
-        this.template = template;
-        this.redis = redis;
-    }
-
-    public ResultVo<List<ElectronicHealthCard>> getRegisteredCards() {
-        QueryWrapper<ElectronicHealthCard> wrapper = new QueryWrapper<>();
-        String openid = TokenUtil.getInstance().getUserOpenid();
-        wrapper.eq("openid", openid);
-        List<ElectronicHealthCard> healthCards = dao.selectList(wrapper);
-        healthCards.forEach(item -> {
-            String lastName = item.getName().substring(0, 1);
-            item.setBlurName(item.getName().replaceFirst(lastName, "*"));
-            String header = item.getIdNumber().substring(0, 4);
-            String tail = "";
-            if (item.getIdNumber().length() >= 15) {
-                tail = item.getIdNumber().substring(14);
-            }
-            item.setBlurIdNumber(header + "**********" + tail);
-        });
-        return ResultVoUtil.success(healthCards);
-    }
-
-    public ResultVo<JSONObject> analyseIdCard(UploadIdCardParam param) {
-        JSONObject req = new JSONObject();
-        req.put("imageContent", param.getContent().split("base64,")[1]);
-        req.put("cardType", 0);
-        JSONObject params = new JSONObject();
-        params.put("commonIn", new JSONObject());
-        params.put("req", req);
-        ElectronicHealthCardUtil.sign(params);
-        String url = "https://p-healthopen.tengmed.com/rest/auth/HealthCard/HealthOpenPlatform/ISVOpenObj/ocrInfo";
-        JSONObject response = template.postForObject(url, params, JSONObject.class);
-        log.info("解析身份证信息结果:{}", response);
-        if (null == response) {
-            return ResultVoUtil.fail(ExceptionEnum.NETWORK_ERROR);
-        }
-        JSONObject commonOut = response.getJSONObject("commonOut");
-        if (null == commonOut) {
-            return ResultVoUtil.fail(ExceptionEnum.NETWORK_ERROR);
-        }
-        int resultCode = commonOut.getIntValue("resultCode");
-        if (resultCode != 0) {
-            return ResultVoUtil.fail(ExceptionEnum.INTERNAL_SERVER_ERROR, "识别失败,请选择清晰的身份证正面照片或手动输入信息。");
-        }
-        JSONObject rsp = response.getJSONObject("rsp");
-        return ResultVoUtil.success(rsp.getJSONObject("cardInfo"));
-    }
-
-    private String createHisCard(ElectronicHealthCard card) {
-        IdCardAnalyzeResult idCard = new IdCardAnalyzeResult();
-        idCard.setOpenid(card.getOpenid());
-        idCard.setRelation(Objects.equals(card.getRelation(), "0") ? 1 : 2);
-        idCard.setName(card.getName());
-        idCard.setSocialNo(card.getIdNumber());
-        idCard.setBirthday(card.getBirthday());
-        idCard.setAddress(card.getAddress());
-        idCard.setSex(DateUtil.calculateSex(card.getIdNumber()));
-        idCard.setPhone(card.getPhone1());
-        idCard.setCardType(2);
-        idCard.setCardNo(card.getIdNumber());
-
-        ResultVo<HashMap<String, Object>> response = idCardAnalyzeService.readInput(idCard);
-        if (response.getCode() == ExceptionEnum.SUCCESS.getCode()) {
-            return "SUCCESS";
-        }
-        return response.getMessage();
-    }
-
-    public ResultVo<ElectronicHealthCard> linkHealthCard(String healthCode, String openid) {
-        JSONObject req = new JSONObject();
-        req.put("healthCode", healthCode);
-        JSONObject params = new JSONObject();
-        params.put("commonIn", new JSONObject());
-        params.put("req", req);
-        ElectronicHealthCardUtil.sign(params);
-        String url = "https://p-healthopen.tengmed.com/rest/auth/HealthCard/HealthOpenPlatform/ISVOpenObj/getHealthCardByHealthCode";
-        JSONObject response = template.postForObject(url, params, JSONObject.class);
-        log.info("健康卡授权码获取健康卡信息:\n参数:{}\n结果:{}", params, response);
-        if (null == response) {
-            return ResultVoUtil.fail(ExceptionEnum.NETWORK_ERROR);
-        }
-        JSONObject commonOut = response.getJSONObject("commonOut");
-        if (null == commonOut) {
-            return ResultVoUtil.fail(ExceptionEnum.NETWORK_ERROR);
-        }
-        int resultCode = commonOut.getIntValue("resultCode");
-        if (resultCode != 0) {
-            return ResultVoUtil.fail(ExceptionEnum.INTERNAL_SERVER_ERROR, commonOut.getString("errMsg"));
-        }
-        JSONObject rsp = response.getJSONObject("rsp");
-        JSONObject cardObj = rsp.getJSONObject("card");
-        ElectronicHealthCard card = JSONObject.parseObject(cardObj.toJSONString(), ElectronicHealthCard.class);
-        if (null == openid) {
-            openid = TokenUtil.getInstance().getUserOpenid();
-        }
-        card.setOpenid(openid);
-        int existCount = dao.selectBindCount(card.getHealthCardId(), openid);
-        if (existCount == 0) {
-            dao.insert(card);
-        }
-        if (StringUtil.notBlank(card.getPatId())) {
-            bindPatIdAndOpenid(card);
-            return ResultVoUtil.success(card);
-        }
-        return dealHisCardBind(card);
-    }
-
-    public ResultVo<ElectronicHealthCard> linkHealthCard(String healthCode) {
-        return linkHealthCard(healthCode, null);
-    }
-
-    private void bindPatIdAndOpenid(ElectronicHealthCard card) {
-        WechatPatientBind bind = dao.selectWechatPatientBind(card.getPatId(), card.getOpenid());
-        if (null == bind) {
-            int isDefault = Objects.equals(card.getRelation(), "0") ? 1 : 0;
-            card.setIsDefault(isDefault);
-            dao.insertWechatBind(card);
-        } else {
-            dao.unfrozenWechatBind(card.getIdNumber(), card.getPhone1(), bind.getId());
-        }
-    }
-
-    public ResultVo<ElectronicHealthCard> register(RegisterParams req) {
-        if (!IdCardUtil.isValidatedIdCard(req.getIdNumber())) {
-            return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "请输入正确的身份证号码。");
-        }
-        if (StringUtil.isBlank(req.getGender())) {
-            req.setGender(IdCardUtil.getGenderByIdCard(req.getIdNumber()).getLabel());
-        }
-        if (StringUtil.isBlank(req.getBirthday())) {
-            req.setBirthday(IdCardUtil.getBirthDayByIdCard(req.getIdNumber()));
-        }
-//        if (StringUtil.isBlank(req.getNation())) {
-        req.setNation("未知");
-//        }
-        String openid = TokenUtil.getInstance().getUserOpenid();
-        req.setOpenid(openid);
-        JSONObject params = new JSONObject();
-        params.put("commonIn", new JSONObject());
-        params.put("req", JSONObject.toJSON(req));
-        ElectronicHealthCardUtil.sign(params);
-        String url = "https://p-healthopen.tengmed.com/rest/auth/HealthCard/HealthOpenPlatform/ISVOpenObj/registerHealthCard";
-        JSONObject response = template.postForObject(url, params, JSONObject.class);
-        log.info("电子健康卡注册:\n参数:{}\n结果:{}", params, response);
-        if (null == response) {
-            return ResultVoUtil.fail(ExceptionEnum.NETWORK_ERROR);
-        }
-        JSONObject commonOut = response.getJSONObject("commonOut");
-        if (null == commonOut) {
-            return ResultVoUtil.fail(ExceptionEnum.NETWORK_ERROR);
-        }
-        int resultCode = commonOut.getIntValue("resultCode");
-        if (resultCode != 0) {
-            return ResultVoUtil.fail(ExceptionEnum.INTERNAL_SERVER_ERROR, commonOut.getString("errMsg"));
-        }
-        JSONObject rsp = response.getJSONObject("rsp");
-        ElectronicHealthCard card = new ElectronicHealthCard();
-        card.setQrCodeText(rsp.getString("qrCodeText"));
-        card.setHealthCardId(rsp.getString("healthCardId"));
-        card.setPhid(rsp.getString("phid"));
-        card.setName(req.getName());
-        card.setGender(req.getGender());
-        card.setNation(req.getNation());
-        card.setBirthday(req.getBirthday());
-        card.setIdNumber(req.getIdNumber());
-        card.setRelation(req.getRelation());
-        card.setAddress(req.getAddress());
-        card.setPhone1(req.getPhone1());
-        card.setOpenid(openid);
-        int existCount = dao.selectBindCount(card.getHealthCardId(), openid);
-        if (existCount == 0) {
-            dao.insert(card);
-        }
-        return dealHisCardBind(card);
-    }
-
-    private ResultVo<ElectronicHealthCard> dealHisCardBind(ElectronicHealthCard card) {
-        String patientId = dao.selectLatestBindPatientId(card.getIdNumber());
-        if (null == patientId) {
-            String crtRes = createHisCard(card);
-            if (!crtRes.equals("SUCCESS")) {
-                return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, crtRes);
-            }
-            patientId = dao.selectLatestBindPatientId(card.getIdNumber());
-        }
-        if (null == patientId) {
-            return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "建卡错误,请联系管理员。");
-        }
-        card.setPatId(patientId);
-        bindPatIdAndOpenid(card);
-        dao.updateHealthCardBatchStatus(Constants.HealthCardBatchRegister.SUCCESS, card.getIdNumber());
-        bindCardRelation(card.getHealthCardId(), card.getQrCodeText(), patientId);
-        return ResultVoUtil.success(card);
-    }
-
-    public ResultVo<String> bindCardRelation(String healthCardId, String qrCodeText, String patId) {
-        JSONObject req = new JSONObject();
-        req.put("patId", patId);
-        req.put("qrCodeText", qrCodeText);
-        JSONObject params = new JSONObject();
-        params.put("commonIn", new JSONObject());
-        params.put("req", req);
-        ElectronicHealthCardUtil.sign(params);
-        String url = "https://p-healthopen.tengmed.com/rest/auth/HealthCard/HealthOpenPlatform/ISVOpenObj/bindCardRelation";
-        JSONObject response = template.postForObject(url, params, JSONObject.class);
-        log.info("绑定健康卡和院内ID关系:\n参数:{}\n结果:{}", params, response);
-        if (null == response) {
-            return ResultVoUtil.fail(ExceptionEnum.NETWORK_ERROR);
-        }
-        JSONObject commonOut = response.getJSONObject("commonOut");
-        if (null == commonOut) {
-            return ResultVoUtil.fail(ExceptionEnum.NETWORK_ERROR);
-        }
-        int resultCode = commonOut.getIntValue("resultCode");
-        if (resultCode != 0) {
-            return ResultVoUtil.fail(ExceptionEnum.INTERNAL_SERVER_ERROR, commonOut.getString("errMsg"));
-        }
-        dao.updatePatId(healthCardId, patId);
-        reportHisData(patId, "050100", null, null);
-        return ResultVoUtil.success("绑定健康卡和院内ID关系成功。");
-    }
-
-    public void registerBatchHealthCard() {
-        List<BatchRegisterParams> list = dao.selectBatchRegisterParams();
-        List<BatchRegisterParams> tempList = new ArrayList<>();
-        for (BatchRegisterParams item : list) {
-            if (!IdCardUtil.isValidatedIdCard(item.getIdNumber())) {
-                dao.updateHealthCardBatchStatus(Constants.HealthCardBatchRegister.INVALID_ID_NUMBER, item.getIdNumber());
-                continue;
-            }
-            item.setGender(IdCardUtil.getGenderByIdCard(item.getIdNumber()).getLabel());
-            item.setBirthday(IdCardUtil.getBirthDayByIdCard(item.getIdNumber()));
-            tempList.add(item);
-            if (tempList.size() == 15) {
-                executeRegisterBatchHealthCard(tempList);
-                tempList.clear();
-            }
-        }
-        if (!tempList.isEmpty()) {
-            executeRegisterBatchHealthCard(tempList);
-            tempList.clear();
-        }
-    }
-
-    private void executeRegisterBatchHealthCard(List<BatchRegisterParams> userList) {
-        JSONObject req = new JSONObject();
-        JSONArray healthCardItems = JSONArray.parseArray(JSONArray.toJSONString(userList));
-        req.put("healthCardItems", healthCardItems);
-        JSONObject params = new JSONObject();
-        params.put("commonIn", new JSONObject());
-        params.put("req", req);
-        ElectronicHealthCardUtil.sign(params);
-        String url = "https://p-healthopen.tengmed.com/rest/auth/HealthCard/HealthOpenPlatform/ISVOpenObj/registerBatchHealthCard";
-        JSONObject response = template.postForObject(url, params, JSONObject.class);
-        log.info("绑定健康卡和院内ID关系:\n参数:{}\n结果:{}", params, response);
-        if (null == response) {
-            return;
-        }
-        JSONObject commonOut = response.getJSONObject("commonOut");
-        if (null == commonOut) {
-            return;
-        }
-        if (commonOut.getIntValue("resultCode") != 0) {
-            return;
-        }
-        JSONObject rsp = response.getJSONObject("rsp");
-        if (null == rsp) {
-            return;
-        }
-        JSONArray rspItems = rsp.getJSONArray("rspItems");
-        if (null == rspItems) {
-            return;
-        }
-        for (int i = 0; i < rspItems.size(); i++) {
-            JSONObject item = rspItems.getJSONObject(i);
-            if (null == item) {
-                continue;
-            }
-            String qrCodeText = item.getString("qrCodeText");
-            if (StringUtil.isBlank(qrCodeText)) {
-                continue;
-            }
-            String idNumber = item.getString("idNumber");
-            dao.updateHealthCardBatchStatus(Constants.HealthCardBatchRegister.SUCCESS, idNumber);
-        }
-    }
-
-    public ResultVo<String> getOrderIdByOutAppId(String qrCodeText) {
-        JSONObject req = new JSONObject();
-        req.put("appId", ElectronicHealthCardUtil.PROGRAMMER_APP_ID);
-        req.put("qrCodeText", qrCodeText);
-        JSONObject params = new JSONObject();
-        params.put("commonIn", new JSONObject());
-        params.put("req", req);
-        ElectronicHealthCardUtil.sign(params);
-        String url = "https://p-healthopen.tengmed.com/rest/auth/HealthCard/HealthOpenPlatform/ISVOpenObj/getOrderIdByOutAppId";
-        JSONObject response = template.postForObject(url, params, JSONObject.class);
-        log.info("获取卡包订单ID:\n参数:{}\n结果:{}", params, response);
-        if (null == response) {
-            return ResultVoUtil.fail(ExceptionEnum.NETWORK_ERROR);
-        }
-        JSONObject commonOut = response.getJSONObject("commonOut");
-        if (null == commonOut) {
-            return ResultVoUtil.fail(ExceptionEnum.NETWORK_ERROR);
-        }
-        int resultCode = commonOut.getIntValue("resultCode");
-        if (resultCode != 0) {
-            return ResultVoUtil.fail(ExceptionEnum.INTERNAL_SERVER_ERROR, commonOut.getString("errMsg"));
-        }
-        JSONObject rsp = response.getJSONObject("rsp");
-        assert rsp != null;
-        return ResultVoUtil.success(rsp.getString("orderId"));
-    }
-
-    /**
-     * @param scene <a href="https://open.tengmed.com/openAccess/docs/develop#73">用卡环节</a>
-     * @param dept 该字段可直接上报中文名称。当用卡环节是010101-挂号、0101011-预约挂号、0101012-当日挂号、0201016-在线问诊时,用卡科室数据为必填
-     * @param cardCostTypes 用卡费别。当用卡环节代码为010105-收费、0101051-门诊缴费、0101053-住院缴费,则用卡费别数据为必填。
-     * */
-    public void reportHisData(String patId, String scene, String dept, String cardCostTypes) {
-        new Thread(() -> {
-            String qrCodeText = dao.selectQrCodeText(patId);
-            if (null == qrCodeText) {
-                return;
-            }
-            JSONObject req = new JSONObject();
-            req.put("qrCodeText", qrCodeText);
-            req.put("time", DateUtil.formatDatetime(new Date(), "yyyy-MM-dd HH:mm:ss"));
-            req.put("hospitalCode", ElectronicHealthCardUtil.HOSPITAL_ID);
-            req.put("scene", scene);
-            req.put("cardType", "10");
-            req.put("cardChannel", "0401");
-            if (null != dept) {
-                req.put("department", redis.getDepartmentName(dept));
-            }
-            if (null != cardCostTypes) {
-                req.put("cardCostTypes", cardCostTypes);
-            }
-            JSONObject params = new JSONObject();
-            params.put("commonIn", new JSONObject());
-            params.put("req", req);
-            ElectronicHealthCardUtil.sign(params);
-            String url = "https://p-healthopen.tengmed.com/rest/auth/HealthCard/HealthOpenPlatform/ISVOpenObj/reportHISData";
-            JSONObject response = template.postForObject(url, params, JSONObject.class);
-            log.info("用卡数据上报:\n参数:{}\n结果:{}", params, response);
-        }).start();
-    }
-
-    public ResultVo<String> getEncryptOpenid() {
-        String openid = TokenUtil.getInstance().getUserOpenid();
-        String uuid = UUID.randomUUID().toString().toUpperCase().replace("-","");
-        String uoh = uuid + "&" + openid + "&" + ElectronicHealthCardUtil.HOSPITAL_ID;
-        String encryptOpenid = ElectronicHealthCardUtil.encryptOpenid(uoh);
-        log.info("获取加密openid: \n加密前:{}\n加密后:{}", uoh, encryptOpenid);
-        return ResultVoUtil.success(encryptOpenid);
-    }
-}

+ 1 - 4
src/main/java/thyyxxk/wxservice_server/service/InspectionsService.java

@@ -37,7 +37,6 @@ import java.util.List;
 @Service
 public class InspectionsService {
     private final InspectionsDao dao;
-    private final ElectronicHealthCardService healthCardService;
     private final ThmzService thmzService;
     private final InpatientService inpatientService;
     private final ExamReportService examReportService;
@@ -45,9 +44,8 @@ public class InspectionsService {
     private final ElectroService electroService;
 
     @Autowired
-    public InspectionsService(InspectionsDao dao, ElectronicHealthCardService healthCardService, ThmzService thmzService, InpatientService inpatientService, ExamReportService examReportService, PathologyService pathologyService, ElectroService electroService) {
+    public InspectionsService(InspectionsDao dao, ThmzService thmzService, InpatientService inpatientService, ExamReportService examReportService, PathologyService pathologyService, ElectroService electroService) {
         this.dao = dao;
-        this.healthCardService = healthCardService;
         this.thmzService = thmzService;
         this.inpatientService = inpatientService;
         this.examReportService = examReportService;
@@ -61,7 +59,6 @@ public class InspectionsService {
         if (exist == 0) {
             throw new BizException(ExceptionEnum.TOKEN_ERROR);
         }
-        healthCardService.reportHisData(request.getPatientId(), "0101082", null ,null);
         List<ExamIndexRequest> requestList = new ArrayList<>();
         requestList.add(new ExamIndexRequest.Builder()
                 .patientNumType("OutPatient").patientNum(request.getPatientId())

+ 1 - 4
src/main/java/thyyxxk/wxservice_server/service/PayMzFeeService.java

@@ -26,14 +26,12 @@ import java.util.Map;
 @Slf4j
 @Service
 public class PayMzFeeService {
-    private final ElectronicHealthCardService healthCardService;
     private final ThmzService thmzService;
     private final PayMzFeeDao dao;
     private final YmlConfig config;
 
     @Autowired
-    public PayMzFeeService(ElectronicHealthCardService healthCardService, ThmzService thmzService, PayMzFeeDao dao, YmlConfig config) {
-        this.healthCardService = healthCardService;
+    public PayMzFeeService(ThmzService thmzService, PayMzFeeDao dao, YmlConfig config) {
         this.thmzService = thmzService;
         this.dao = dao;
         this.config = config;
@@ -52,7 +50,6 @@ public class PayMzFeeService {
     }
 
     public ResultVo<List<Map<String, Object>>> getMzPaidList(String patientId, String start, String end) {
-        healthCardService.reportHisData(patientId, "0101022", null, null);
         start = start + " 00:00:00";
         end = end + " 23:59:59";
         QueryReceiptRequest request = QueryReceiptRequest.builder()

+ 1 - 6
src/main/java/thyyxxk/wxservice_server/service/SavePayResultService.java

@@ -53,13 +53,12 @@ public class SavePayResultService {
     private final ThmzService thmzService;
     private final WxRefundService refundService;
     private final PushWxMessageService pushWxMessageService;
-    private final ElectronicHealthCardService healthCardService;
     private final PackageMallService packageMallService;
     private final CytjService cytjService;
 
     @Autowired
     public SavePayResultService(WxApiDao dao, InpatientDao yjjDao, CouponDao couponDao, ImportDrugDao drugDao, ThmzService thmzService, WxRefundService refundService,
-                                PushWxMessageService pushWxMessageService, ElectronicHealthCardService healthCardService, PackageMallService packageMallService, CytjService cytjService) {
+                                PushWxMessageService pushWxMessageService, PackageMallService packageMallService, CytjService cytjService) {
         this.dao = dao;
         this.yjjDao = yjjDao;
         this.couponDao = couponDao;
@@ -67,7 +66,6 @@ public class SavePayResultService {
         this.thmzService = thmzService;
         this.refundService = refundService;
         this.pushWxMessageService = pushWxMessageService;
-        this.healthCardService = healthCardService;
         this.packageMallService = packageMallService;
         this.cytjService = cytjService;
     }
@@ -111,7 +109,6 @@ public class SavePayResultService {
             HisRegister hisRegister = dao.selectRegisterDateDiff(order.getTradeNo());
             if (null != hisRegister) {
                 String scene = hisRegister.getDateDiff() > 0 ? "0101011" : "0101012";
-                healthCardService.reportHisData(order.getPatientId(), scene, hisRegister.getUnitCode(), CardCostTypes.SELF_PAY);
             }
             return payTime;
         }
@@ -162,7 +159,6 @@ public class SavePayResultService {
             updateAppletHisChargeplStatus(hisOrdNum, tradeNo, order.getCouponId(), order.getCashpayAmt());
             int fundpayCount = dao.selectFundPayCount(tradeNo);
             String cardCostTypes = fundpayCount > 0 ? CardCostTypes.MED_INS : CardCostTypes.SELF_PAY;
-            healthCardService.reportHisData(order.getPatientId(), "0101051", null, cardCostTypes);
             return payTime;
         }
         if (dao.alreadyPayed(tradeNo) > 0) {
@@ -201,7 +197,6 @@ public class SavePayResultService {
         if (StringUtil.isBlank(order.getPatientId())) {
             return payTime;
         }
-        healthCardService.reportHisData(order.getPatientId(), "0101056", null, CardCostTypes.SELF_PAY);
         log.info("缴纳住院预交金成功:{}", JSON.toJSONStringWithDateFormat(order, "yyyy-MM-dd HH:mm:ss"));
         String msgContent = "{\"touser\":\"\",\"data\":" +
                 "{\"keyword3\":{\"color\":\"#173177\",\"value\":\"" + order.getTotalFee() + "\"}," +

+ 8 - 17
src/main/resources/weChatOfficialAccounts.properties

@@ -1,22 +1,13 @@
-osName=5
+osName=
 access_token=
 ticket=
 
-appId=wxbde6b16acad84204
-appSecret=923225c842f72c6cfa2c2530031db70f
+appId=
+appSecret=
 
-#mchId=1574204121
-#mchKey=lilaiwflzIOLJI2320JLZL2Llisd02ak
-#mchApiV3Key=zxkkOIL9Z909lkjl2lzczi2KLsol2wct
-#mchSerialNo=6574E696C4DB0B93EBD0D29B5DE809F31E04FC6D
+mchId=
+mchApiV3Key=
+mchSerialNo=
 
-mchId=1703306538
-mchApiV3Key=Kpl9y2Df47IL1845fZz221f27fUI932o
-mchSerialNo=4F04EBA336855BEB5D82A33F5FC6FED0351358F6
-
-jsapiNotifyUrl=https://staticweb.hnthyy.cn/wxserver/wxPayNotify/jsapi
-nativeNotifyUrl=https://staticweb.hnthyy.cn/wxserver/wxPayNotify/native
-
-qywxCorpId=wwf0b23c8b36012b34
-qywxSecret=wpHuNePfiDyotmpXjy5hUYGF0w8Ks5OPHSQp22z8oBk
-qywxToken=
+jsapiNotifyUrl=
+nativeNotifyUrl=