|
@@ -56,6 +56,14 @@ public class WeixinService {
|
|
|
put("黑龙江省电子胶片平台", "2qPHn69_1yP4I5OT2u3Y4ifk7MBiG4JLWA5JE9ppujA");
|
|
|
put("辽宁省电子胶片平台", "XvxA4I0N8ozVUqMjZUFbYPgzSNIvxMy1URt8tTlkzw0");
|
|
|
}};
|
|
|
+
|
|
|
+ private static final Map<String, String> LOCAL_EXAM_FINISH_TEMPLATE_ID = new HashMap<String , String>(){{
|
|
|
+ put("中世康恺电子胶片平台", "w-tIiyXrwWziHGnPBnqq-FMMfiZTbtGbl5mDtLQt04A");
|
|
|
+ }};
|
|
|
+
|
|
|
+ private static final Map<String, String> LOCAL_REPORT_FINISH_TEMPLATE_ID = new HashMap<String , String>(){{
|
|
|
+ put("中世康恺电子胶片平台", "5vu2mo8vwoFFdxQ2nXZJf-lymd3R80gb3JR_B3YpwKI");
|
|
|
+ }};
|
|
|
|
|
|
|
|
|
/*/
|
|
@@ -64,7 +72,7 @@ public class WeixinService {
|
|
|
public enum PUSH_TYPE {
|
|
|
|
|
|
//远程诊断患者支付推送,远程诊断完成,远程诊断取消,远程诊断退款完成
|
|
|
- REMOTE_DIAGNOSIS_PATIENT_PAY(1),REMOTE_DIAGNOSIS_FINISH(2),REMOTE_DIAGNOSIS_CANCEL(3),REMOTE_DIAGNOSIS_REFUND(4);
|
|
|
+ REMOTE_DIAGNOSIS_PATIENT_PAY(1),REMOTE_DIAGNOSIS_FINISH(2),REMOTE_DIAGNOSIS_CANCEL(3),REMOTE_DIAGNOSIS_REFUND(4),LOCAL_EXAM_FINISH(5),LOCAL_REPORT_FINISH(6);
|
|
|
|
|
|
private int pushType;
|
|
|
|
|
@@ -170,7 +178,7 @@ public class WeixinService {
|
|
|
switch (type) {
|
|
|
case REMOTE_DIAGNOSIS_PATIENT_PAY:
|
|
|
{
|
|
|
- String urlString = "http://wechat.pacsonline.cn/wx_patient/web/remoteDiagnosis?appId=" + ApiConfigKit.getAppId();
|
|
|
+ String urlString = "https://wechat.pacsonline.cn/wx_patient/web/remoteDiagnosis?appId=" + ApiConfigKit.getAppId();
|
|
|
JSONObject contentJson = JSON.parseObject(content);
|
|
|
String out_trade_no = contentJson.getString("out_trade_no");
|
|
|
String name = contentJson.getString("name");
|
|
@@ -192,7 +200,7 @@ public class WeixinService {
|
|
|
|
|
|
case REMOTE_DIAGNOSIS_FINISH:
|
|
|
{
|
|
|
- String urlString = "http://wechat.pacsonline.cn/wx_patient/web/remoteDiagnosis?appId=" + ApiConfigKit.getAppId();
|
|
|
+ String urlString = "https://wechat.pacsonline.cn/wx_patient/web/remoteDiagnosis?appId=" + ApiConfigKit.getAppId();
|
|
|
JSONObject contentJson = JSON.parseObject(content);
|
|
|
String out_trade_no = contentJson.getString("out_trade_no");
|
|
|
String name = contentJson.getString("name");
|
|
@@ -211,7 +219,7 @@ public class WeixinService {
|
|
|
|
|
|
case REMOTE_DIAGNOSIS_CANCEL:
|
|
|
{
|
|
|
- String urlString = "http://wechat.pacsonline.cn/wx_patient/web/remoteDiagnosis?appId=" + ApiConfigKit.getAppId();
|
|
|
+ String urlString = "https://wechat.pacsonline.cn/wx_patient/web/remoteDiagnosis?appId=" + ApiConfigKit.getAppId();
|
|
|
JSONObject contentJson = JSON.parseObject(content);
|
|
|
String out_trade_no = contentJson.getString("out_trade_no");
|
|
|
String name = contentJson.getString("name");
|
|
@@ -223,7 +231,7 @@ public class WeixinService {
|
|
|
|
|
|
case REMOTE_DIAGNOSIS_REFUND:
|
|
|
{
|
|
|
- String urlString = "http://wechat.pacsonline.cn/wx_patient/web/remoteDiagnosis?appId=" + ApiConfigKit.getAppId();
|
|
|
+ String urlString = "https://wechat.pacsonline.cn/wx_patient/web/remoteDiagnosis?appId=" + ApiConfigKit.getAppId();
|
|
|
JSONObject contentJson = JSON.parseObject(content);
|
|
|
String out_trade_no = contentJson.getString("out_trade_no");
|
|
|
String name = contentJson.getString("name");
|
|
@@ -236,6 +244,30 @@ public class WeixinService {
|
|
|
}
|
|
|
break;
|
|
|
|
|
|
+ case LOCAL_EXAM_FINISH:
|
|
|
+ {
|
|
|
+ String urlString = "https://wechat.pacsonline.cn/wx_patient/web/remoteDiagnosis?appId=" + ApiConfigKit.getAppId();
|
|
|
+ JSONObject contentJson = JSON.parseObject(content);
|
|
|
+ String name = contentJson.getString("name");
|
|
|
+ String modality = contentJson.getString("modality");
|
|
|
+ String status = contentJson.getString("status");
|
|
|
+ String template_id = REMOTE_DIAGNOSIS_REFUND_TEMPLATE_ID.get(source);
|
|
|
+ apiResult = sendLocalExamFinishMsg(openid, urlString, name, modality, status, template_id);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+
|
|
|
+ case LOCAL_REPORT_FINISH:
|
|
|
+ {
|
|
|
+ String urlString = "https://wechat.pacsonline.cn/wx_patient/web/remoteDiagnosis?appId=" + ApiConfigKit.getAppId();
|
|
|
+ JSONObject contentJson = JSON.parseObject(content);
|
|
|
+ String name = contentJson.getString("modality");
|
|
|
+ String modality = contentJson.getString("name");
|
|
|
+ String eaxmDate = contentJson.getString("eaxmDate");
|
|
|
+ String template_id = REMOTE_DIAGNOSIS_REFUND_TEMPLATE_ID.get(source);
|
|
|
+ apiResult = sendLocalReportFinishMsg(openid, urlString, modality, name, eaxmDate, template_id);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+
|
|
|
default:
|
|
|
break;
|
|
|
}
|
|
@@ -378,6 +410,72 @@ public class WeixinService {
|
|
|
return apiResult;
|
|
|
}
|
|
|
|
|
|
+ public ApiResult sendLocalExamFinishMsg(String openid, String url, String name, String modality, String status, String template_id) {
|
|
|
+ String str = " {\n" +
|
|
|
+ " \"touser\":\""+openid+"\",\n" +
|
|
|
+ " \"template_id\":\""+template_id+"\",\n" +
|
|
|
+ " \"url\":\""+url+"\",\n" +
|
|
|
+ " \"topcolor\":\"#FF0000\",\n" +
|
|
|
+ " \"data\":{\n" +
|
|
|
+ " \"first\": {\n" +
|
|
|
+ " \"value\":\"尊敬的"+ name + "先生/女士,您好,您的检查信息如下\",\n" +
|
|
|
+ " \"color\":\"#173177\"\n" +
|
|
|
+ " },\n" +
|
|
|
+ " \"keyword1\":{\n" +
|
|
|
+ " \"value\":\""+name+"\",\n" +
|
|
|
+ " \"color\":\"#173177\"\n" +
|
|
|
+ " },\n" +
|
|
|
+ " \"keyword2\":{\n" +
|
|
|
+ " \"value\":\""+modality+"\",\n" +
|
|
|
+ " \"color\":\"#173177\"\n" +
|
|
|
+ " },\n" +
|
|
|
+ " \"keyword3\":{\n" +
|
|
|
+ " \"value\":\""+status+"\",\n" +
|
|
|
+ " \"color\":\"#173177\"\n" +
|
|
|
+ " },\n" +
|
|
|
+ " \"remark\":{\n" +
|
|
|
+ " \"value\":\"检查结束,请耐心等待\",\n" +
|
|
|
+ " \"color\":\"#173177\"\n" +
|
|
|
+ " }\n" +
|
|
|
+ " }\n" +
|
|
|
+ " }";
|
|
|
+ ApiResult apiResult = TemplateMsgApi.send(str);
|
|
|
+ return apiResult;
|
|
|
+ }
|
|
|
+
|
|
|
+ public ApiResult sendLocalReportFinishMsg(String openid, String url, String modality, String name, String eaxmDate, String template_id) {
|
|
|
+ String str = " {\n" +
|
|
|
+ " \"touser\":\""+openid+"\",\n" +
|
|
|
+ " \"template_id\":\""+template_id+"\",\n" +
|
|
|
+ " \"url\":\""+url+"\",\n" +
|
|
|
+ " \"topcolor\":\"#FF0000\",\n" +
|
|
|
+ " \"data\":{\n" +
|
|
|
+ " \"first\": {\n" +
|
|
|
+ " \"value\":\"您的检查报告结果已经出来了\",\n" +
|
|
|
+ " \"color\":\"#173177\"\n" +
|
|
|
+ " },\n" +
|
|
|
+ " \"keyword1\":{\n" +
|
|
|
+ " \"value\":\""+modality+"\",\n" +
|
|
|
+ " \"color\":\"#173177\"\n" +
|
|
|
+ " },\n" +
|
|
|
+ " \"keyword2\":{\n" +
|
|
|
+ " \"value\":\""+name+"\",\n" +
|
|
|
+ " \"color\":\"#173177\"\n" +
|
|
|
+ " },\n" +
|
|
|
+ " \"keyword3\":{\n" +
|
|
|
+ " \"value\":\""+eaxmDate+"\",\n" +
|
|
|
+ " \"color\":\"#173177\"\n" +
|
|
|
+ " },\n" +
|
|
|
+ " \"remark\":{\n" +
|
|
|
+ " \"value\":\"点击查看报告详情\",\n" +
|
|
|
+ " \"color\":\"#173177\"\n" +
|
|
|
+ " }\n" +
|
|
|
+ " }\n" +
|
|
|
+ " }";
|
|
|
+ ApiResult apiResult = TemplateMsgApi.send(str);
|
|
|
+ return apiResult;
|
|
|
+ }
|
|
|
+
|
|
|
private String getNowDateString() {
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日 HH:mm:ss");
|
|
|
String time = sdf.format(new Date());
|