| | |
| | | import com.google.gson.Gson; |
| | | import com.nq.common.ServerResponse; |
| | | import com.nq.dao.*; |
| | | import com.nq.enums.EConfigKey; |
| | | import com.nq.pojo.*; |
| | | import com.nq.service.IAgentAgencyFeeService; |
| | | import com.nq.service.IAgentDistributionUserService; |
| | | import com.nq.service.IAgentUserService; |
| | | import com.nq.service.ISiteInfoService; |
| | | import com.nq.service.*; |
| | | import com.nq.utils.KeyUtils; |
| | | import com.nq.utils.PropertiesUtil; |
| | | import com.nq.utils.SymmetricCryptoUtil; |
| | |
| | | |
| | | @Resource |
| | | UserMapper userMapper; |
| | | |
| | | @Autowired |
| | | IStockConfigServices iStockConfigServices; |
| | | |
| | | |
| | | public AgentUser getCurrentAgent(HttpServletRequest request) { |
| | |
| | | if (parentAgent != null) { |
| | | dbAgent.setParentId(parentAgent.getId()); |
| | | dbAgent.setParentName(parentAgent.getAgentName()); |
| | | //判断代理等级 |
| | | StockConfig stockConfig = iStockConfigServices.queryByKey(EConfigKey.AGENT_MAX_GRADE.getCode()); |
| | | if(null != agentUser.getAgentLevel() && agentUser.getAgentLevel() > Integer.parseInt(stockConfig.getCValue())){ |
| | | return ServerResponse.createByErrorMsg("代理最大等级为"+stockConfig.getCValue()); |
| | | } |
| | | dbAgent.setAgentLevel(parentAgent.getAgentLevel()+1); |
| | | } else { |
| | | //总代理默认0级 |
| | |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public ServerResponse<List<AgentUser>> getParensAgent() { |
| | | return ServerResponse.createBySuccess(agentUserMapper.getParensAgent()); |
| | | } |
| | | |
| | | public int CountAgentNum() { |
| | | return this.agentUserMapper.CountAgentNum(); |
| | | } |