Prechádzať zdrojové kódy

Merge branch 'dev' of wujunjie/patient-co-management into dev

chenweida 7 rokov pred
rodič
commit
eea66757c6

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 1 - 1
common/common-entity/src/main/java/com/yihu/wlyy/entity/message/Message.java


+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/message/MessageDao.java

@ -86,6 +86,6 @@ public interface MessageDao extends PagingAndSortingRepository<Message, Long>, J
    int findTzMessage(String patient);
    //根据续方关联code查询团队长分配健管师消息
    @Query("from Message a where a.type = 3 and a.state=0 and a.del='1' and a.over='0' and relationCode = ?1  ")
    @Query("from Message a where a.type = 8 and a.state=0 and a.del='1' and a.over='0' and relationCode = ?1  ")
    Message findByRelationCode(String relationCode);
}

+ 15 - 15
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/task/PushMsgTask.java

@ -119,6 +119,7 @@ public class PushMsgTask {
            }
        }
    }
    @PostConstruct
    private void run() {
        new Thread(new ConsumerTask(httpUtil)).start();
@ -205,7 +206,6 @@ public class PushMsgTask {
     *             type==11时:{"first":"消息主题","name":"患教标题","doctorName":"医生名","date":"发送时间","remark":"消息备注"}
     *             type==19时:{"first":"消息主题","keyword1":"审核结果","keyword2":"审核医生","remark":"消息备注"}
     *             type==20时:{"first":"消息主题","keyword1":"服务项目","keyword2":"操作医生","keyword3":"服务时间","remark":"消息备注"}
     *
     * @return
     */
//    private boolean sendWeixinMessage(String access_token, int type, String openid, String name, JSONObject json) {
@ -286,9 +286,9 @@ public class PushMsgTask {
                m.put("keyword3", keyword3);
            } else if (type == 1 || type == 2) {
                if (type == 1) {
                    temp_id =template_sign_success;
                    temp_id = template_sign_success;
                } else {
                    temp_id =template_sign_failed;
                    temp_id = template_sign_failed;
                }
                String isRenew = "0";
                if (json.has("isRenew")) {
@ -374,7 +374,7 @@ public class PushMsgTask {
                m.put("keyword4", keyword4);
            } else if (type == 6) {
                temp.setUrl(url + "wdyy/html/detail-appointment.html?openid=" + openid + "&orgCode=" + json.get("orgCode") + "&id=" + json.getString("id") + "&toUser=" + json.getString("toUser") + "&toName=" + name + "&represented=" + json.getString("represented"));
                temp_id =template_appoint_success;
                temp_id = template_appoint_success;
                temp.setTemplate_id(temp_id);
                WechatTemplateData keyword1 = new WechatTemplateData();
                keyword1.setColor("#000000");
@ -394,7 +394,7 @@ public class PushMsgTask {
                m.put("planstarttime", keyword4);
            } else if (type == 7) {
                temp.setUrl(url + "wdyy/html/my-appointment.html?openid=" + openid + "&toUser=" + json.getString("toUser") + "&toName=" + name + "&represented=" + json.getString("represented"));
                temp_id =template_appoint_failed;
                temp_id = template_appoint_failed;
                temp.setTemplate_id(temp_id);
                WechatTemplateData keyword1 = new WechatTemplateData();
                keyword1.setColor("#000000");
@ -457,9 +457,10 @@ public class PushMsgTask {
                keyword5.setValue(json.getString("remark"));
                m.put("remark", keyword5);
            } else if (type == 10) {
                temp.setUrl(url + "qygl/html/signing-doctors.html?openid=" + openid + "&state=" + openid + "&toUser=" + json.getString("toUser") + "&toName=" + name + "&represented=" + json.getString("represented"));
                if (json.has("url")){
                if (json.has("url")) {
                    temp.setUrl(url + json.getString("url"));
                }else {
                    temp.setUrl(url + "qygl/html/signing-doctors.html?openid=" + openid + "&state=" + openid + "&toUser=" + json.getString("toUser") + "&toName=" + name + "&represented=" + json.getString("represented"));
                }
                temp.setTemplate_id(template_doctor_change);
                WechatTemplateData keyword1 = new WechatTemplateData();
@ -477,11 +478,12 @@ public class PushMsgTask {
                keyword3.setValue(json.getString("keyword3"));
                m.put("keyword3", keyword3);
            } else if (type == 11) {
                String xinurl = url + "survey/html/survey_info.html?openid=" + openid + "&state=" + openid + "&survey_id=" + json.getString("survey_id") + "&toUser=" + json.getString("toUser") + "&toName=" + name + "&represented=" + json.getString("represented");
//                temp.setUrl(url + "survey/html/survey_info.html?openid=" + openid + "&state=" + openid + "&survey_id=" + json.getString("survey_id") + "&toUser=" + json.getString("toUser") + "&toName=" + name);
                temp.setUrl(xinurl);
                if (json.has("url")){
                if (json.has("url")) {
                    temp.setUrl(url + json.getString("url"));
                } else {
                    String xinurl = url + "survey/html/survey_info.html?openid=" + openid + "&state=" + openid + "&survey_id=" + json.getString("survey_id") + "&toUser=" + json.getString("toUser") + "&toName=" + name + "&represented=" + json.getString("represented");
//                temp.setUrl(url + "survey/html/survey_info.html?openid=" + openid + "&state=" + openid + "&survey_id=" + json.getString("survey_id") + "&toUser=" + json.getString("toUser") + "&toName=" + name);
                    temp.setUrl(xinurl);
                }
                temp.setTemplate_id(template_doctor_survey);
                WechatTemplateData keyword1 = new WechatTemplateData();
@ -494,8 +496,6 @@ public class PushMsgTask {
                keyword2.setValue(json.getString("keyword2"));
                m.put("keyword2", keyword2);
                logger.info("type=====>openId " + openid);
                System.out.println("url=======type =11 =====================>" + xinurl);
                logger.error("url=======type =11 =====================>" + xinurl);
            } else if (type == 12) {
                temp.setUrl(url + "jtgx/html/application-msg-list.html?openid=" + openid + "&member=" + json.getString("member") + "&toUser=" + json.getString("member") + "&toName=" + name);
@ -596,7 +596,7 @@ public class PushMsgTask {
                keyword2.setColor("#000000");
                keyword2.setValue(json.getString("keyword2"));
                m.put("keyword2", keyword2);
            }else if (type == 19) {
            } else if (type == 19) {
                temp.setUrl(url + json.getString("url"));
                temp.setTemplate_id(template_doctor_audit);
                WechatTemplateData keyword1 = new WechatTemplateData();
@ -607,7 +607,7 @@ public class PushMsgTask {
                keyword2.setColor("#000000");
                keyword2.setValue(json.getString("keyword2"));
                m.put("keyword2", keyword2);
            }else if (type == 20) {
            } else if (type == 20) {
                temp.setUrl(url + json.getString("url"));
                temp.setTemplate_id(template_doctor_service);
                WechatTemplateData keyword1 = new WechatTemplateData();

+ 51 - 11
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/prescription/PatientPrescriptionPayController.java

@ -1,6 +1,7 @@
package com.yihu.wlyy.web.patient.prescription;
import com.yihu.wlyy.service.app.prescription.PatientPrescriptionPayService;
import com.yihu.wlyy.service.app.prescription.PrescriptionNoticesService;
import com.yihu.wlyy.service.app.prescription.PrescriptionService;
import com.yihu.wlyy.web.WeixinBaseController;
import io.swagger.annotations.Api;
@ -30,11 +31,13 @@ public class PatientPrescriptionPayController extends WeixinBaseController {
    @Autowired
    private PrescriptionService prescriptionService;
    @Autowired
    private PrescriptionNoticesService noticesService;
    /**
     * 患者长处方支付接口 可配送方式查询
     *
     * @param orgCode 居民签约社区code
     * @param orgCode          居民签约社区code
     * @param prescriptionCode 续方code
     * @return
     * @throws Exception
@ -45,8 +48,8 @@ public class PatientPrescriptionPayController extends WeixinBaseController {
            @RequestParam(required = true) @ApiParam(value = "续方code", name = "prescriptionCode") String prescriptionCode,
            @RequestParam(required = true) @ApiParam(value = "居民签约社区code", name = "orgCode") String orgCode) throws Exception {
        try {
            com.alibaba.fastjson.JSONObject result = payService.dispatch(prescriptionCode,orgCode);
            return write(200, "获取成功!","data",result);
            com.alibaba.fastjson.JSONObject result = payService.dispatch(prescriptionCode, orgCode);
            return write(200, "获取成功!", "data", result);
        } catch (Exception e) {
            return error(-1, "获取失败!");
        }
@ -70,7 +73,7 @@ public class PatientPrescriptionPayController extends WeixinBaseController {
            @RequestParam(required = true) @ApiParam(value = "居民社区code", name = "orgCode") String orgCode,
            @RequestParam(required = true) @ApiParam(value = "续方code", name = "prescriptionCode") String prescriptionCode,
            @RequestParam(required = true) @ApiParam(value = "配送方式", name = "type") int type,
            @RequestParam(required = true) @ApiParam(value = "配送地址json", name = "addressJson",defaultValue = "{\"townName\":\"海沧区\",\"code\":\"3502050100\",\"address\":" +
            @RequestParam(required = true) @ApiParam(value = "配送地址json", name = "addressJson", defaultValue = "{\"townName\":\"海沧区\",\"code\":\"3502050100\",\"address\":" +
                    "\"冰岛\",\"cityName\":\"厦门市\",\"townCode\":\"350205\",\"provinceCode\":\"350000\",\"cityCode\":\"350200\",\"name\":\"海沧区嵩屿街道社区卫生服务中心\"," +
                    "\"provinceName\":\"福建省\",\"streeCode\":\"35020501\",\"streeName\":\"皇后大道东\",\"phone\":\"13253541190\"}") String addressJson,
            @RequestParam(required = true) @ApiParam(value = "页面回调地址", name = "returnUrl") String returnUrl,
@ -78,8 +81,12 @@ public class PatientPrescriptionPayController extends WeixinBaseController {
        try {
            String accessToken = getAccessToken();
            String patient = getUID();
            Map result = payService.charge(type,addressJson,orgCode, prescriptionCode, totalAmount, patient, accessToken,returnUrl);
            return write(200, "支付成功!","data",result);
            Map result = payService.charge(type, addressJson, orgCode, prescriptionCode, totalAmount, patient, accessToken, returnUrl);
            if ("-1".equals(result.get("status").toString())) {
                return error(-1, "续方居民信息与微信支付身份信息不一致!");
            } else {
                return write(200, "支付成功!", "data", result);
            }
        } catch (Exception e) {
            return error(-1, "支付失败!");
        }
@ -97,7 +104,7 @@ public class PatientPrescriptionPayController extends WeixinBaseController {
        try {
            String accessToken = getAccessToken();
            String result = payService.chargeQuery(outChargeNo, accessToken);
            return write(200, "获取成功!","data",result);
            return write(200, "获取成功!", "data", result);
        } catch (Exception e) {
            return error(-1, "获取失败!");
        }
@ -116,7 +123,7 @@ public class PatientPrescriptionPayController extends WeixinBaseController {
        try {
            String accessToken = getAccessToken();
            Map result = payService.recipeReturnUrl(request, response, accessToken);
            return write(200, "页面回调成功!","data",result);
            return write(200, "页面回调成功!", "data", result);
        } catch (Exception e) {
            return error(-1, "页面回调失败!");
        }
@ -143,13 +150,46 @@ public class PatientPrescriptionPayController extends WeixinBaseController {
            @ApiParam(name = "cardNo", value = "社保卡号", defaultValue = "D21085562")
            @RequestParam(value = "cardNo", required = true) String cardNo,
            @ApiParam(name = "visitNo", value = "挂号号", defaultValue = "3277865")
            @RequestParam(value = "visitNo", required = true) String visitNo){
            @RequestParam(value = "visitNo", required = true) String visitNo) {
        try {
            com.alibaba.fastjson.JSONObject jsonParams = prescriptionService.getPayInfo(cardNo,visitNo);
            return write(200, "获取成功!","data",jsonParams);
            com.alibaba.fastjson.JSONObject jsonParams = prescriptionService.getPayInfo(cardNo, visitNo);
            return write(200, "获取成功!", "data", jsonParams);
        } catch (Exception e) {
            return error(-1, "获取失败!");
        }
    }
    /**
     * 测试长处方相关模板通知消息
     *
     * @param patient   要发送对象居民code
     * @param doctName  相关医生姓名(type=1审核医生、type=2 null、type=3配送健管师、type=4审核医生)
     * @param ordenTime 订单完成时间(type=1 null、type=2 null、type=3 null、type=4 订单完成时间)
     * @param type      1:续方审核通知 2:取药代办通知 3:配送中信息变更 4:已完成服务结果
     * @param status    续方通知状态 0不通过 1通过 2调整处方  其余状态均为0
     * @param url       带参数的模板跳转链接
     */
    @RequestMapping(value = "/testSendMassages", method = RequestMethod.POST)
    @ApiOperation(value = "测试长处方相关模板通知消息")
    public String testSendMassages(
            @ApiParam(name = "patient", value = "要发送对象居民code")
            @RequestParam(value = "patient", required = true) String patient,
            @ApiParam(name = "doctName", value = "相关医生姓名(type=1审核医生、type=2 null、type=3配送健管师、type=4审核医生)")
            @RequestParam(value = "doctName", required = false) String doctName,
            @ApiParam(name = "ordenTime", value = "订单完成时间(type=1 null、type=2 null、type=3 null、type=4 订单完成时间)")
            @RequestParam(value = "ordenTime", required = false) String ordenTime,
            @ApiParam(name = "type", value = "1:续方审核通知 2:取药代办通知 3:配送中信息变更 4:已完成服务结果")
            @RequestParam(value = "type", required = true) int type,
            @ApiParam(name = "status", value = "续方通知状态 0不通过 1通过 2调整处方  其余状态均为0")
            @RequestParam(value = "status", required = true) int status,
            @ApiParam(name = "url", value = "带参数的模板跳转链接")
            @RequestParam(value = "url", required = true) String url) {
        try {
            noticesService.sendMessages(patient, doctName, ordenTime, type, status, url);
            return write(200, "发送成功!");
        } catch (Exception e) {
            return error(-1, "发送失败!");
        }
    }
}