Authored by tanling

邀请

... ... @@ -14,7 +14,7 @@
<result column="show_invite_code" property="showInviteCoe" jdbcType="VARCHAR" />
</resultMap>
<sql id="Base_Column_List" >
id, uid, order_code, payment, status, amount, type, create_time, update_time
id, uid, order_code, payment, status, amount, type, create_time, update_time, show_invite_code
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
select
... ...
package com.yohoufo.order.common;
import org.apache.commons.lang3.StringUtils;
public enum InviterType {
STORED_SELLER(1, "UFO", "入驻商家"),
CLASS_B_AGENT(2, "NB", "一级代理");
... ... @@ -10,6 +12,13 @@ public enum InviterType {
private String name;
// 邀请码数字部分
private String value;
public void setValue(String value) {
this.value = value;
}
public int getType() {
return type;
}
... ... @@ -36,7 +45,7 @@ public enum InviterType {
public static InviterType getInviteType(String inputInviteCode){
InviterType inviterType = null;
for (InviterType item : values()){
if (inputInviteCode.startsWith(item.getAlphabet())){
if (StringUtils.startsWithIgnoreCase(inputInviteCode, item.getAlphabet())){
inviterType = item;
break;
}
... ... @@ -46,8 +55,9 @@ public enum InviterType {
return null;
}
String digit = inputInviteCode.replaceFirst(inviterType.getAlphabet(),"");
String digit = StringUtils.removeStartIgnoreCase(inputInviteCode, inviterType.getAlphabet());
if (digit.matches("\\d+")){
inviterType.setValue(digit);
return inviterType;
}
... ...
... ... @@ -37,7 +37,7 @@ import java.util.stream.Collectors;
@Service
public class InviteServiceImpl implements IInviteService {
private static final Logger LOGGER = LoggerFactory.getLogger(AppraiseService.class);
private static final Logger LOGGER = LoggerFactory.getLogger(InviteServiceImpl.class);
@Autowired
IStoredSellerService storedSellerService;
... ...