Commit 1c2cd56d by guanchen

修复bug

添加config方法到启东类
parent 1965dae1
......@@ -4,12 +4,14 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
/**
* @author houseme
*/
@SpringBootApplication
public class PartnerApplication {
public class PartnerApplication extends SpringBootServletInitializer {
private static Logger logger = LoggerFactory.getLogger(PartnerApplication.class);
......@@ -32,4 +34,9 @@ public class PartnerApplication {
e.printStackTrace();
}
}
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
return builder.sources(PartnerApplication.class);
}
}
......@@ -23,7 +23,7 @@ import java.util.Map;
* @author houseme
* @date 2017/9/8 上午11:54
* Project snacks
* Package com.yinguo.snacks.aspect
* Package com.lanren.huhu.partner.aspect
* File
*/
@Aspect
......
......@@ -93,8 +93,14 @@ public class UserManager {
while (true) {
logger.info("now loop uid is {}", loopUserId);
ParentPartner parentPartner = getParentPartner(loopUserId);
/**
* 有上级合伙人
*/
if (null != parentPartner) {
UserAgent userAgent = userAgentService.getOneByUserId(parentPartner.getUserId());
/**
* 找到了第一个是代理商的合伙人
*/
if (null != userAgent) {
/**
* 然后开始 无限找 这个人的上级代理商
......@@ -113,15 +119,23 @@ public class UserManager {
loogAgentId = loopUserAgent.getAgentId();
}
}
/**
* 找完 "第一个是代理商的合伙人" 的 全部上级代理后 退出while循环
*/
logger.info("loop find parent agent end");
break;
} else {
break;
/**
* 这个人不是代理商 继续往上找
*/
loopUserId = parentPartner.getUserId();
}
} else {
logger.info("parent is {} ", parentPartner.getUserId());
user.getPartnerList().add(parentPartner);
loopUserId = parentPartner.getUserId();
/**
* 没有上级合伙人 打印结束信息 跳出循环
*/
logger.info("loop end with userId: {}", loopUserId);
break;
}
}
logger.info("setAgentList for user: {} end", user.getUserId());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment