|
|
|
@@ -8,6 +8,7 @@ import com.iformall.common.IdWorker; |
|
|
|
import com.iformall.common.Result; |
|
|
|
import com.iformall.common.ResultData; |
|
|
|
import com.iformall.domain.po.*; |
|
|
|
import com.iformall.enums.EnumMsgSendStatus; |
|
|
|
import com.iformall.mapper.*; |
|
|
|
import com.iformall.service.WxMsgValidationcodeService; |
|
|
|
import com.iformall.utils.AesUtil; |
|
|
|
@@ -46,6 +47,9 @@ public class WxMsgValidationcodeServiceImpl implements WxMsgValidationcodeServic |
|
|
|
@Autowired |
|
|
|
WxMerchantMapper wxMerchantMapper; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
WxMsgCallbackMapper wxMsgCallbackMapper; |
|
|
|
|
|
|
|
@Override |
|
|
|
public PageInfo<WxMsgValidationcode> listAsPage(WxMsgValidationcode record, Integer pageIndex, Integer pageSize) { |
|
|
|
return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxMsgValidationcodeMapper.findList(record)); |
|
|
|
@@ -156,7 +160,7 @@ public class WxMsgValidationcodeServiceImpl implements WxMsgValidationcodeServic |
|
|
|
String result = HttpUtil.doPost(requestUrl, params); |
|
|
|
JSONObject jsonObjectResult = JSONObject.parseObject(result); |
|
|
|
String ret = jsonObjectResult.get("ret").toString(); |
|
|
|
|
|
|
|
String batchNo = jsonObjectResult.get("data").toString(); |
|
|
|
if (ret.equals("1")) { |
|
|
|
final IdWorker idWorker = IdWorker.get(); |
|
|
|
wxMsgValidationcode.setId(idWorker.nextId()); |
|
|
|
@@ -168,12 +172,29 @@ public class WxMsgValidationcodeServiceImpl implements WxMsgValidationcodeServic |
|
|
|
wxMsgValidationcode.setExpiretime(expiredate); |
|
|
|
wxMsgValidationcode.setCreatetime(createtime); |
|
|
|
wxMsgValidationcodeMapper.insertSelective(wxMsgValidationcode); |
|
|
|
addMsgCallback(wxMsgValidationcode,batchNo); |
|
|
|
return new ResultData(Result.SUCCESS,"发送成功"); |
|
|
|
} |
|
|
|
return new ResultData(ErrorCode.MSG_SEND_ERROR.getCode(),"发送失败"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
public void addMsgCallback(WxMsgValidationcode wxmsg, String batchNo){ |
|
|
|
logger.info("验证码发送时主动添加回调记录开始..."); |
|
|
|
String phone = wxmsg.getPhone(); |
|
|
|
final IdWorker idWorker = IdWorker.get(); |
|
|
|
WxMsgCallback wxMsgCallback = new WxMsgCallback(); |
|
|
|
wxMsgCallback.setId(idWorker.nextId()); |
|
|
|
wxMsgCallback.setPhone(phone); |
|
|
|
wxMsgCallback.setTenantId(wxmsg.getTenantId()); |
|
|
|
wxMsgCallback.setBatchNo(batchNo); |
|
|
|
wxMsgCallback.setMsgId(wxmsg.getId()); |
|
|
|
wxMsgCallback.setStatus(EnumMsgSendStatus.MSG_SEND_FAIL.getCode()); |
|
|
|
wxMsgCallback.setCreatetime(new Date()); |
|
|
|
wxMsgCallbackMapper.insertSelective(wxMsgCallback); |
|
|
|
logger.info("验证码发送时主动添加回调记录结束..."); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public ResultData hasvalidationcode(WxMsgValidationcode record) { |
|
|
|
|
|
|
|
|