liusheng
2025-04-28 b5a1835f3ed1763b3d0b66f8ccff0bbd4d67dd5b
ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/RyTask.java
@@ -72,6 +72,9 @@
    private IPatMedInhospService iPatMedInhospService;
    @Autowired
    private IPatMedOuthospService iPatMedOuthospService;
    @Autowired
    private IPatMedOperationService iPatMedOperationService;
    @Autowired
@@ -100,6 +103,9 @@
    @Value("${req_path}")
    private String req_path;
    @Value("${visitHosp}")
    private Integer visitHosp;
    @Autowired
    private ServiceTaskMapper serviceTaskMapper;
@@ -133,6 +139,12 @@
    @Value("${hosp_info_url}")
    private String hospInfoUrl;
    @Value("${appid}")
    private String appid;
    @Value("${server.port}")
    private String port;
    public void ryMultipleParams(String s, Boolean b, Long l, Double d, Integer i) {
        System.out.println(StringUtils.format("执行多参方法: 字符串类型{},布尔类型{},长整型{},浮点型{},整形{}", s, b, l, d, i));
@@ -239,7 +251,14 @@
     * 处理患者信息,进入子任务表
     */
    public void dealOutHospInfo() {
        iPatMedInhospService.dealOutHospInfo();
        if (port.equals("8095")) {
            //出院表
            iPatMedInhospService.dealOutHospInfo();
            //门诊表
            if (visitHosp != 1) {
                iPatMedOuthospService.dealOutpatientInfo();
            }
        }
    }
@@ -247,17 +266,19 @@
     * 处理手术信息,进入子任务表
     */
    public void dealOperationInfo() {
        iPatMedOperationService.dealOperationInfo();
        if (port.equals("8095")) iPatMedOperationService.dealOperationInfo();
    }
    /**
     * 处理患者信息,进入子任务表(微信小程序)
     */
    public void dealOutHospInfoXHC() {
        PatMedInhosp patMedInhosp = new PatMedInhosp();
        //获取未处理的数据
        List<ServicePatientTemp> servicePatientTemps = iServicePatientTempService.selectServicePatientTempList(new ServicePatientTemp());
        if (port.equals("8095")) {
            PatMedInhosp patMedInhosp = new PatMedInhosp();
            //获取未处理的数据
            List<ServicePatientTemp> servicePatientTemps = iServicePatientTempService.selectServicePatientTempList(new ServicePatientTemp());
        }
    }
@@ -519,7 +540,10 @@
                                String patid = rsaPublicKeyExample.encryptedData(serviceSubtask.getPatid().toString(), pub_key);
                                String url = null;
                                url = ip + ":" + req_path + "/outsideChainwt?param1=" + taskId + "&param2=" + patid + "&param3=" + URLEncoder.encode(ivrTask1.getTaskName(), StandardCharsets.UTF_8.toString()) + "&param5=false";
                                String wxCode = getWXCode(serviceSubtask.getSfzh(), url, serviceSubtask.getTaskName(), serviceSubtask.getTaskDesc(), "无");
//                                String wxCode = getWXCode(serviceSubtask.getSfzh(), url, serviceSubtask.getTaskName(), serviceSubtask.getTaskDesc(), "无");
                                String wxCode = getWXCode(serviceSubtask.getSfzh(), url, serviceSubtask.getTaskName(), serviceSubtask.getTaskDesc(), patArchive.getTelcode(), serviceSubtask.getSendname(), patArchive.getPatientno());
                                Map<String, Object> map = JSONObject.parseObject(wxCode, Map.class);
                                //任务发送记录
@@ -653,7 +677,7 @@
                    patArchive.setPlaceOfResidence(StringUtils.isNotEmpty(thiedInhospInfo.getPatiHomeAddr()) ? thiedInhospInfo.getPatiHomeAddr().replace("null", "") : "");
                    try {
                        if (StringUtils.isNotEmpty(thiedInhospInfo.getPatiBirthday()))
                            patArchive.setBirthdate(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(thiedInhospInfo.getPatiBirthday()));
                            patArchive.setBirthdate(new SimpleDateFormat("yyyy-MM-dd").parse(thiedInhospInfo.getPatiBirthday()));
                    } catch (ParseException e) {
                        e.printStackTrace();
                    }
@@ -682,6 +706,7 @@
                patMedInhosp.setNurseId(thiedInhospInfo.getNurseId());
                patMedInhosp.setNurseName(thiedInhospInfo.getNurseName());
                patMedInhosp.setSerialnum(thiedInhospInfo.getInpatientId());
                patMedInhosp.setFuflag("1");
                if (cry.equals("0")) {
                    patMedInhosp.setInhospstate("0");
                } else if (cry.equals("1")) {
@@ -774,22 +799,23 @@
        return key;
    }
    private String getWXCode(String idcard, String url, String taskName, String taskDesc, String submitprompt) {
    private String getWXCode(String idcard, String url, String taskName, String taskDesc, String phone, String setPatientname, String setPatientid) {
        XinHuaWXReq xinHuaWXReq = new XinHuaWXReq();
        xinHuaWXReq.setIdcard(idcard);
        xinHuaWXReq.setUrl(url);
        xinHuaWXReq.setKeyword1("浙中医大二院出院随访");
        xinHuaWXReq.setKeyword2(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
        xinHuaWXReq.setKeyword3(taskName);
        xinHuaWXReq.setKeyword4("疾病康复注意事项");
        xinHuaWXReq.setPatientid(setPatientid);
        xinHuaWXReq.setPatientname(setPatientname);
        xinHuaWXReq.setMobile(phone);
        xinHuaWXReq.setMedcardno(null);
        xinHuaWXReq.setTitlename(taskName);
        xinHuaWXReq.setContent(taskDesc);
        xinHuaWXReq.setAppid(appid);
        log.error("----getWXCode---xinHuaWXReq的出参为:{}", xinHuaWXReq);
        String result = HttpUtils.sendPost(thirdWXUrl, new Gson().toJson(xinHuaWXReq));
        JSONObject jsonObject = JSONObject.parseObject(result);
        log.error("jsonObject的数据为:{}", jsonObject.toString());
//        String code = (String) jsonObject.get("code");
        return jsonObject.toString();
        String code = (String) jsonObject.toString();
        return code;
    }
//    public static void main(String[] args) {
//        LocalDateTime originalDateTime = LocalDateTime.now();
//        LocalDateTime startOfDay = originalDateTime.with(LocalTime.MIN);