|
|
|
@@ -12,6 +12,8 @@ import com.iformall.domain.po.WxMsgModel; |
|
|
|
import com.iformall.domain.po.base.TenantEntity; |
|
|
|
import com.iformall.enums.EnumMsgModelStatus; |
|
|
|
import com.iformall.enums.EnumVerifyCode; |
|
|
|
import com.iformall.exception.BizMessageException; |
|
|
|
import com.iformall.exception.MallinkException; |
|
|
|
import com.iformall.mapper.WxMsgConfigMapper; |
|
|
|
import com.iformall.mapper.WxMsgModelMapper; |
|
|
|
import com.iformall.service.WxMsgModelService; |
|
|
|
@@ -46,7 +48,6 @@ public class WxMsgModelServiceImpl implements WxMsgModelService { |
|
|
|
|
|
|
|
@Override |
|
|
|
public ResultData saveOrUpdate(WxMsgModel wxMsgModel) { |
|
|
|
|
|
|
|
//从短信配置中查询密钥 bid 等信息 |
|
|
|
WxMsgConfig wxMsgConfig = new WxMsgConfig(); |
|
|
|
wxMsgConfig.updateTenantInfo(wxMsgModel); |
|
|
|
@@ -55,11 +56,12 @@ public class WxMsgModelServiceImpl implements WxMsgModelService { |
|
|
|
return new ResultData(ErrorCode.MSG_SERVER_NOT_FIND.getCode(), "您还未接入短信运营商,请联系平台管理员"); |
|
|
|
wxMsgConfig = wxMsgConfigs.get(0); |
|
|
|
|
|
|
|
String secret = wxMsgConfig.getSecret(); |
|
|
|
String bid = wxMsgConfig.getBid(); |
|
|
|
|
|
|
|
String signature = wxMsgModel.getSignature(); |
|
|
|
String content = wxMsgModel.getContent(); |
|
|
|
|
|
|
|
// 校验短信字数,超过规定字数会额外收费 |
|
|
|
SMSFactory.checkMessage(wxMsgConfig.getSmsChannel(), signature, content); |
|
|
|
|
|
|
|
//查看用户最新数据是否存在 |
|
|
|
List<WxMsgModel> wxMsgModels = wxMsgModelMapper.findList(wxMsgModel); |
|
|
|
if (wxMsgModel.getId() == null && wxMsgModels.size() == 1) { |
|
|
|
|