master
wangning 7 years ago
parent d51a174b7e
commit be7727061d

@ -244,6 +244,14 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService {
}
private void applyerToClient(String username){
Date now = new Date();
JSONObject param = new JSONObject();
param.put("begin_time",DateFormatUtils.format(now,"YYYYMMdd"));
param.put("end_time",DateFormatUtils.format(DateUtils.addDays(now,1),"YYYYMMdd"));
List<JSONObject> existCount = sysClientPreMapperMapper.query(param);
if(existCount.size()>30){
throw new BadRequestException("New merchant over limit,Please contact us");
}
JSONObject apply = sysClientPreMapperMapper.findByUserName(username);
JSONObject subMerchantId = pmtSubMerchantIdMapper.randomOne();
@ -410,4 +418,5 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService {
private String getVerifyMailRedisKey(String codekey) {
return VERIFY_MAIL_PREFIX + codekey;
}
}

@ -4,6 +4,8 @@ import com.alibaba.fastjson.JSONObject;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import cn.yixblog.support.mybatis.autosql.annotations.AutoMapper;
import cn.yixblog.support.mybatis.autosql.annotations.AutoSql;
import cn.yixblog.support.mybatis.autosql.annotations.SqlType;
@ -18,4 +20,6 @@ public interface SysClientPreMapperMapper {
@AutoSql(type = SqlType.SELECT)
JSONObject findByUserName(@Param("username") String username);
List<JSONObject> query(JSONObject param);
}

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="au.com.royalpay.payment.manage.mappers.preapply.SysClientPreMapperMapper">
<select id="query" resultType="com.alibaba.fastjson.JSONObject">
select * from sys_client_pre_apply
<where>
<if test="#{begin_time}!=null">
and create_time >#{begin_time}
</if>
<if test="#{end_time}!=null">
and create_time <#{end_time}
</if>
</where>
</select>
</mapper>
Loading…
Cancel
Save