| @@ -0,0 +1 @@ | |||||
| update wx_msg_validationcode_model set content='{s6}(动态验证码),请在5分钟内填写' where type in (1,6); | |||||
| @@ -67,6 +67,17 @@ public class WxMsgValidationcode implements Serializable { | |||||
| @io.swagger.annotations.ApiModelProperty(value="",name="appid") | @io.swagger.annotations.ApiModelProperty(value="",name="appid") | ||||
| private String appid; | private String appid; | ||||
| @Transient | |||||
| private String createtimeStr; | |||||
| public String getCreatetimeStr() { | |||||
| return createtimeStr; | |||||
| } | |||||
| public void setCreatetimeStr(String createtimeStr) { | |||||
| this.createtimeStr = createtimeStr; | |||||
| } | |||||
| public String getPhone() { | public String getPhone() { | ||||
| return phone; | return phone; | ||||
| } | } | ||||
| @@ -12,6 +12,7 @@ import com.iformall.enums.*; | |||||
| import com.iformall.mapper.*; | import com.iformall.mapper.*; | ||||
| import com.iformall.mq.MqBaseProducer; | import com.iformall.mq.MqBaseProducer; | ||||
| import com.iformall.service.WxMsgValidationcodeService; | import com.iformall.service.WxMsgValidationcodeService; | ||||
| import com.iformall.utils.DateUtils; | |||||
| import org.apache.commons.collections.map.HashedMap; | import org.apache.commons.collections.map.HashedMap; | ||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| @@ -84,7 +85,16 @@ public class WxMsgValidationcodeServiceImpl implements WxMsgValidationcodeServic | |||||
| Date currentdate = new Date(); | Date currentdate = new Date(); | ||||
| wxmsgvalidationcodelist = wxmsgvalidationcodelist.stream().filter(validationcode -> | wxmsgvalidationcodelist = wxmsgvalidationcodelist.stream().filter(validationcode -> | ||||
| 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); | |||||
| } | |||||
| //2 判断是否已超过3条 | |||||
| String systemTime = DateUtils.getSystemTime("yyyy-MM-dd"); | |||||
| wxMsgValidationcode.setCreatetimeStr(systemTime); | |||||
| List<WxMsgValidationcode> list = wxMsgValidationcodeMapper.findList(wxMsgValidationcode); | |||||
| if (list.size() == 3) { | |||||
| return new ResultData(ErrorCode.MSG_SEND_ERROR.getCode(), "验证码发送超限"); | |||||
| } | |||||
| //验证码 | //验证码 | ||||
| int code = (int) ((Math.random() * 9 + 1) * 100000); | int code = (int) ((Math.random() * 9 + 1) * 100000); | ||||
| @@ -22,14 +22,15 @@ | |||||
| <sql id="dynamicWhereConditions"> | <sql id="dynamicWhereConditions"> | ||||
| where 1 = 1 | where 1 = 1 | ||||
| <if test=" null != id "> and `id` = #{id} </if> | <if test=" null != id "> and `id` = #{id} </if> | ||||
| <if test=" null != phone "> and `phone` = #{phone} </if> | |||||
| <if test=" null != expiretime "> and `expiretime` = #{expiretime} </if> | |||||
| <if test=" null != createtime "> and `createtime` = #{createtime} </if> | |||||
| <if test=" null != phone "> and `phone` = #{phone} </if> | |||||
| <if test=" null != expiretime ">and `expiretime` = #{expiretime}</if> | |||||
| <if test=" null != createtime ">and `createtime` = #{createtime}</if> | |||||
| <if test=" null != type "> and `type` = #{type} </if> | <if test=" null != type "> and `type` = #{type} </if> | ||||
| <if test=" null != tenantId "> and `tenant_id` = #{tenantId} </if> | <if test=" null != tenantId "> and `tenant_id` = #{tenantId} </if> | ||||
| <if test=" null != msg "> and `msg` = #{msg} </if> | |||||
| <if test=" null != signature "> and `signature` = #{signature} </if> | |||||
| <if test=" null != code "> and `code` = #{code} </if> | |||||
| <if test=" null != msg "> and `msg` = #{msg} </if> | |||||
| <if test=" null != signature ">and `signature` = #{signature}</if> | |||||
| <if test=" null != code ">and `code` = #{code}</if> | |||||
| <if test=" null != createtimeStr ">and date_format(`createtime`,'%Y-%m-%d') = #{createtimeStr}</if> | |||||
| <if test=" null != ids "> | <if test=" null != ids "> | ||||
| and id in | and id in | ||||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | ||||