|
@ -13,10 +13,13 @@ import com.yihu.wlyy.service.third.health.bank.CreditLogService;
|
|
|
import com.yihu.wlyy.task.PushMsgTask;
|
|
|
import com.yihu.wlyy.util.DateUtil;
|
|
|
import com.yihu.wlyy.web.BaseController;
|
|
|
import com.yihu.wlyy.web.doctor.device.DoctorDeviceController;
|
|
|
import com.yihu.wlyy.wechat.util.WeiXinAccessTokenUtils;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import io.swagger.annotations.ApiParam;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.http.MediaType;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
@ -33,6 +36,7 @@ import java.util.Map;
|
|
|
@RequestMapping(value = "/healthBank",produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
|
|
|
@Api(description = "积分处理机制")
|
|
|
public class CreditsLogController extends BaseController {
|
|
|
private static Logger logger = LoggerFactory.getLogger(CreditsLogController.class);
|
|
|
|
|
|
@Autowired
|
|
|
private CreditLogService service;
|
|
@ -95,29 +99,30 @@ public class CreditsLogController extends BaseController {
|
|
|
String patientid = String.valueOf(list.get(0).get("patientId"));
|
|
|
|
|
|
|
|
|
//@TODO 获取积分调用发送微信模板接口
|
|
|
Patient people = patientDao.findByCode(patientid);
|
|
|
String openId = people.getOpenid();
|
|
|
String name = people.getName();
|
|
|
try {
|
|
|
//@TODO 获取积分调用发送微信模板接口
|
|
|
Patient people = patientDao.findByCode(patientid);
|
|
|
String openId = people.getOpenid();
|
|
|
String name = people.getName();
|
|
|
|
|
|
org.json.JSONObject sendJson = new org.json.JSONObject();
|
|
|
String first = "";
|
|
|
String remark = "";
|
|
|
String url = "";
|
|
|
|
|
|
WechatTemplateConfig templateConfig = templateConfigDao.findByScene("template_healthbank_credit","jfdztz");
|
|
|
first = templateConfig.getFirst();
|
|
|
remark = templateConfig.getRemark();
|
|
|
org.json.JSONObject sendJson = new org.json.JSONObject();
|
|
|
String first = "";
|
|
|
String remark = "";
|
|
|
String url = "";
|
|
|
|
|
|
WechatTemplateConfig templateConfig = templateConfigDao.findByScene("template_healthbank_credit","jfdztz");
|
|
|
first = templateConfig.getFirst();
|
|
|
remark = templateConfig.getRemark();
|
|
|
// String keyword1 = templateConfig.getKeyword1();
|
|
|
|
|
|
sendJson.put("keyword1", integrate);
|
|
|
sendJson.put("keyword2", DateUtil.getStringDate());
|
|
|
sendJson.put("first", first);
|
|
|
sendJson.put("remark", remark);
|
|
|
url = templateConfig.getUrl();
|
|
|
url = url.replace("key1",(integrate==null?"":integrate));
|
|
|
sendJson.put("url", url);//带参数的模板跳转链接
|
|
|
pushMsgTask.putWxMsg(weiXinAccessTokenUtils.getAccessToken(), 23, openId, name, sendJson);
|
|
|
sendJson.put("keyword1", integrate);
|
|
|
sendJson.put("keyword2", DateUtil.getStringDate());
|
|
|
sendJson.put("first", first);
|
|
|
sendJson.put("remark", remark);
|
|
|
url = templateConfig.getUrl();
|
|
|
url = url.replace("key1",(integrate==null?"":integrate));
|
|
|
sendJson.put("url", url);//带参数的模板跳转链接
|
|
|
pushMsgTask.putWxMsg(weiXinAccessTokenUtils.getAccessToken(), 23, openId, name, sendJson);
|
|
|
// //发送代理人
|
|
|
// jsonArray = weiXinOpenIdUtils.getAgentOpenId(patient, openId);
|
|
|
// if (jsonArray != null && jsonArray.length() > 0) {
|
|
@ -134,6 +139,11 @@ public class CreditsLogController extends BaseController {
|
|
|
// pushMsgTask.putWxMsg(weiXinAccessTokenUtils.getAccessToken(), 19, member.getOpenid(), name, sendJson);
|
|
|
// }
|
|
|
// }
|
|
|
}catch (Exception e){
|
|
|
logger.info("健康银行居民新增积分,微信模板消息发送失败:"+e.getMessage());
|
|
|
// e.printStackTrace();
|
|
|
}
|
|
|
|
|
|
}
|
|
|
}
|
|
|
return write(200,"添加成功","data",result);
|