| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 维权订单数 |
| | | * |
| | | * @param callback |
| | | * @param dateType |
| | | * @param year |
| | | * @param startTime |
| | | * @param endTime |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "getWeiQaunOrderNumber") |
| | | public void getWeiQaunOrderNumber(String callback, Integer dateType, String year, String startTime, String endTime, |
| | | PrintWriter out) { |
| | | |
| | | String validateMsg = AdminUtils.validateParams(dateType, startTime, endTime); |
| | | if (validateMsg != null) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(validateMsg)); |
| | | return; |
| | | } |
| | | |
| | | try { |
| | | JSONObject data = countWeiQaunOrder(dateType, year, startTime, endTime, 1); |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data)); |
| | | } catch (Exception e) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("系统异常")); |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 维权订单金额 |
| | | * |
| | | * @param callback |
| | | * @param dateType |
| | | * @param year |
| | | * @param startTime |
| | | * @param endTime |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "getWeiQaunOrderMoney") |
| | | public void getWeiQaunOrderMoney(String callback, Integer dateType, String year, String startTime, String endTime, |
| | | PrintWriter out) { |
| | | |
| | | String validateMsg = AdminUtils.validateParams(dateType, startTime, endTime); |
| | | if (validateMsg != null) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(validateMsg)); |
| | | return; |
| | | } |
| | | |
| | | try { |
| | | JSONObject data = countWeiQaunOrder(dateType, year, startTime, endTime, 2); |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data)); |
| | | } catch (Exception e) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("系统异常")); |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 统计红包信息 |
| | | * |
| | | * @param channelArray |
| | | * @param dateType |
| | | * @param state |
| | | * @param year |
| | | * @param startTime |
| | | * @param endTime |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public JSONObject countWeiQaunOrder(Integer dateType, String year, String startTime, String endTime, int countType) |
| | | throws Exception { |
| | | |
| | | if (dateType != 1 && (!StringUtil.isNullOrEmpty(startTime) || !StringUtil.isNullOrEmpty(endTime))) { |
| | | startTime = null; |
| | | endTime = null; |
| | | } |
| | | |
| | | if (dateType == 1 && year != null) { |
| | | year = null; // 设置为空 |
| | | } else if (dateType == 2) { |
| | | if (startTime != null) |
| | | startTime = null; |
| | | |
| | | if (endTime != null) |
| | | endTime = null; |
| | | |
| | | } else if (dateType == 3) { |
| | | if (year != null) |
| | | year = null; |
| | | |
| | | if (startTime != null) |
| | | startTime = null; |
| | | |
| | | if (endTime != null) |
| | | endTime = null; |
| | | } |
| | | |
| | | Gson gson = new Gson(); |
| | | Object objectDate = null; |
| | | List<String> dateList = AdminUtils.getDateList(dateType, startTime, endTime, year); |
| | | |
| | | JSONArray line_list = new JSONArray(); |
| | | List<ChartTDO> list = null; |
| | | if (countType == 1) { |
| | | list = commonOrderCountService.countWeiQaunOrderNumber(dateType, year, startTime, endTime); |
| | | } else if (countType == 2) { |
| | | list = commonOrderCountService.countWeiQaunOrderMoney(dateType, year, startTime, endTime); |
| | | } |
| | | |
| | | JSONObject innerList = new JSONObject(); |
| | | innerList.put("name", "总计"); |
| | | |
| | | if (dateType != 3) { |
| | | innerList.put("data", gson.toJson(AdminUtils.dayOrMonthDataFactory(dateType, dateList, list))); |
| | | } else { |
| | | // 年视图 |
| | | Map<String, Object> map = AdminUtils.yearsDataFactory(list); |
| | | |
| | | if (objectDate == null) { |
| | | objectDate = map.get("date"); |
| | | } |
| | | innerList.put("data", gson.toJson(map.get("value"))); |
| | | } |
| | | |
| | | line_list.add(innerList); |
| | | |
| | | JSONObject data = new JSONObject(); |
| | | if (objectDate != null) { |
| | | data.put("xAxis_list", gson.toJson(objectDate)); |
| | | } else { |
| | | data.put("xAxis_list", gson.toJson(dateList)); |
| | | } |
| | | |
| | | data.put("line_list", line_list); |
| | | |
| | | return data; |
| | | } |
| | | |
| | | @RequestMapping(value = "uploadTaoBaoWeiQuanOrder") |
| | | public void uploadWeiQuanOrder(String callback, HttpServletRequest request, PrintWriter out) { |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 订单跟踪准确率(板栗快省用户订单/淘宝联盟订单) |
| | | * |
| | | * @param callback |
| | | * @param dateType |
| | | * @param year |
| | | * @param startTime |
| | | * @param endTime |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "getTrackAccuracyRate") |
| | | public void getTrackAccuracyRate(String callback, Integer dateType, String year, String startTime, String endTime, |
| | | int sourceType, PrintWriter out) { |
| | | |
| | | if (dateType != 1 && (!StringUtil.isNullOrEmpty(startTime) || !StringUtil.isNullOrEmpty(endTime))) { |
| | | startTime = null; |
| | | endTime = null; |
| | | } |
| | | |
| | | if (dateType == 1 && year != null) { |
| | | year = null; // 设置为空 |
| | | } else if (dateType == 2) { |
| | | if (startTime != null) |
| | | startTime = null; |
| | | |
| | | if (endTime != null) |
| | | endTime = null; |
| | | |
| | | } else if (dateType == 3) { |
| | | if (year != null) |
| | | year = null; |
| | | |
| | | if (startTime != null) |
| | | startTime = null; |
| | | |
| | | if (endTime != null) |
| | | endTime = null; |
| | | } |
| | | |
| | | try { |
| | | |
| | | Gson gson = new Gson(); |
| | | Object objectDate = null; |
| | | List<String> dateList = AdminUtils.getDateList(dateType, startTime, endTime, year); |
| | | |
| | | JSONArray line_list = new JSONArray(); |
| | | |
| | | List<ChartTDO> list = commonOrderCountService.getTrackAccuracyRate(dateType, year, startTime, endTime, |
| | | sourceType); |
| | | |
| | | JSONObject innerList = new JSONObject(); |
| | | innerList.put("name", "总计"); |
| | | |
| | | if (dateType != 3) { |
| | | innerList.put("data", gson.toJson(AdminUtils.dayOrMonthDataFactory(dateType, dateList, list))); |
| | | } else { |
| | | // 年视图 |
| | | Map<String, Object> map = AdminUtils.yearsDataFactory(list); |
| | | |
| | | if (objectDate == null) { |
| | | objectDate = map.get("date"); |
| | | } |
| | | innerList.put("data", gson.toJson(map.get("value"))); |
| | | } |
| | | |
| | | line_list.add(innerList); |
| | | |
| | | JSONObject data = new JSONObject(); |
| | | if (objectDate != null) { |
| | | data.put("xAxis_list", gson.toJson(objectDate)); |
| | | } else { |
| | | data.put("xAxis_list", gson.toJson(dateList)); |
| | | } |
| | | |
| | | data.put("line_list", line_list); |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data)); |
| | | |
| | | } catch (Exception e) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常")); |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | import com.yeshi.fanli.entity.bus.msg.UserSystemMsgTypeEnum;
|
| | | import com.yeshi.fanli.entity.bus.user.ThreeSale;
|
| | | import com.yeshi.fanli.entity.bus.user.ThreeSaleExtraInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.UserExtraTaoBaoInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfoExtra;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInviteValidNum;
|
| | |
| | | import com.yeshi.fanli.service.inter.config.SpreadImgService;
|
| | | import com.yeshi.fanli.service.inter.config.SystemClientParamsService;
|
| | | import com.yeshi.fanli.service.inter.msg.UserSystemMsgService;
|
| | | import com.yeshi.fanli.service.inter.order.CommonOrderCountService;
|
| | | import com.yeshi.fanli.service.inter.push.PushService;
|
| | | import com.yeshi.fanli.service.inter.user.SpreadUserImgService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoExtraService;
|
| | |
| | | import com.yeshi.fanli.service.inter.user.invite.UserInviteService;
|
| | | import com.yeshi.fanli.service.inter.user.invite.UserInviteValidNumService;
|
| | | import com.yeshi.fanli.service.inter.user.invite.UserInviteValidRecordService;
|
| | | import com.yeshi.fanli.service.inter.user.tb.UserExtraTaoBaoInfoService;
|
| | | import com.yeshi.fanli.service.inter.user.vip.UserVIPInfoService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.RedisKeyEnum;
|
| | | import com.yeshi.fanli.util.RedisManager;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | | import com.yeshi.fanli.util.VersionUtil;
|
| | | import com.yeshi.fanli.util.annotation.RequestSerializableByKey;
|
| | | import com.yeshi.fanli.util.user.UserLevelUtil;
|
| | |
| | | @Resource
|
| | | private UserInviteValidNumService userInviteValidNumService;
|
| | |
|
| | | @Resource
|
| | | private UserExtraTaoBaoInfoService userExtraTaoBaoInfoService;
|
| | | |
| | | @Resource
|
| | | private CommonOrderCountService commonOrderCountService;
|
| | |
|
| | | /**
|
| | | * 邀请码验证
|
| | |
| | | }
|
| | |
|
| | | List<Long> listId = new ArrayList<Long>();
|
| | | |
| | | |
| | | |
| | | |
| | | long count = 0;
|
| | | List<ThreeSale> listTeam = null;
|
| | | if (type == 1) {
|
| | | listTeam = threeSaleSerivce.listFirstTeam((page - 1) * Constant.PAGE_SIZE, Constant.PAGE_SIZE, uid, listId);
|
| | | count = threeSaleSerivce.countFirstTeam(uid);
|
| | | count = threeSaleSerivce.countFirstTeam(uid, listId);
|
| | | } else if (type == 2) {
|
| | | listTeam = threeSaleSerivce.listSecondTeam((page - 1) * Constant.PAGE_SIZE, Constant.PAGE_SIZE, uid, listId);
|
| | | count = threeSaleSerivce.countSecondTeam(uid);
|
| | | count = threeSaleSerivce.countSecondTeam(uid, listId);
|
| | | }
|
| | |
|
| | | // 数据加工
|
| | |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
|
| | | |
| | | /**
|
| | | * 获取粉丝信息
|
| | | * @param acceptData
|
| | | * @param uid
|
| | | * @param workerId
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getFansInfo")
|
| | | public void getFansInfo(AcceptData acceptData,Long uid, Long workerId, PrintWriter out) {
|
| | | if (uid == null || workerId == null) {
|
| | | out.print(JsonUtil.loadFalseResult("用户id缺失"));
|
| | | return;
|
| | | }
|
| | | |
| | | ThreeSale threeSale = threeSaleSerivce.getByWorkerId(workerId);
|
| | | if (threeSale == null) {
|
| | | out.print(JsonUtil.loadFalseResult("邀请关系不存在"));
|
| | | return;
|
| | | }
|
| | | |
| | | UserInfo user = userInfoService.selectByPKey(workerId);
|
| | | if (user == null) {
|
| | | out.print(JsonUtil.loadFalseResult("用户不存在"));
|
| | | return;
|
| | | }
|
| | | |
| | | JSONArray tagArray = new JSONArray(); |
| | | String memoName = user.getNickName();
|
| | | Long succeedTime = threeSale.getSucceedTime();
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("nickName", user.getNickName());
|
| | | data.put("phone", user.getPhone());
|
| | | data.put("joinTime", TimeUtil.formatDate(succeedTime == null? threeSale.getCreateTime() : succeedTime));
|
| | | |
| | | ThreeSaleExtraInfo saleExtraInfo = threeSaleExtraInfoSerivce.getbyBossIdAndWorkerId(uid, workerId);
|
| | | if (saleExtraInfo != null) {
|
| | | if(!StringUtil.isNullOrEmpty(saleExtraInfo.getNickname())) {
|
| | | memoName = saleExtraInfo.getNickname();
|
| | | }
|
| | | String tags = saleExtraInfo.getTags();
|
| | | if (!StringUtil.isNullOrEmpty(tags)) {
|
| | | tagArray = JSONArray.fromObject(tags);
|
| | | }
|
| | | }
|
| | | data.put("memoName", memoName);
|
| | | data.put("tags", tagArray);
|
| | | |
| | | Date activeTime = null;
|
| | | String weixin = null;
|
| | | UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(workerId);
|
| | | if (userInfoExtra != null) {
|
| | | weixin = userInfoExtra.getWeiXin();
|
| | | activeTime = userInfoExtra.getActiveTime();
|
| | | }
|
| | | data.put("weixin", StringUtil.isNullOrEmpty(weixin)? "": weixin);
|
| | | data.put("loginTime", TimeUtil.formatDate(activeTime == null? userInfoExtra.getCreateTime():activeTime));
|
| | | |
| | | UserExtraTaoBaoInfo userExtraTaoBaoInfo = userExtraTaoBaoInfoService.getByUid(workerId);
|
| | | if (userExtraTaoBaoInfo != null && !StringUtil.isNullOrEmpty(userExtraTaoBaoInfo.getRelationId())
|
| | | && !StringUtil.isNullOrEmpty(userExtraTaoBaoInfo.getSpecialId())) {
|
| | | data.put("taobao", true);
|
| | | } else {
|
| | | data.put("taobao", false);
|
| | | }
|
| | | |
| | | long indirectNum = 0;
|
| | | long directNum = threeSaleSerivce.countFirstTeam(workerId);
|
| | | if (directNum > 0) {
|
| | | indirectNum = threeSaleSerivce.countSecondTeam(workerId);
|
| | | }
|
| | | data.put("directNum", directNum);
|
| | | data.put("indirectNum", indirectNum);
|
| | | |
| | | |
| | | long countTB = commonOrderCountService.countOrderBySourceAndNearDay(workerId, Constant.SOURCE_TYPE_TAOBAO, 60);
|
| | | long countJD = commonOrderCountService.countOrderBySourceAndNearDay(workerId, Constant.SOURCE_TYPE_JD, 60);
|
| | | long countPDD = commonOrderCountService.countOrderBySourceAndNearDay(workerId, Constant.SOURCE_TYPE_PDD, 60);
|
| | | |
| | | data.put("orderTB", countTB);
|
| | | data.put("orderJD", countJD);
|
| | | data.put("orderPDD", countPDD);
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | | |
| | | |
| | | /**
|
| | | * 获取粉丝信息
|
| | | * @param acceptData
|
| | | * @param uid
|
| | | * @param workerId
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "saveTags")
|
| | | public void saveTags(AcceptData acceptData,Long uid, Long workerId, String tags, PrintWriter out) {
|
| | | if (uid == null || workerId == null) {
|
| | | out.print(JsonUtil.loadFalseResult("用户id缺失"));
|
| | | return;
|
| | | }
|
| | | |
| | | ThreeSaleExtraInfo saleExtraInfo = threeSaleExtraInfoSerivce.getbyBossIdAndWorkerId(uid, workerId);
|
| | | if (saleExtraInfo != null) {
|
| | | ThreeSaleExtraInfo upObject = new ThreeSaleExtraInfo();
|
| | | upObject.setTags(tags);
|
| | | upObject.setId(saleExtraInfo.getId());
|
| | | upObject.setUpdateTime(new Date());
|
| | | threeSaleExtraInfoSerivce.updateByPrimaryKeySelective(upObject);
|
| | | } else {
|
| | | saleExtraInfo = new ThreeSaleExtraInfo();
|
| | | saleExtraInfo.setBoss(new UserInfo(uid));
|
| | | saleExtraInfo.setWorker(new UserInfo(workerId));
|
| | | saleExtraInfo.setTags(tags);
|
| | | saleExtraInfo.setCreateTime(new Date());
|
| | | threeSaleExtraInfoSerivce.insertSelective(saleExtraInfo);
|
| | | }
|
| | | out.print(JsonUtil.loadTrueResult("保存成功"));
|
| | | }
|
| | | }
|
| | |
| | | } else if (s > 0) {
|
| | | leftTime = s + "秒";
|
| | | leftTime = "还剩" + leftTime;
|
| | | } else {
|
| | | leftTime = "还剩0秒";
|
| | | }
|
| | | }
|
| | | json.put("leftTime", leftTime);
|
| | | |
| | | if (!StringUtil.isNullOrEmpty(callback)) {
|
| | | out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult(json)));
|
| | | } else {
|
| | |
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | long countFirstTeam(@Param("uid") Long uid);
|
| | | long countFirstTeam(@Param("uid") Long uid, @Param("listId")List<Long> listId);
|
| | |
|
| | | /**
|
| | | * 统计二级队员
|
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | long countSecondTeam(@Param("uid") Long uid);
|
| | | long countSecondTeam(@Param("uid") Long uid, @Param("listId")List<Long> listId);
|
| | |
|
| | |
|
| | | /**
|
| | |
| | | |
| | | List<Long> getDownOrderUserByListUidAndDate(@Param("preDay") Date preDay,@Param("list") List<Long> list); |
| | | |
| | | |
| | | /** |
| | | * 统计近 day天有效订单数量 |
| | | * @param uid |
| | | * @param source |
| | | * @param day |
| | | * @return |
| | | */ |
| | | Long countOrderBySourceAndNearDay(@Param("uid") Long uid, @Param("source") int source, @Param("day") int day); |
| | | |
| | | |
| | | } |
| | |
| | | SELECT * FROM `yeshi_ec_threesale` ts
|
| | | LEFT JOIN `yeshi_ec_threesale_extra_info` ff ON (ts.`boss_id` = ff.`tf_boss_id` AND ts.`worker_id`=ff.`tf_worker_id`)
|
| | | WHERE ts.`boss_id` = #{uid}
|
| | | <if test="listId != null and listId.size > 0">
|
| | | AND ts.worker_id in
|
| | | <foreach collection="listId" item="item" open="(" separator="," close=")">#{item}</foreach>
|
| | | </if>
|
| | | ORDER BY ts.createTime DESC
|
| | | LIMIT ${start},${count}
|
| | | </select>
|
| | |
| | | <select id="countFirstTeam" resultType="java.lang.Long">
|
| | | SELECT IFNULL(count(id),0) FROM `yeshi_ec_threesale`
|
| | | WHERE `boss_id` = #{uid}
|
| | | <if test="listId != null and listId.size > 0">
|
| | | AND worker_id in
|
| | | <foreach collection="listId" item="item" open="(" separator="," close=")">#{item}</foreach>
|
| | | </if>
|
| | | </select>
|
| | |
|
| | | <select id="listSecondTeam" resultMap="AllResultMap">
|
| | |
| | | LEFT JOIN yeshi_ec_threesale tf ON ts.`boss_id`= tf.`worker_id`
|
| | | WHERE tf.`boss_id` = #{uid})A
|
| | | LEFT JOIN yeshi_ec_threesale yet ON yet.id = A.id
|
| | | <if test="listId != null and listId.size > 0">
|
| | | WHERE yet.worker_id in
|
| | | <foreach collection="listId" item="item" open="(" separator="," close=")">#{item}</foreach>
|
| | | </if>
|
| | | ORDER BY yet.createTime DESC
|
| | | LIMIT ${start},${count}
|
| | | </select>
|
| | |
| | | SELECT DISTINCT(ts.`id`) AS id FROM `yeshi_ec_threesale` ts
|
| | | LEFT JOIN yeshi_ec_threesale tf ON ts.`boss_id`=tf.`worker_id`
|
| | | WHERE tf.`boss_id` = #{uid}
|
| | | <if test="listId != null and listId.size > 0">
|
| | | AND tf.worker_id in
|
| | | <foreach collection="listId" item="item" open="(" separator="," close=")">#{item}</foreach>
|
| | | </if>
|
| | | )A
|
| | | </select>
|
| | |
|
| | |
| | | </select> |
| | | |
| | | <select id="countOderByDate" resultType="Integer"> |
| | | SELECT COUNT(1) FROM (SELECT d.`co_id` FROM `yeshi_ec_common_order` d |
| | | SELECT COUNT(co_id) FROM (SELECT d.`co_id` FROM `yeshi_ec_common_order` d |
| | | WHERE TO_DAYS(d.`co_third_create_time`)= TO_DAYS(#{preDay}) AND (d.`co_state`=1 OR d.`co_state`=2) |
| | | GROUP BY d.`co_order_no`,d.`co_source_type`)A |
| | | </select> |
| | |
| | | limit 100)A where A.payment<![CDATA[<]]> 10 |
| | | </select> |
| | | |
| | | |
| | | <select id="countOrderBySourceAndNearDay" resultType="Long"> |
| | | SELECT COUNT(co_id) FROM (SELECT d.`co_id` FROM `yeshi_ec_common_order` d |
| | | WHERE d.co_uid = #{uid} AND d.`co_source_type` = #{source} AND (d.`co_state`=1 OR d.`co_state`=2) |
| | | AND DATE_SUB(CURDATE(), INTERVAL #{day} DAY) <![CDATA[<=]]> DATE(d.`co_third_create_time`) |
| | | GROUP BY d.`co_order_no`,d.`co_source_type`)A |
| | | </select> |
| | | </mapper> |
| | |
| | | package com.yeshi.fanli.service.impl.count; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.text.DecimalFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | |
| | | |
| | | |
| | | @Override |
| | | public List<ChartTDO> getTrackAccuracyRate(Integer dateType, String year, String startTime, String endTime, |
| | | int sourceType) throws Exception { |
| | | |
| | | List<ChartTDO> result_list = null; |
| | | |
| | | // 用户订单 |
| | | List<ChartTDO> listTotal = commonOrderCountMapper.countOrderNumber(dateType, year, startTime, endTime, |
| | | sourceType); |
| | | if (listTotal == null || listTotal.size() == 0) { |
| | | return result_list; |
| | | } |
| | | |
| | | // 淘宝联盟 |
| | | List<ChartTDO> type_list = null; |
| | | switch (sourceType) { |
| | | case Constant.SOURCE_TYPE_TAOBAO: |
| | | type_list = taoBaoOrderMapper.countOrderNumber(dateType, year, startTime, endTime); |
| | | break; |
| | | case Constant.SOURCE_TYPE_JD: |
| | | type_list = jdOrderItemMapper.countOrderNumber(dateType, year, startTime, endTime); |
| | | break; |
| | | case Constant.SOURCE_TYPE_PDD: |
| | | type_list = pddOrderMapper.countOrderNumber(dateType, year, startTime, endTime); |
| | | break; |
| | | } |
| | | if (type_list == null || type_list.size() == 0) { |
| | | return null; |
| | | } |
| | | |
| | | switch (dateType) { |
| | | case 1: // 按天处理 |
| | | result_list = dayFactory(startTime, endTime, type_list); |
| | | break; |
| | | case 2: // 按月处理 |
| | | result_list = monthFactory(type_list); |
| | | break; |
| | | case 3: |
| | | result_list = yearFactory(type_list); |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | |
| | | DecimalFormat df = new DecimalFormat("#.00"); |
| | | |
| | | for (int i = 0; i < result_list.size(); i++) { |
| | | double proportion = 0; |
| | | ChartTDO chartTDO = result_list.get(i); |
| | | String showDate = chartTDO.getShowDate(); |
| | | for (int j = 0; j < listTotal.size(); j++) { |
| | | ChartTDO innerChartTDO = listTotal.get(j); |
| | | String innerDate = innerChartTDO.getShowDate(); |
| | | if (innerDate != null && innerDate.toString().equals(showDate.toString())) { |
| | | String innerValue = innerChartTDO.getShowValue(); |
| | | long innerData = Long.parseLong(innerValue); |
| | | |
| | | String showValue = chartTDO.getShowValue(); |
| | | long showData = Long.parseLong(showValue); |
| | | |
| | | if (showData > 0) { |
| | | proportion = innerData / (double) showData; |
| | | } |
| | | break; // 结束内部循环 |
| | | } |
| | | } |
| | | chartTDO.setShowValue(Double.parseDouble(df.format(proportion * 100)) + ""); |
| | | } |
| | | |
| | | return result_list; |
| | | } |
| | | |
| | | @Override |
| | | public Long countOrderBySourceTypeAndDay(int source, String preDay) { |
| | | return commonOrderCountMapper.countOrderBySourceTypeAndDay(preDay, source); |
| | | } |
| | | |
| | | @Override |
| | | public long countOrderBySourceAndNearDay(Long uid, int source, int day) { |
| | | Long count = commonOrderCountMapper.countOrderBySourceAndNearDay(uid, source, day); |
| | | if (count == null) { |
| | | count = 0L; |
| | | } |
| | | return count; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | if (list == null) {
|
| | | list = new ArrayList<ThreeSale>();
|
| | | }
|
| | | long countTotal = threeSaleMapper.countFirstTeam(uid);
|
| | | long countTotal = threeSaleMapper.countFirstTeam(uid, null);
|
| | | return organizeTeam(countTotal, list);
|
| | | }
|
| | |
|
| | |
| | | if (list == null) {
|
| | | list = new ArrayList<ThreeSale>();
|
| | | }
|
| | | long countTotal = threeSaleMapper.countSecondTeam(uid);
|
| | | long countTotal = threeSaleMapper.countSecondTeam(uid, null);
|
| | | return organizeTeam(countTotal, list);
|
| | | }
|
| | |
|
| | |
| | | return threeSaleMapper.listSecondTeam(start, count, uid, listId);
|
| | | }
|
| | |
|
| | | |
| | | @Override
|
| | | public long countFirstTeam(Long uid) {
|
| | | return threeSaleMapper.countFirstTeam(uid);
|
| | | return threeSaleMapper.countFirstTeam(uid, null);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public long countSecondTeam(Long uid) {
|
| | | return threeSaleMapper.countSecondTeam(uid);
|
| | | return threeSaleMapper.countSecondTeam(uid, null);
|
| | | }
|
| | | |
| | | @Override
|
| | | public long countFirstTeam(Long uid, List<Long> listId) {
|
| | | return threeSaleMapper.countFirstTeam(uid, listId);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public long countSecondTeam(Long uid, List<Long> listId) {
|
| | | return threeSaleMapper.countSecondTeam(uid, listId);
|
| | | }
|
| | |
|
| | | @Override
|
| | |
| | | */ |
| | | public Integer countOderByUidAndLess10(Long uid); |
| | | |
| | | /** |
| | | * 统计所有订单 |
| | | * |
| | | * @param channel |
| | | * @return |
| | | */ |
| | | public List<ChartTDO> getTrackAccuracyRate(Integer dateType, String year, String startTime, String endTime, |
| | | int sourceType) throws Exception; |
| | | |
| | | |
| | | public Long countOrderBySourceTypeAndDay(int source, String preDay); |
| | |
| | | * @return |
| | | */ |
| | | public List<Long> getUidByValidOrderByDay(String preDay); |
| | | |
| | | |
| | | /** |
| | | * 统计最近day天有效订单数量 |
| | | * @param uid |
| | | * @param source |
| | | * @param day |
| | | * @return |
| | | */ |
| | | public long countOrderBySourceAndNearDay(Long uid, int source, int day); |
| | | } |
| | |
| | | */
|
| | | public List<ThreeSale> listSecondTeam(long start, int count, Long uid, List<Long> listId);
|
| | |
|
| | | public long countFirstTeam(Long uid);
|
| | |
|
| | | public long countSecondTeam(Long uid);
|
| | | |
| | | /**
|
| | | * 统计直接粉丝数量
|
| | | *
|
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | public long countFirstTeam(Long uid);
|
| | | public long countFirstTeam(Long uid, List<Long> listId);
|
| | |
|
| | | /**
|
| | | * 统计间接粉丝数量
|
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | public long countSecondTeam(Long uid);
|
| | | public long countSecondTeam(Long uid, List<Long> listId);
|
| | |
|
| | | /**
|
| | | * 查询邀请关系 时间筛选
|
| | |
| | | */
|
| | | public Long getTopBoss(Long uid);
|
| | |
|
| | |
|
| | | }
|