|
|
|
@@ -3,6 +3,7 @@ package com.simple.service.impl; |
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
import com.github.pagehelper.PageHelper; |
|
|
|
import com.github.pagehelper.PageInfo; |
|
|
|
import com.simple.common.ErrorCode; |
|
|
|
import com.simple.common.IdWorker; |
|
|
|
import com.simple.common.Result; |
|
|
|
import com.simple.common.ResultData; |
|
|
|
@@ -46,7 +47,7 @@ public class WxMsgModelServiceImpl implements WxMsgModelService { |
|
|
|
WxMsgConfig wxMsgConfig = new WxMsgConfig(); |
|
|
|
wxMsgConfig.setTenantId(wxMsgModel.getTenantId()); |
|
|
|
List<WxMsgConfig> wxMsgConfigs = wxMsgConfigMapper.findList(wxMsgConfig); |
|
|
|
if(wxMsgConfigs.size()==0)return new ResultData(Result.SUCCESS, "您还未接入短信运营商,请联系平台管理员"); |
|
|
|
if(wxMsgConfigs.size()==0)return new ResultData(ErrorCode.MSG_SERVER_NOT_FIND.getCode(), "您还未接入短信运营商,请联系平台管理员"); |
|
|
|
wxMsgConfig = wxMsgConfigs.get(0); |
|
|
|
|
|
|
|
String secret = wxMsgConfig.getSecret(); |
|
|
|
@@ -56,12 +57,12 @@ public class WxMsgModelServiceImpl implements WxMsgModelService { |
|
|
|
//查看用户最新数据是否存在 |
|
|
|
List<WxMsgModel> wxMsgModels = wxMsgModelMapper.findList(wxMsgModel); |
|
|
|
if (wxMsgModel.getId() == null && wxMsgModels.size() == 1) { |
|
|
|
return new ResultData(Result.SUCCESS, "您添加的短信模板已存在"); |
|
|
|
return new ResultData(ErrorCode.MSG_TEMPLATE_REPEAT.getCode(), "您添加的短信模板已存在"); |
|
|
|
} |
|
|
|
if (wxMsgModel.getId() != null && wxMsgModels.size() == 1) { |
|
|
|
WxMsgModel wxmsgmodel = wxMsgModels.get(0); |
|
|
|
if(wxmsgmodel.getContent().equals(wxMsgModel.getContent()) && wxmsgmodel.getSignature().equals(wxMsgModel.getSignature())) { |
|
|
|
return new ResultData(Result.SUCCESS, "您添加的短信模板已存在"); |
|
|
|
return new ResultData(ErrorCode.MSG_TEMPLATE_REPEAT.getCode(), "您添加的短信模板已存在"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@@ -115,9 +116,9 @@ public class WxMsgModelServiceImpl implements WxMsgModelService { |
|
|
|
} |
|
|
|
return new ResultData(Result.SUCCESS, "创建模板成功"); |
|
|
|
}else if (ret == "-4") { |
|
|
|
return new ResultData(Result.SUCCESS, "短信签名或内容错误"); |
|
|
|
return new ResultData(ErrorCode.MSG_SIGNATURE_CONTENT_ERROR.getCode(), "短信签名或内容错误"); |
|
|
|
} |
|
|
|
return new ResultData(Result.SUCCESS, "创建模板失败"); |
|
|
|
return new ResultData(ErrorCode.MSG_TEMPLATE_CREATE_ERROR.getCode(), "创建模板失败"); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
|