| | |
| | | } |
| | | |
| | | //查询指数持仓统计信息 |
| | | @RequestMapping({"getParensAgent.do"}) |
| | | @ResponseBody |
| | | public ServerResponse getParensAgent() { |
| | | return this.iAgentUserService.getParensAgent(); |
| | | } |
| | | |
| | | //查询指数持仓统计信息 |
| | | @RequestMapping({"getIndexIncome.do"}) |
| | | @ResponseBody |
| | | public ServerResponse getIndexIncome(@RequestParam(value = "agentId", required = false) Integer agentId, @RequestParam(value = "positionType", required = false) Integer positionType, @RequestParam(value = "beginTime", required = false) String beginTime, @RequestParam(value = "endTime", required = false) String endTime, HttpServletRequest request) { |
| | |
| | | int updateTotalMoney(AgentUser paramAgentUser); |
| | | |
| | | AgentUser findByCode(String paramString); |
| | | |
| | | AgentUser findByCodeAndNeid(String agentCode,Integer id); |
| | | |
| | | AgentUser findByPhone(String paramString); |
| | | |
| | | AgentUser findByParentId(Integer parentId); |
| | | |
| | | List<AgentUser> getParensAgent(); |
| | | |
| | | AgentUser findByName(String paramString); |
| | | |
| | |
| | | MIN_BUY("MIN_BUY","最小买入"), |
| | | BUY_HANDLING_CHARGE("BUY_HANDLING_CHARGE","买入手续费"), |
| | | SELL_HANDLING_CHARGE("SELL_HANDLING_CHARGE","平仓手续费"), |
| | | LIMIT_DOWN_IS_SELL("limit_down_is_sell","跌停是否可以平仓"); |
| | | LIMIT_DOWN_IS_SELL("limit_down_is_sell","跌停是否可以平仓"), |
| | | AGENT_MAX_GRADE("agent_max_grade","最大代理等级"); |
| | | |
| | | private String code; |
| | | private String desc; |
| | |
| | | |
| | | ServerResponse updateOnlineServices(String paramAgentUser,int agentId); |
| | | |
| | | ServerResponse<List<AgentUser>> getParensAgent(); |
| | | |
| | | int CountAgentNum(); |
| | | |
| | | List<AgentUser> getAgentSuperiorList(int agentId); |
| | |
| | | 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(); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.nq.common.ServerResponse; |
| | | import com.nq.dao.StockConfigMapper; |
| | | import com.nq.enums.EConfigKey; |
| | | import com.nq.pojo.StockConfig; |
| | | import com.nq.service.IStockConfigServices; |
| | | import org.apache.commons.lang3.math.NumberUtils; |
| | | import org.apache.http.util.TextUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | StockConfigMapper stockConfigMapper; |
| | | @Override |
| | | public ServerResponse updateStockConfig(StockConfig stockConfig) { |
| | | if(stockConfig.getCKey().equals(EConfigKey.AGENT_MAX_GRADE.getCode()) && !NumberUtils.isCreatable(stockConfig.getCValue())){ |
| | | try { |
| | | int number = Integer.parseInt(stockConfig.getCValue()); |
| | | if(number <= 0){ |
| | | ServerResponse.createByErrorMsg("请输入有效等级"); |
| | | } |
| | | } catch (NumberFormatException e) { |
| | | ServerResponse.createByErrorMsg("请输入有效等级"); |
| | | } |
| | | } |
| | | int ref = stockConfigMapper.updateById(stockConfig); |
| | | if(ref>0){ |
| | | return ServerResponse.createBySuccess(); |
| | |
| | | </constructor> |
| | | </resultMap> |
| | | <sql id="Base_Column_List" > |
| | | id, agent_name, agent_pwd, agent_real_name, agent_phone, agent_code, add_time, is_lock, |
| | | id, agent_name, agent_pwd, agent_real_name, agent_phone, agent_code, add_time, is_lock, |
| | | parent_id, parent_name, agent_level,poundage_scale,deferred_fees_scale,receive_dividends_scale, |
| | | total_money,site_lever,on_line_services |
| | | </sql> |
| | |
| | | WHERE agent_code = #{agentCode} and id != #{id} |
| | | </select> |
| | | |
| | | <select id="findByParentId" resultMap="BaseResultMap" parameterType="java.lang.Integer"> |
| | | SELECT |
| | | <include refid="Base_Column_List"/> |
| | | FROM agent_user |
| | | WHERE parent_id = #{parentId} |
| | | </select> |
| | | |
| | | <select id="getParensAgent" resultMap="BaseResultMap"> |
| | | SELECT |
| | | <include refid="Base_Column_List"/> |
| | | FROM agent_user |
| | | WHERE agent_level = 0 or agent_level = 1 |
| | | </select> |
| | | |
| | | |
| | | <select id="findByPhone" resultMap="BaseResultMap" parameterType="string"> |
| | | SELECT |