|
@@ -46,6 +46,9 @@ public class UserCenterService {
|
|
|
@Value("${zskk.secret}")
|
|
|
private String secret;
|
|
|
|
|
|
+ @Value("${zskk.report.push.templateid}")
|
|
|
+ private String reprotPushTemplateId;
|
|
|
+
|
|
|
@Autowired
|
|
|
private SignService signService;
|
|
|
|
|
@@ -177,6 +180,30 @@ public class UserCenterService {
|
|
|
return uccenter + "callback/h5Pay?companyid=" + companyid + "&apporderid=" + order.getOrderid() + "&sign=" + sign;
|
|
|
}
|
|
|
|
|
|
+ public ControllerResult pushReportMsg(String phone, Integer reportid){
|
|
|
+ Map<String, Object> data = new HashMap<>();
|
|
|
+ return this.sendTemplateMsg(companyid, phone, reprotPushTemplateId, myhost + "rjreport/" + reportid, JSON.toJSONString(data));
|
|
|
+ }
|
|
|
+
|
|
|
+ public ControllerResult sendTemplateMsg(String companyid, String phone, String templateid, String url, String data){
|
|
|
+ Map<String, String> params = new HashMap<>();
|
|
|
+ params.put("companyid", this.companyid);
|
|
|
+ params.put("phone", phone);
|
|
|
+ params.put("templateid", templateid);
|
|
|
+ params.put("url", url);
|
|
|
+ params.put("data", data);
|
|
|
+ params.put("sign", this.sign(params));
|
|
|
+
|
|
|
+ try{
|
|
|
+ String content = HttpClient.doPost(uccenter + "tools/sendTemplateMsg", params);
|
|
|
+ return JSON.parseObject(content, ControllerResult.class);
|
|
|
+ }catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ LogUtil.sysError(e.getMessage(), e);
|
|
|
+ return new ControllerResult(ErrorConstant.SERVER_ERROR);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
public String sign(Map<String, String> params){
|
|
|
return signService.sign(params, secret);
|
|
|
}
|