Merge remote-tracking branch 'origin/master'
Conflicts:
fanli/src/main/java/com/yeshi/fanli/controller/apph5/AppH5UserRankingsController.java
| | |
| | | @Resource
|
| | | private AdminUserService adminUserService;
|
| | |
|
| | |
|
| | | @Resource
|
| | | private RedisManager redisManager;
|
| | |
|
| | |
| | |
|
| | | @Resource
|
| | | private TaoBaoWeiQuanOrderService taoBaoWeiQuanOrderService;
|
| | | |
| | |
|
| | | private final static String TODAY = "1";
|
| | | private final static String THREE = "2";
|
| | |
| | | if (extract != null) {
|
| | | UserInfo userInfo = extract.getUserInfo();
|
| | | Long id = userInfo.getId();
|
| | | countByUid = hongBaoService.getCountByUid(id);
|
| | | countByUid = hongBaoV2CountService.countNumberByUid(id);
|
| | | countCancel = hongBaoV2CountService.countNumberByUidAndState(id, HongBaoV2.STATE_SHIXIAO);
|
| | | }
|
| | | extractAuditRecord.setCancelOrderNum((long) countCancel);
|
| | |
| | |
|
| | | import com.google.gson.Gson;
|
| | | import com.google.gson.GsonBuilder;
|
| | | import com.yeshi.fanli.entity.bus.user.HongBao;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.UserRankings;
|
| | | import com.yeshi.fanli.service.inter.count.HongBaoV2CountService;
|
| | | import com.yeshi.fanli.service.inter.user.UserRankingsService;
|
| | | import com.yeshi.fanli.vo.order.HongBaoV2VO;
|
| | |
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | |
| | |
|
| | | @Resource
|
| | | private HongBaoV2CountService hongBaoV2CountService;
|
| | |
|
| | |
|
| | | /**
|
| | | * 返利券排行榜
|
| | | * @param callback
|
| | |
| | | String defaultDate = sdf.format(calendar.getTime()); //格式化前一天
|
| | |
|
| | | // 真实用户
|
| | | List<HongBao> listHongBao = hongBaoService.listShareAndInviteMoney(0, 50, defaultDate);
|
| | | List<HongBaoV2VO> listHongBao = hongBaoV2CountService.listShareAndInviteMoney(0, 50, defaultDate);
|
| | | if (listHongBao != null && listHongBao.size() > 0) {
|
| | | HongBao hongBao = listHongBao.get(0);
|
| | | BigDecimal maxMoney = hongBao.getShareAndInviteMoney();
|
| | | HongBaoV2VO hongBao = listHongBao.get(0);
|
| | | BigDecimal maxMoney = hongBao.getTotalMoney();
|
| | |
|
| | | UserRankings userRankings = userRankingsList.get(userRankingsList.size()-1);
|
| | | BigDecimal mminMoney = userRankings.getTradeReward();
|
| | |
|
| | | // 真实数据大于最低金额
|
| | | if (maxMoney.compareTo(mminMoney) > 0 ) {
|
| | | for (HongBao hb: listHongBao) {
|
| | | BigDecimal rewardMoney = hb.getShareAndInviteMoney();
|
| | | for (HongBaoV2VO hb: listHongBao) {
|
| | | BigDecimal rewardMoney = hb.getTotalMoney();
|
| | |
|
| | | // 奖金高到低排序,不满足结束循环
|
| | | if (rewardMoney.compareTo(mminMoney) <= 0 ) {
|
| | |
| | | Integer countNumberByUidAndState(@Param("uid")Long uid, @Param("state") Integer state); |
| | | |
| | | /** |
| | | * 统计用户总的红包数量 |
| | | * @param uid |
| | | * @return |
| | | */ |
| | | Long countNumberByUid(@Param("uid")Long uid); |
| | | |
| | | /** |
| | | * 统计总金额 |
| | | * @param channel 渠道 |
| | | * @param type |
| | |
| | | ORDER BY t.`hb_create_time` |
| | | </select> |
| | | |
| | | <select id="countNumberByUid" resultType="java.lang.Long"> |
| | | select count(hb_id) from yeshi_ec_hongbao_v2 where hb_uid=#{0} |
| | | </select> |
| | | |
| | | |
| | | |
| | | |
| | | <select id="countHongBaoType" resultType="java.util.HashMap"> |
| | | SELECT COUNT(t.`hb_id`)AS showValue,<include refid="Column_DateType"/> |
| | |
| | | import com.yeshi.fanli.service.inter.count.HongBaoV2CountService;
|
| | | import com.yeshi.fanli.service.inter.order.CommonOrderService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoService;
|
| | | import com.yeshi.fanli.vo.order.HongBaoV2VO;
|
| | |
|
| | | @Service
|
| | | public class HongBaoV2CountServiceImpl implements HongBaoV2CountService {
|
| | |
| | | @Resource
|
| | | private TaoBaoWeiQuanOrderMapper taoBaoWeiQuanOrderMapper;
|
| | |
|
| | | |
| | | |
| | | public List<Map<String, Object>> dayFactory(String startTime, String endTime, List<Map<String, Object>> list) throws Exception {
|
| | | public List<Map<String, Object>> dayFactory(String startTime, String endTime, List<Map<String, Object>> list)
|
| | | throws Exception {
|
| | |
|
| | | List<Map<String, Object>> listObject = new ArrayList<Map<String, Object>>();
|
| | |
|
| | |
| | | return listObject;
|
| | | }
|
| | |
|
| | | |
| | | @Override
|
| | | public List<Map<String, Object>> countHongBaoMoney(String channel, Integer dateType, Integer state, |
| | | String year, String startTime, String endTime) throws Exception {
|
| | | public List<Map<String, Object>> countHongBaoMoney(String channel, Integer dateType, Integer state, String year,
|
| | | String startTime, String endTime) throws Exception {
|
| | | return hongBaoV2CountMapper.countHongBaoMoney(channel, dateType, state, year, startTime, endTime);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<Map<String, Object>> countHongBaoNum(String channel, Integer dateType, Integer state, |
| | | String year, String startTime, String endTime) throws Exception {
|
| | | public List<Map<String, Object>> countHongBaoNum(String channel, Integer dateType, Integer state, String year,
|
| | | String startTime, String endTime) throws Exception {
|
| | | return hongBaoV2CountMapper.countHongBaoNum(channel, dateType, state, year, startTime, endTime);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<Map<String, Object>> countHongBaoType(Integer dateType, Integer type, String year,
|
| | | String startTime, String endTime) throws Exception {
|
| | | public List<Map<String, Object>> countHongBaoType(Integer dateType, Integer type, String year, String startTime,
|
| | | String endTime) throws Exception {
|
| | | return hongBaoV2CountMapper.countHongBaoType(dateType, type, year, startTime, endTime);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<Map<String, Object>> getProportionByType(Integer dateType, Integer type, String year,
|
| | | String startTime, String endTime) throws Exception {
|
| | | public List<Map<String, Object>> getProportionByType(Integer dateType, Integer type, String year, String startTime,
|
| | | String endTime) throws Exception {
|
| | |
|
| | | List<Map<String, Object>> result_list = null;
|
| | |
|
| | | List<Map<String, Object>> listTotal = hongBaoV2CountMapper.countHongBaoTotalNum(dateType, year, startTime, endTime);
|
| | | List<Map<String, Object>> listTotal = hongBaoV2CountMapper.countHongBaoTotalNum(dateType, year, startTime,
|
| | | endTime);
|
| | | if (listTotal == null || listTotal.size() == 0) {
|
| | | return result_list;
|
| | | }
|
| | |
|
| | | List<Map<String, Object>> type_list = hongBaoV2CountMapper.countHongBaoType(dateType, type,
|
| | | year, startTime, endTime);
|
| | | List<Map<String, Object>> type_list = hongBaoV2CountMapper.countHongBaoType(dateType, type, year, startTime,
|
| | | endTime);
|
| | |
|
| | | if (type_list == null || type_list.size() == 0) {
|
| | | return null;
|
| | |
| | | default:
|
| | | break;
|
| | | }
|
| | | |
| | |
|
| | | for (int i = 0; i < result_list.size(); i++) {
|
| | |
|
| | |
| | | return hongBaoV2CountMapper.getLastHongBaoTime(uid);
|
| | | }
|
| | |
|
| | | |
| | | @Override
|
| | | public List<Map<String, Object>> count24HOderByChannel(String channel, Integer type, String years,
|
| | | String startTime, String endTime) throws Exception{
|
| | | public List<Map<String, Object>> count24HOderByChannel(String channel, Integer type, String years, String startTime,
|
| | | String endTime) throws Exception {
|
| | | return hongBaoV2CountMapper.count24HOderByChannel(channel, type, years, startTime, endTime);
|
| | | }
|
| | | |
| | |
|
| | | @Override
|
| | | public List<HongBaoV2VO> listShareAndInviteMoney(long start, int count, String date) {
|
| | | return hongBaoV2CountMapper.listShareAndInviteMoney(start, count, date);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public Integer countNumberByUid(Long uid) {
|
| | | long count = hongBaoV2CountMapper.countNumberByUid(uid);
|
| | | return (int) count;
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | import com.yeshi.fanli.service.inter.count.HongBaoV2CountService;
|
| | | import com.yeshi.fanli.service.inter.user.UserRankingsService;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.vo.order.HongBaoV2VO;
|
| | |
|
| | | @Service
|
| | | public class UserRankingsServiceImpl implements UserRankingsService {
|
| | |
| | |
|
| | | import com.yeshi.fanli.vo.order.HongBaoV2VO;
|
| | |
|
| | |
|
| | | public interface HongBaoV2CountService {
|
| | |
|
| | | /**
|
| | | * 统计历史总到账金额
|
| | | * |
| | | * @param uid
|
| | | * @param state
|
| | | * @return
|
| | |
| | |
|
| | | /**
|
| | | * 统计历史红包数量
|
| | | * |
| | | * @param uid
|
| | | * @param state
|
| | | * @return
|
| | |
| | | public Integer countNumberByUidAndState(Long uid, Integer state);
|
| | |
|
| | | /**
|
| | | * 统计用户红包数量
|
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | public Integer countNumberByUid(Long uid);
|
| | |
|
| | | /**
|
| | | * 统计总金额
|
| | | * @param channel 渠道
|
| | | * @param dateType 日期格式 日-1 月-2 年-3
|
| | | * @param state 状态
|
| | | * @param years 年份
|
| | | * @param startTime 开始时间
|
| | | * @param endTime 结束时间
|
| | | * |
| | | * @param channel
|
| | | * 渠道
|
| | | * @param dateType
|
| | | * 日期格式 日-1 月-2 年-3
|
| | | * @param state
|
| | | * 状态
|
| | | * @param years
|
| | | * 年份
|
| | | * @param startTime
|
| | | * 开始时间
|
| | | * @param endTime
|
| | | * 结束时间
|
| | | * @return
|
| | | */
|
| | | public List<Map<String, Object>> countHongBaoMoney(String channel, Integer dateType, Integer state, String year,
|
| | |
| | |
|
| | | /**
|
| | | * 统计总金额
|
| | | * @param channel 渠道
|
| | | * @param dateType 日期格式 日-1 月-2 年-3
|
| | | * @param state 状态
|
| | | * @param years 年份
|
| | | * @param startTime 开始时间
|
| | | * @param endTime 结束时间
|
| | | * |
| | | * @param channel
|
| | | * 渠道
|
| | | * @param dateType
|
| | | * 日期格式 日-1 月-2 年-3
|
| | | * @param state
|
| | | * 状态
|
| | | * @param years
|
| | | * 年份
|
| | | * @param startTime
|
| | | * 开始时间
|
| | | * @param endTime
|
| | | * 结束时间
|
| | | * @return
|
| | | */
|
| | | public List<Map<String, Object>> countHongBaoNum(String channel, Integer dateType, Integer state, String year,
|
| | |
| | |
|
| | | /**
|
| | | * 分类型订单数与比例
|
| | | * |
| | | * @param dateType
|
| | | * @param type
|
| | | * @param year
|
| | |
| | |
|
| | | /**
|
| | | * 统计提成订单数量
|
| | | * |
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | public int getTotalTiChengCount(Long uid);
|
| | |
|
| | | |
| | | /**
|
| | | * 统计未失效订单数量
|
| | | * |
| | | * @param uid
|
| | | * @param dateType
|
| | | * @return
|
| | | */
|
| | | public long countValidNumberByUid(Long uid, Integer dateType);
|
| | |
|
| | | |
| | | /**
|
| | | * 统计未到账金额
|
| | | * |
| | | * @param uid
|
| | | * @param dateType
|
| | | * @return
|
| | |
| | |
|
| | | /**
|
| | | * 最后一次下单时间
|
| | | * |
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | |
| | |
|
| | | /**
|
| | | * 统计所有类型订单数量
|
| | | * |
| | | * @param dateType
|
| | | * @param type
|
| | | * @param year
|
| | |
| | |
|
| | | /**
|
| | | * 查询邀请=分享奖金
|
| | | * |
| | | * @param start
|
| | | * @param count
|
| | | * @param date
|