|
|
@@ -82,8 +82,6 @@ public class WxMsgValidationcodeServiceImpl implements WxMsgValidationcodeServic |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public ResultData sendvalidationcode(WxMsgValidationcode wxMsgValidationcode) { |
|
|
public ResultData sendvalidationcode(WxMsgValidationcode wxMsgValidationcode) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//1、查看是否存在未过期的短信,有返回成功 没有继续 |
|
|
//1、查看是否存在未过期的短信,有返回成功 没有继续 |
|
|
List<WxMsgValidationcode> wxmsgvalidationcodelist = wxMsgValidationcodeMapper.findList(wxMsgValidationcode); |
|
|
List<WxMsgValidationcode> wxmsgvalidationcodelist = wxMsgValidationcodeMapper.findList(wxMsgValidationcode); |
|
|
Date currentdate = new Date(); |
|
|
Date currentdate = new Date(); |
|
|
@@ -91,13 +89,11 @@ public class WxMsgValidationcodeServiceImpl implements WxMsgValidationcodeServic |
|
|
validationcode.getExpiretime().after(currentdate)).collect(Collectors.toList()); |
|
|
validationcode.getExpiretime().after(currentdate)).collect(Collectors.toList()); |
|
|
if(wxmsgvalidationcodelist.size()>0) return new ResultData(ErrorCode.MSG_REPEAT_SEND.getCode(),ErrorCode.MSG_REPEAT_SEND.getMessage()); |
|
|
if(wxmsgvalidationcodelist.size()>0) return new ResultData(ErrorCode.MSG_REPEAT_SEND.getCode(),ErrorCode.MSG_REPEAT_SEND.getMessage()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//2、根据tenantid查询出商场名称作为签名 |
|
|
//2、根据tenantid查询出商场名称作为签名 |
|
|
/*WxMall wxMall = new WxMall(); |
|
|
/*WxMall wxMall = new WxMall(); |
|
|
wxMall.setTenantId(wxMsgValidationcode.getTenantId()); |
|
|
wxMall.setTenantId(wxMsgValidationcode.getTenantId()); |
|
|
List<WxMall> wxmallist = wxMallMapper.findList(wxMall);*/ |
|
|
List<WxMall> wxmallist = wxMallMapper.findList(wxMall);*/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//3、从短信配置中查询密钥 bid 等信息 |
|
|
//3、从短信配置中查询密钥 bid 等信息 |
|
|
WxMsgConfig wxMsgConfig = new WxMsgConfig(); |
|
|
WxMsgConfig wxMsgConfig = new WxMsgConfig(); |
|
|
wxMsgConfig.setTenantId(wxMsgValidationcode.getTenantId()); |
|
|
wxMsgConfig.setTenantId(wxMsgValidationcode.getTenantId()); |
|
|
@@ -114,7 +110,7 @@ public class WxMsgValidationcodeServiceImpl implements WxMsgValidationcodeServic |
|
|
String secret = wxMsgConfig.getSecret(); |
|
|
String secret = wxMsgConfig.getSecret(); |
|
|
String bid = wxMsgConfig.getBid(); |
|
|
String bid = wxMsgConfig.getBid(); |
|
|
String publickey = wxMsgConfig.getPublickey(); |
|
|
String publickey = wxMsgConfig.getPublickey(); |
|
|
//验证码 |
|
|
|
|
|
|
|
|
// //验证码 |
|
|
int code = (int) ((Math.random() * 9 + 1) * 100000); |
|
|
int code = (int) ((Math.random() * 9 + 1) * 100000); |
|
|
String phone = wxMsgValidationcode.getPhone(); |
|
|
String phone = wxMsgValidationcode.getPhone(); |
|
|
String signature = wxMsgValidationcode.getSignature(); |
|
|
String signature = wxMsgValidationcode.getSignature(); |
|
|
@@ -128,16 +124,15 @@ public class WxMsgValidationcodeServiceImpl implements WxMsgValidationcodeServic |
|
|
|
|
|
|
|
|
//给发起人发送驳回消息 |
|
|
//给发起人发送驳回消息 |
|
|
// Map<String,String> msgReplaceMap = new HashedMap(); |
|
|
// Map<String,String> msgReplaceMap = new HashedMap(); |
|
|
// msgReplaceMap.put("contract",(String)getVariableByKey(variables,"contractNumber")); |
|
|
|
|
|
// msgReplaceMap.put("page",Constant.adminPage); |
|
|
|
|
|
|
|
|
// msgReplaceMap.put("s6",String.valueOf(code)); |
|
|
// WxMsgRecord wxMsgRecord = new WxMsgRecord(); |
|
|
// WxMsgRecord wxMsgRecord = new WxMsgRecord(); |
|
|
// wxMsgRecord.setMsgType(EnumMsgRecordType.SMS.getCode()); |
|
|
// wxMsgRecord.setMsgType(EnumMsgRecordType.SMS.getCode()); |
|
|
// wxMsgRecord.setModelType(EnumMsgModel.VALIDATION_CODE.getCode()); |
|
|
// wxMsgRecord.setModelType(EnumMsgModel.VALIDATION_CODE.getCode()); |
|
|
// wxMsgRecord.setReceiver(wxMsgValidationcode.getPhone()); |
|
|
// wxMsgRecord.setReceiver(wxMsgValidationcode.getPhone()); |
|
|
// wxMsgRecord.setTenantId(wxMsgConfig.getTenantId()); |
|
|
|
|
|
|
|
|
// wxMsgRecord.setTenantId(wxMsgValidationcode.getTenantId()); |
|
|
// wxMsgRecord.setDynamicContentMap(msgReplaceMap); |
|
|
// wxMsgRecord.setDynamicContentMap(msgReplaceMap); |
|
|
// mqBaseProducer.sendMessage(wxMsgRecord, EnumMsgMqTopic.DEFAULT.getCode(),EnumMsgMqTag.DEFAULT.getCode(),EnumMsgMqKey.DEFAULT.getCode()); |
|
|
// mqBaseProducer.sendMessage(wxMsgRecord, EnumMsgMqTopic.DEFAULT.getCode(),EnumMsgMqTag.DEFAULT.getCode(),EnumMsgMqKey.DEFAULT.getCode()); |
|
|
|
|
|
|
|
|
|
|
|
// return new ResultData(Result.SUCCESS,"发送成功"); |
|
|
|
|
|
|
|
|
String result = WiwideUtil.sendMsg(secret, bid, publickey, phone, signature, msg, notifyUrl, EnumVerifyCode.YES.getCode().toString(), modelId); |
|
|
String result = WiwideUtil.sendMsg(secret, bid, publickey, phone, signature, msg, notifyUrl, EnumVerifyCode.YES.getCode().toString(), modelId); |
|
|
JSONObject jsonObjectResult = JSONObject.parseObject(result); |
|
|
JSONObject jsonObjectResult = JSONObject.parseObject(result); |
|
|
@@ -158,7 +153,6 @@ public class WxMsgValidationcodeServiceImpl implements WxMsgValidationcodeServic |
|
|
return new ResultData(Result.SUCCESS,"发送成功"); |
|
|
return new ResultData(Result.SUCCESS,"发送成功"); |
|
|
} |
|
|
} |
|
|
return new ResultData(ErrorCode.MSG_SEND_ERROR.getCode(),"发送失败"); |
|
|
return new ResultData(ErrorCode.MSG_SEND_ERROR.getCode(),"发送失败"); |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
|