| | |
| | | import org.springframework.web.bind.annotation.RequestMethod;
|
| | | import org.yeshi.utils.DateUtil;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | | import org.yeshi.utils.encrypt.DESUtil;
|
| | |
|
| | | import com.yeshi.fanli.entity.AppVersionInfo;
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.bus.user.UserExtraTaoBaoInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.exception.order.CommonOrderException;
|
| | | import com.yeshi.fanli.service.inter.config.AppVersionService;
|
| | | import com.yeshi.fanli.service.inter.config.ConfigService;
|
| | | import com.yeshi.fanli.service.inter.count.HongBaoV2CountService;
|
| | | import com.yeshi.fanli.service.inter.order.CommonOrderService;
|
| | | import com.yeshi.fanli.service.inter.user.UserExtraTaoBaoInfoService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoExtraService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoService;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.account.UserUtil;
|
| | | import com.yeshi.fanli.vo.order.CommonOrderVO;
|
| | | import com.yeshi.fanli.vo.user.UserInfoExtraVO;
|
| | |
| | | @Resource
|
| | | private HongBaoV2CountService hongBaoV2CountService;
|
| | |
|
| | | @Resource
|
| | | private UserExtraTaoBaoInfoService userExtraTaoBaoInfoService;
|
| | |
|
| | | /**
|
| | | * 订单列表
|
| | | * |
| | | * @param acceptData
|
| | | * @param page
|
| | | * @param uid
|
| | | * @param state 状态:1-未到账 2-已到账 3-已失效
|
| | | * @param type 类型:1-返利订单 2-分享订单 3-邀请订单
|
| | | * @param orderState 1有效订单 2 维权订单 3失效订单
|
| | | * @param orderNo 订单号 |
| | | * @param startTime 起始时间
|
| | | * @param endTime 结束时间
|
| | | * @param slotTime 时间段:1-最近三天 2-最近七天 3最近半月 4本月 5近三月 6近半年
|
| | | * @param dateType 1-今日 2-昨天 3-本月 4-上个月 |
|
| | | * @param state
|
| | | * 状态:1-未到账 2-已到账 3-已失效
|
| | | * @param type
|
| | | * 类型:1-返利订单 2-分享订单 3-邀请订单
|
| | | * @param orderState
|
| | | * 1有效订单 2 维权订单 3失效订单
|
| | | * @param orderNo
|
| | | * 订单号
|
| | | * @param startTime
|
| | | * 起始时间
|
| | | * @param endTime
|
| | | * 结束时间
|
| | | * @param slotTime
|
| | | * 时间段:1-最近三天 2-最近七天 3最近半月 4本月 5近三月 6近半年
|
| | | * @param dateType
|
| | | * 1-今日 2-昨天 3-本月 4-上个月 |
|
| | | * @param needCount
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getorder", method = RequestMethod.POST)
|
| | | public void getOrder(AcceptData acceptData, Integer page, Long uid, Integer state, Integer type, |
| | | Integer orderState,String orderNo, String startTime, String endTime, Integer slotTime,
|
| | | boolean needCount, Integer dateType, PrintWriter out) {
|
| | | public void getOrder(AcceptData acceptData, Integer page, Long uid, Integer state, Integer type, Integer orderState,
|
| | | String orderNo, String startTime, String endTime, Integer slotTime, boolean needCount, Integer dateType,
|
| | | PrintWriter out) {
|
| | |
|
| | | if (uid == null) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "用户未登录"));
|
| | |
| | | long todayTotal = 0;
|
| | | BigDecimal todayMoney = null;
|
| | |
|
| | | |
| | | // 查询列表
|
| | | List<CommonOrderVO> list = commonOrderService.getOrderByUid(page, uid, state, type, orderState,
|
| | | orderNo, startTime, endTime, dateType);
|
| | | List<CommonOrderVO> list = commonOrderService.getOrderByUid(page, uid, state, type, orderState, orderNo,
|
| | | startTime, endTime, dateType);
|
| | |
|
| | | if (list != null && list.size() > 0) {
|
| | | // 统计总数
|
| | | count = commonOrderService.countGroupOrderNoByUid(uid, state, type, orderState, orderNo, |
| | | startTime, endTime, dateType);
|
| | | count = commonOrderService.countGroupOrderNoByUid(uid, state, type, orderState, orderNo, startTime,
|
| | | endTime, dateType);
|
| | | }
|
| | |
|
| | | // 需要统计筛选信息 :未失效的总金额 以及订单
|
| | |
| | |
|
| | | todayTotal = commonOrderService.countBonusOrderNumber(uid, type, dateType, startTime, endTime);
|
| | |
|
| | | |
| | | // 统计有效的订单数量 、 失效订单数量 、维权订单数量
|
| | | Map<String, BigDecimal> countOrder = commonOrderService.countByUidAndOrderState(uid, type, |
| | | startTime, endTime, dateType);
|
| | | Map<String, BigDecimal> countOrder = commonOrderService.countByUidAndOrderState(uid, type, startTime,
|
| | | endTime, dateType);
|
| | |
|
| | | if (countOrder.get("totalValid") != null) {
|
| | | totalValid = countOrder.get("totalValid").intValue();
|
| | |
| | | if (todayMoney == null) {
|
| | | todayMoney = new BigDecimal(0.00);
|
| | | }
|
| | | |
| | |
|
| | | String helpUrl = configService.get("order_list_help");
|
| | |
|
| | |
| | |
|
| | | /**
|
| | | * 用户订单统计
|
| | | * |
| | | * @param acceptData
|
| | | * @param uid 用户id
|
| | | * @param uid
|
| | | * 用户id
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "countorder", method = RequestMethod.POST)
|
| | |
| | | if (versionInfo != null) {
|
| | | int versionCode150 = versionInfo.getVersionCode();
|
| | | if (versionCode >= versionCode150) {
|
| | | UserInfoExtraVO userInfoExtra = userInfoExtraService.getInfoExtraVOByUid(user.getId()); if (userInfoExtra != null && userInfoExtra.getUserRank() != null) {
|
| | | UserInfoExtraVO userInfoExtra = userInfoExtraService.getInfoExtraVOByUid(user.getId());
|
| | | if (userInfoExtra != null && userInfoExtra.getUserRank() != null) {
|
| | | String picture = userInfoExtra.getUserRank().getPicture();
|
| | | String icon = userInfoExtra.getUserRank().getIcon();
|
| | |
|
| | |
| | | }
|
| | |
|
| | | }
|
| | | |
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("userInfo", userInfo);
|
| | |
| | |
|
| | | /**
|
| | | * 统计奖金
|
| | | * |
| | | * @param acceptData
|
| | | * @param uid
|
| | | * @param out
|
| | |
| | | Object inviteCount = 0;
|
| | | BigDecimal inviteMoney = new BigDecimal(0.00);
|
| | |
|
| | | Map<String, Object> shareMap = commonOrderService.countBonusOrderMoneyAndNumber(uid, 2 , dateType, null, null);
|
| | | Map<String, Object> shareMap = commonOrderService.countBonusOrderMoneyAndNumber(uid, 2, dateType, null,
|
| | | null);
|
| | | if (shareMap != null) {
|
| | | Object totalNum = shareMap.get("totalNum");
|
| | | if (totalNum != null) {
|
| | |
| | | }
|
| | |
|
| | | // 邀请统计
|
| | | Map<String, Object> inviteMap = commonOrderService.countBonusOrderMoneyAndNumber(uid, 3 , dateType, null, null);
|
| | | Map<String, Object> inviteMap = commonOrderService.countBonusOrderMoneyAndNumber(uid, 3, dateType, null,
|
| | | null);
|
| | | if (inviteMap != null) {
|
| | | Object totalNum = inviteMap.get("totalNum");
|
| | | if (totalNum != null) {
|
| | |
| | | inviteMoney = (BigDecimal) totalmoney;
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("shareCount", shareCount);
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * 上传解析到的淘宝订单
|
| | | * |
| | | * @param acceptData
|
| | | * @param uid
|
| | | * @param orderData
|
| | | * @param source
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "uploadParsedOrder", method = RequestMethod.POST)
|
| | | public void uploadParsedOrder(AcceptData acceptData, Long uid, String orderData, String source, PrintWriter out) {
|
| | | if (uid == null || StringUtil.isNullOrEmpty(orderData)) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "数据错误"));
|
| | | return;
|
| | | }
|
| | | String orderId = null;
|
| | | try {
|
| | | orderId = DESUtil.decode(orderData, StringUtil.getBase64String("YeShiFANLI889*+"),
|
| | | StringUtil.getBase64String("*M#34f?,"));
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | if (!StringUtil.isNullOrEmpty(orderId) && orderId.length() > 6) {
|
| | | orderId = orderId.substring(orderId.length() - 6, orderId.length());
|
| | | UserExtraTaoBaoInfo info = userExtraTaoBaoInfoService.getByUid(uid);
|
| | | if (info != null && !StringUtil.isNullOrEmpty(info.getTaoBaoUid())) {
|
| | | userExtraTaoBaoInfoService.bindTaoBaoOrderEnd6Num(info.getTaoBaoUid(), orderId);
|
| | | }
|
| | | }
|
| | | out.print(JsonUtil.loadTrueResult(""));
|
| | | }
|
| | |
|
| | | /**
|
| | | * 时间转换
|
| | | * |
| | | * @param slotTime
|
| | | * @param startTime
|
| | | * @return
|