| | |
| | | import java.text.SimpleDateFormat;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Date;
|
| | | import java.util.HashMap;
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | |
| | | import org.yeshi.utils.NumberUtil;
|
| | |
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.bus.user.HongBaoV2;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.vip.UserLevelEnum;
|
| | | import com.yeshi.fanli.entity.order.CommonOrder;
|
| | | import com.yeshi.fanli.entity.order.CommonOrderGoods;
|
| | | import com.yeshi.fanli.entity.order.ESOrder;
|
| | | import com.yeshi.fanli.entity.order.HongBaoOrder;
|
| | | import com.yeshi.fanli.entity.order.InviteOrderSubsidy;
|
| | | import com.yeshi.fanli.entity.order.OrderTeamReward;
|
| | | import com.yeshi.fanli.entity.system.ConfigKeyEnum;
|
| | |
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.config.ConfigService;
|
| | | import com.yeshi.fanli.service.inter.count.HongBaoV2CountService;
|
| | | import com.yeshi.fanli.service.inter.order.CommonOrderGoodsService;
|
| | | import com.yeshi.fanli.service.inter.order.CommonOrderService;
|
| | | import com.yeshi.fanli.service.inter.order.ESOrderService;
|
| | | import com.yeshi.fanli.service.inter.order.HongBaoOrderService;
|
| | | import com.yeshi.fanli.service.inter.order.InviteOrderSubsidyServiceV2;
|
| | | import com.yeshi.fanli.service.inter.order.OrderHongBaoMoneyComputeService;
|
| | | import com.yeshi.fanli.service.inter.order.OrderTeamRewardService;
|
| | | import com.yeshi.fanli.service.inter.user.UserCustomSettingsService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoExtraService;
|
| | |
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.VersionUtil;
|
| | | import com.yeshi.fanli.util.account.UserUtil;
|
| | | import com.yeshi.fanli.util.user.UserLevelUtil;
|
| | | import com.yeshi.fanli.vo.order.CommonOrderVO;
|
| | | import com.yeshi.fanli.vo.order.GoodsRebateVO;
|
| | | import com.yeshi.fanli.vo.order.OrderCountVO;
|
| | |
| | | @Resource
|
| | | private InviteOrderSubsidyServiceV2 inviteOrderSubsidyServiceV2;
|
| | |
|
| | | @Resource
|
| | | private HongBaoOrderService hongBaoOrderService;
|
| | |
|
| | | @Resource
|
| | | private OrderHongBaoMoneyComputeService orderHongBaoMoneyComputeService;
|
| | |
|
| | | @Resource
|
| | | private CommonOrderGoodsService commonOrderGoodsService;
|
| | |
|
| | | /**
|
| | | * 订单列表
|
| | | *
|
| | |
| | | */
|
| | | @RequestMapping(value = "getOrderList", method = RequestMethod.POST)
|
| | | public void getOrderList(AcceptData acceptData, Integer page, Long uid, Integer state, String type,
|
| | | Integer orderState, String orderNo, String startTime, String endTime, Integer slotTime, |
| | | Integer dateType, Integer goodsType, String source, PrintWriter out) {
|
| | | Integer orderState, String orderNo, String startTime, String endTime, Integer slotTime, Integer dateType,
|
| | | Integer goodsType, String source, PrintWriter out) {
|
| | | if (uid == null) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "用户未登录"));
|
| | | return;
|
| | |
| | | page = 1;
|
| | |
|
| | | // 搜索内容、订单号
|
| | | if (!StringUtil.isNullOrEmpty(orderNo) && VersionUtil.greaterThan_2_0_6(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | | if (!StringUtil.isNullOrEmpty(orderNo)
|
| | | && VersionUtil.greaterThan_2_0_6(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | | searchOrder(acceptData, orderNo, page, uid, out);
|
| | | return;
|
| | | }
|
| | |
| | | }
|
| | |
|
| | | // 查询列表
|
| | | List<CommonOrderVO> list = commonOrderService.getOrderByUid(acceptData, page, uid, state, orderType, orderState,
|
| | | orderNo, startTime, endTime, dateType, listSource);
|
| | | List<CommonOrderVO> list = commonOrderService.getOrderByUid(acceptData, page, uid, state, orderType,
|
| | | orderState, orderNo, startTime, endTime, dateType, listSource);
|
| | | // 统计总数
|
| | | long count = commonOrderService.countGroupOrderNoByUid(uid, state, orderType, orderState, orderNo, startTime,
|
| | | endTime, dateType, listSource);
|
| | | long count = commonOrderService.countGroupOrderNoByUid(uid, state, orderType, orderState, orderNo,
|
| | | startTime, endTime, dateType, listSource);
|
| | |
|
| | | // 判断是否需要显示订单找回提示 8秒内请求3次触发
|
| | | String orderFindUrl = null;
|
| | |
| | | long count = 0;
|
| | | List<CommonOrderVO> list = null;
|
| | | if (NumberUtil.isNumeric(key.replace("-", ""))) {
|
| | | list = commonOrderService.getOrderByUid(acceptData, page, uid, null, null, null, key, null, null, null, null);
|
| | | list = commonOrderService.getOrderByUid(acceptData, page, uid, null, null, null, key, null, null, null,
|
| | | null);
|
| | | }
|
| | |
|
| | | if (list == null || list.size() == 0) {
|
| | |
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | | /**
|
| | | * 用户订单统计
|
| | |
| | | }
|
| | | }
|
| | |
|
| | |
|
| | | /**
|
| | | * 统计奖金
|
| | | * @param acceptData
|
| | |
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
|
| | | |
| | | /**
|
| | | * 团队收益统计 统计已到账未到账 : 累计只统计已到账
|
| | | * @param acceptData
|
| | |
| | | data.put("portrait", user.getPortrait());
|
| | |
|
| | | // 今日统计
|
| | | BigDecimal todayDirect = inviteOrderSubsidyServiceV2.sumValidMoneyByUidAndDate(uid, 1, InviteOrderSubsidy.LEVEL_ONE);
|
| | | BigDecimal todayDirect = inviteOrderSubsidyServiceV2.sumValidMoneyByUidAndDate(uid, 1,
|
| | | InviteOrderSubsidy.LEVEL_ONE);
|
| | | if (todayDirect == null) {
|
| | | todayDirect = new BigDecimal(0);
|
| | | }
|
| | | BigDecimal todayIndirect = inviteOrderSubsidyServiceV2.sumValidMoneyByUidAndDate(uid, 1, InviteOrderSubsidy.LEVEL_TWO);
|
| | | BigDecimal todayIndirect = inviteOrderSubsidyServiceV2.sumValidMoneyByUidAndDate(uid, 1,
|
| | | InviteOrderSubsidy.LEVEL_TWO);
|
| | | if (todayIndirect == null) {
|
| | | todayIndirect = new BigDecimal(0);
|
| | | }
|
| | | TeamBonusVO today = new TeamBonusVO();
|
| | | today.setDirect(todayDirect.setScale(2, BigDecimal.ROUND_DOWN).toString());
|
| | | today.setIndirect(todayIndirect.setScale(2, BigDecimal.ROUND_DOWN).toString());
|
| | | today.setTotal(MoneyBigDecimalUtil.add(todayDirect, todayIndirect).setScale(2, BigDecimal.ROUND_DOWN).toString());
|
| | | |
| | | today.setTotal(
|
| | | MoneyBigDecimalUtil.add(todayDirect, todayIndirect).setScale(2, BigDecimal.ROUND_DOWN).toString());
|
| | |
|
| | | // 昨日统计
|
| | | BigDecimal yesterdayDirect = inviteOrderSubsidyServiceV2.sumValidMoneyByUidAndDate(uid, 2, InviteOrderSubsidy.LEVEL_ONE);
|
| | | BigDecimal yesterdayDirect = inviteOrderSubsidyServiceV2.sumValidMoneyByUidAndDate(uid, 2,
|
| | | InviteOrderSubsidy.LEVEL_ONE);
|
| | | if (yesterdayDirect == null) {
|
| | | yesterdayDirect = new BigDecimal(0);
|
| | | }
|
| | | BigDecimal yesterdayIndirect = inviteOrderSubsidyServiceV2.sumValidMoneyByUidAndDate(uid, 2, InviteOrderSubsidy.LEVEL_TWO);
|
| | | BigDecimal yesterdayIndirect = inviteOrderSubsidyServiceV2.sumValidMoneyByUidAndDate(uid, 2,
|
| | | InviteOrderSubsidy.LEVEL_TWO);
|
| | | if (yesterdayIndirect == null) {
|
| | | yesterdayIndirect = new BigDecimal(0);
|
| | | }
|
| | | TeamBonusVO yesterday = new TeamBonusVO();
|
| | | yesterday.setDirect(yesterdayDirect.setScale(2, BigDecimal.ROUND_DOWN).toString());
|
| | | yesterday.setIndirect(yesterdayIndirect.setScale(2, BigDecimal.ROUND_DOWN).toString());
|
| | | yesterday.setTotal(MoneyBigDecimalUtil.add(yesterdayDirect, yesterdayIndirect).setScale(2, BigDecimal.ROUND_DOWN).toString());
|
| | | |
| | | yesterday.setTotal(MoneyBigDecimalUtil.add(yesterdayDirect, yesterdayIndirect)
|
| | | .setScale(2, BigDecimal.ROUND_DOWN).toString());
|
| | |
|
| | | // 本月统计
|
| | | BigDecimal thisMonthDirect = inviteOrderSubsidyServiceV2.sumValidMoneyByUidAndDate(uid, 3, InviteOrderSubsidy.LEVEL_ONE);
|
| | | BigDecimal thisMonthDirect = inviteOrderSubsidyServiceV2.sumValidMoneyByUidAndDate(uid, 3,
|
| | | InviteOrderSubsidy.LEVEL_ONE);
|
| | | if (thisMonthDirect == null) {
|
| | | thisMonthDirect = new BigDecimal(0);
|
| | | }
|
| | | BigDecimal thisMonthIndirect = inviteOrderSubsidyServiceV2.sumValidMoneyByUidAndDate(uid, 3, InviteOrderSubsidy.LEVEL_TWO);
|
| | | BigDecimal thisMonthIndirect = inviteOrderSubsidyServiceV2.sumValidMoneyByUidAndDate(uid, 3,
|
| | | InviteOrderSubsidy.LEVEL_TWO);
|
| | | if (thisMonthIndirect == null) {
|
| | | thisMonthIndirect = new BigDecimal(0);
|
| | | }
|
| | | TeamBonusVO thisMonth = new TeamBonusVO();
|
| | | thisMonth.setDirect(thisMonthDirect.setScale(2, BigDecimal.ROUND_DOWN).toString());
|
| | | thisMonth.setIndirect(thisMonthIndirect.setScale(2, BigDecimal.ROUND_DOWN).toString());
|
| | | thisMonth.setTotal(MoneyBigDecimalUtil.add(thisMonthDirect, thisMonthIndirect).setScale(2, BigDecimal.ROUND_DOWN).toString());
|
| | | |
| | | thisMonth.setTotal(MoneyBigDecimalUtil.add(thisMonthDirect, thisMonthIndirect)
|
| | | .setScale(2, BigDecimal.ROUND_DOWN).toString());
|
| | |
|
| | | // 本月统计
|
| | | BigDecimal lastMonthDirect = inviteOrderSubsidyServiceV2.sumValidMoneyByUidAndDate(uid, 4, InviteOrderSubsidy.LEVEL_ONE);
|
| | | BigDecimal lastMonthDirect = inviteOrderSubsidyServiceV2.sumValidMoneyByUidAndDate(uid, 4,
|
| | | InviteOrderSubsidy.LEVEL_ONE);
|
| | | if (lastMonthDirect == null) {
|
| | | lastMonthDirect = new BigDecimal(0);
|
| | | }
|
| | | BigDecimal lastMonthIndirect = inviteOrderSubsidyServiceV2.sumValidMoneyByUidAndDate(uid, 4, InviteOrderSubsidy.LEVEL_TWO);
|
| | | BigDecimal lastMonthIndirect = inviteOrderSubsidyServiceV2.sumValidMoneyByUidAndDate(uid, 4,
|
| | | InviteOrderSubsidy.LEVEL_TWO);
|
| | | if (lastMonthIndirect == null) {
|
| | | lastMonthIndirect = new BigDecimal(0);
|
| | | }
|
| | | TeamBonusVO lastMonth = new TeamBonusVO();
|
| | | lastMonth.setDirect(lastMonthDirect.setScale(2, BigDecimal.ROUND_DOWN).toString());
|
| | | lastMonth.setIndirect(lastMonthIndirect.setScale(2, BigDecimal.ROUND_DOWN).toString());
|
| | | lastMonth.setTotal(MoneyBigDecimalUtil.add(lastMonthDirect, lastMonthIndirect).setScale(2, BigDecimal.ROUND_DOWN).toString());
|
| | | |
| | | lastMonth.setTotal(MoneyBigDecimalUtil.add(lastMonthDirect, lastMonthIndirect)
|
| | | .setScale(2, BigDecimal.ROUND_DOWN).toString());
|
| | |
|
| | | BigDecimal direct = inviteOrderSubsidyServiceV2.sumRecievedMoneyByUid(uid, InviteOrderSubsidy.LEVEL_ONE);
|
| | | if (direct == null) {
|
| | |
| | | data.put("exist", true);
|
| | | data.put("portrait", user.getPortrait());
|
| | |
|
| | | |
| | | // 今日统计
|
| | | BigDecimal todayDirect = orderTeamRewardService.sumValidMoneyByUidAndDate(uid, 1, OrderTeamReward.LEVEL_ONE);
|
| | | if (todayDirect == null) {
|
| | |
| | | TeamBonusVO today = new TeamBonusVO();
|
| | | today.setDirect(todayDirect.setScale(2, BigDecimal.ROUND_DOWN).toString());
|
| | | today.setIndirect(todayIndirect.setScale(2, BigDecimal.ROUND_DOWN).toString());
|
| | | today.setTotal(MoneyBigDecimalUtil.add(todayDirect, todayIndirect).setScale(2, BigDecimal.ROUND_DOWN).toString());
|
| | | |
| | | today.setTotal(
|
| | | MoneyBigDecimalUtil.add(todayDirect, todayIndirect).setScale(2, BigDecimal.ROUND_DOWN).toString());
|
| | |
|
| | | // 昨日统计
|
| | | BigDecimal yesterdayDirect = orderTeamRewardService.sumValidMoneyByUidAndDate(uid, 2, OrderTeamReward.LEVEL_ONE);
|
| | | BigDecimal yesterdayDirect = orderTeamRewardService.sumValidMoneyByUidAndDate(uid, 2,
|
| | | OrderTeamReward.LEVEL_ONE);
|
| | | if (yesterdayDirect == null) {
|
| | | yesterdayDirect = new BigDecimal(0);
|
| | | }
|
| | | BigDecimal yesterdayIndirect = orderTeamRewardService.sumValidMoneyByUidAndDate(uid, 2, OrderTeamReward.LEVEL_TWO);
|
| | | BigDecimal yesterdayIndirect = orderTeamRewardService.sumValidMoneyByUidAndDate(uid, 2,
|
| | | OrderTeamReward.LEVEL_TWO);
|
| | | if (yesterdayIndirect == null) {
|
| | | yesterdayIndirect = new BigDecimal(0);
|
| | | }
|
| | | TeamBonusVO yesterday = new TeamBonusVO();
|
| | | yesterday.setDirect(yesterdayDirect.setScale(2, BigDecimal.ROUND_DOWN).toString());
|
| | | yesterday.setIndirect(yesterdayIndirect.setScale(2, BigDecimal.ROUND_DOWN).toString());
|
| | | yesterday.setTotal(MoneyBigDecimalUtil.add(yesterdayDirect, yesterdayIndirect).setScale(2, BigDecimal.ROUND_DOWN).toString());
|
| | | |
| | | yesterday.setTotal(MoneyBigDecimalUtil.add(yesterdayDirect, yesterdayIndirect)
|
| | | .setScale(2, BigDecimal.ROUND_DOWN).toString());
|
| | |
|
| | | // 本月统计
|
| | | BigDecimal thisMonthDirect = orderTeamRewardService.sumValidMoneyByUidAndDate(uid, 3, OrderTeamReward.LEVEL_ONE);
|
| | | BigDecimal thisMonthDirect = orderTeamRewardService.sumValidMoneyByUidAndDate(uid, 3,
|
| | | OrderTeamReward.LEVEL_ONE);
|
| | | if (thisMonthDirect == null) {
|
| | | thisMonthDirect = new BigDecimal(0);
|
| | | }
|
| | | BigDecimal thisMonthIndirect = orderTeamRewardService.sumValidMoneyByUidAndDate(uid, 3, OrderTeamReward.LEVEL_TWO);
|
| | | BigDecimal thisMonthIndirect = orderTeamRewardService.sumValidMoneyByUidAndDate(uid, 3,
|
| | | OrderTeamReward.LEVEL_TWO);
|
| | | if (thisMonthIndirect == null) {
|
| | | thisMonthIndirect = new BigDecimal(0);
|
| | | }
|
| | | TeamBonusVO thisMonth = new TeamBonusVO();
|
| | | thisMonth.setDirect(thisMonthDirect.setScale(2, BigDecimal.ROUND_DOWN).toString());
|
| | | thisMonth.setIndirect(thisMonthIndirect.setScale(2, BigDecimal.ROUND_DOWN).toString());
|
| | | thisMonth.setTotal(MoneyBigDecimalUtil.add(thisMonthDirect, thisMonthIndirect).setScale(2, BigDecimal.ROUND_DOWN).toString());
|
| | | |
| | | thisMonth.setTotal(MoneyBigDecimalUtil.add(thisMonthDirect, thisMonthIndirect)
|
| | | .setScale(2, BigDecimal.ROUND_DOWN).toString());
|
| | |
|
| | | // 本月统计
|
| | | BigDecimal lastMonthDirect = orderTeamRewardService.sumValidMoneyByUidAndDate(uid, 4, OrderTeamReward.LEVEL_ONE);
|
| | | BigDecimal lastMonthDirect = orderTeamRewardService.sumValidMoneyByUidAndDate(uid, 4,
|
| | | OrderTeamReward.LEVEL_ONE);
|
| | | if (lastMonthDirect == null) {
|
| | | lastMonthDirect = new BigDecimal(0);
|
| | | }
|
| | | BigDecimal lastMonthIndirect = orderTeamRewardService.sumValidMoneyByUidAndDate(uid, 4, OrderTeamReward.LEVEL_TWO);
|
| | | BigDecimal lastMonthIndirect = orderTeamRewardService.sumValidMoneyByUidAndDate(uid, 4,
|
| | | OrderTeamReward.LEVEL_TWO);
|
| | | if (lastMonthIndirect == null) {
|
| | | lastMonthIndirect = new BigDecimal(0);
|
| | | }
|
| | | TeamBonusVO lastMonth = new TeamBonusVO();
|
| | | lastMonth.setDirect(lastMonthDirect.setScale(2, BigDecimal.ROUND_DOWN).toString());
|
| | | lastMonth.setIndirect(lastMonthIndirect.setScale(2, BigDecimal.ROUND_DOWN).toString());
|
| | | lastMonth.setTotal(MoneyBigDecimalUtil.add(lastMonthDirect, lastMonthIndirect).setScale(2, BigDecimal.ROUND_DOWN).toString());
|
| | | |
| | | lastMonth.setTotal(MoneyBigDecimalUtil.add(lastMonthDirect, lastMonthIndirect)
|
| | | .setScale(2, BigDecimal.ROUND_DOWN).toString());
|
| | |
|
| | | BigDecimal direct = orderTeamRewardService.sumRecievedMoneyByUid(uid, OrderTeamReward.LEVEL_ONE);
|
| | | if (direct == null) {
|
| | |
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
|
| | | |
| | | /**
|
| | | * 返利说明
|
| | | * @param acceptData
|
| | |
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getReBateInfo")
|
| | | public void getReBateInfo(String callback, AcceptData acceptData, Long uid, String orderNo, Integer sourceType, PrintWriter out) {
|
| | | public void getReBateInfo(String callback, AcceptData acceptData, Long uid, String orderNo, Integer sourceType,
|
| | | PrintWriter out) {
|
| | | if (uid == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("用户未登录"));
|
| | | return;
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | GoodsRebateVO goodsVO = new GoodsRebateVO();
|
| | | goodsVO.setTitle("舒客舒克光感炫白牙片美白牙齿牙膜套装去黄牙清新口气");
|
| | | goodsVO.setPicture("https://img.alicdn.com/bao/uploaded/i4/355739614/O1CN01RB6Hlg2KtGMWR4mON_!!0-item_pic.jpg");
|
| | | goodsVO.setActualPay("¥60.00");
|
| | | goodsVO.setFanliRate("X20%");
|
| | | goodsVO.setFanliExpect("¥25.00");
|
| | | goodsVO.setCommision("10.00");
|
| | | goodsVO.setSubsidy("6.00");
|
| | | // 按订单号 查询
|
| | | List<CommonOrder> commonOrderList = commonOrderService.listBySourceTypeAndOrderId(sourceType, orderNo);
|
| | | Integer rank = commonOrderList.get(0).getUrank();
|
| | | UserLevelEnum userLevel = UserLevelUtil.getByOrderRank(rank);
|
| | | if (userLevel == null)
|
| | | userLevel = UserLevelEnum.daRen;
|
| | |
|
| | | GoodsRebateVO goodsVO2 = new GoodsRebateVO();
|
| | | goodsVO2.setTitle("馥佩美白柔肤水爽肤水补水保湿女化妆湿敷精华水男旗舰店官网正品");
|
| | | goodsVO2.setPicture("https://img.alicdn.com/bao/uploaded/i4/738252756/O1CN01MgFdXy1WEI8zmkyg7_!!0-item_pic.jpg");
|
| | | goodsVO2.setActualPay("¥62.00");
|
| | | goodsVO2.setFanliRate("X22%");
|
| | | goodsVO2.setFanliExpect("¥26.00");
|
| | | goodsVO2.setCommision("12.00");
|
| | | goodsVO2.setSubsidy("8.00");
|
| | | |
| | | List<GoodsRebateVO> listGoods= new ArrayList<>();
|
| | | listGoods.add(goodsVO);
|
| | | listGoods.add(goodsVO2);
|
| | | List<HongBaoOrder> hongBaoOrderList = hongBaoOrderService.listDetailByOrderIdAndSourceType(orderNo, sourceType);
|
| | |
|
| | | OrderRebateVO orderRebateVO = new OrderRebateVO();
|
| | | orderRebateVO.setTotalFanLi("¥50.00");
|
| | | orderRebateVO.setUpperFanLi("¥60.00");
|
| | | orderRebateVO.setUserLevel(UserLevelEnum.daRen.name());
|
| | | orderRebateVO.setJumpLink("https://www.baidu.com/");
|
| | | orderRebateVO.setListGoods(listGoods);
|
| | | List<GoodsRebateVO> voList = new ArrayList<>();
|
| | | BigDecimal totalMoney = new BigDecimal(0);
|
| | | UserLevelEnum upperLevel = UserLevelUtil.getNextLevel(userLevel);
|
| | | BigDecimal upperTotalMoney = new BigDecimal(0);
|
| | | Map<Long, CommonOrderGoods> orderGoodsMap = new HashMap<>();
|
| | |
|
| | | List<Long> goodsIdList = new ArrayList<>();
|
| | | if (hongBaoOrderList != null)
|
| | | for (HongBaoOrder hongBaoOrder : hongBaoOrderList) {
|
| | | if (hongBaoOrder.getCommonOrder() != null)
|
| | | goodsIdList.add(hongBaoOrder.getCommonOrder().getCommonOrderGoods().getId());
|
| | | }
|
| | |
|
| | | List<CommonOrderGoods> goodsList = commonOrderGoodsService.listByByPrimaryKeys(goodsIdList);
|
| | | if (goodsList != null)
|
| | | for (CommonOrderGoods goods : goodsList)
|
| | | orderGoodsMap.put(goods.getId(), goods);
|
| | |
|
| | | if (userLevel == UserLevelEnum.daRen) {
|
| | | for (HongBaoOrder hongBaoOrder : hongBaoOrderList) {
|
| | | if (hongBaoOrder.getHongBaoV2().getState() == HongBaoV2.STATE_SHIXIAO)
|
| | | hongBaoOrder.getHongBaoV2().setMoney(new BigDecimal(0));
|
| | | CommonOrder commonOrder = hongBaoOrder.getCommonOrder();
|
| | | GoodsRebateVO goodsVO = new GoodsRebateVO();
|
| | | if (orderGoodsMap.get(commonOrder.getCommonOrderGoods().getId()) != null) {
|
| | | goodsVO.setTitle(orderGoodsMap.get(commonOrder.getCommonOrderGoods().getId()).getTitle());
|
| | | goodsVO.setPicture(orderGoodsMap.get(commonOrder.getCommonOrderGoods().getId()).getPicture());
|
| | | }
|
| | | BigDecimal payment = hongBaoOrder.getCommonOrder().getPayment();
|
| | | if (hongBaoOrder.getCommonOrder().getSettlement() != null)
|
| | | payment = hongBaoOrder.getCommonOrder().getSettlement();
|
| | | if (payment == null)
|
| | | payment = new BigDecimal(0);
|
| | |
|
| | | goodsVO.setActualPay("¥" + payment);
|
| | |
|
| | | if (payment.compareTo(new BigDecimal(0)) <= 0) {
|
| | | goodsVO.setFanliRate("X0%");
|
| | | } else {
|
| | | goodsVO.setFanliRate("X"
|
| | | + MoneyBigDecimalUtil
|
| | | .div(hongBaoOrder.getHongBaoV2().getMoney().multiply(new BigDecimal(100)), payment)
|
| | | + "%");
|
| | | }
|
| | | goodsVO.setFanliExpect("¥" + hongBaoOrder.getHongBaoV2().getMoney());
|
| | | voList.add(goodsVO);
|
| | | totalMoney = totalMoney.add(hongBaoOrder.getHongBaoV2().getMoney());
|
| | | if (upperLevel != null) {
|
| | | upperTotalMoney = upperTotalMoney
|
| | | .add(orderHongBaoMoneyComputeService.computeFanliMoney(commonOrder, upperLevel));
|
| | | }
|
| | | }
|
| | | orderRebateVO.setListGoods(voList);
|
| | | } else {
|
| | | for (HongBaoOrder hongBaoOrder : hongBaoOrderList) {
|
| | | if (hongBaoOrder.getHongBaoV2().getState() == HongBaoV2.STATE_SHIXIAO)
|
| | | hongBaoOrder.getHongBaoV2().setMoney(new BigDecimal(0));
|
| | | CommonOrder commonOrder = hongBaoOrder.getCommonOrder();
|
| | | GoodsRebateVO goodsVO = new GoodsRebateVO();
|
| | | if (orderGoodsMap.get(commonOrder.getCommonOrderGoods().getId()) != null) {
|
| | | goodsVO.setTitle(orderGoodsMap.get(commonOrder.getCommonOrderGoods().getId()).getTitle());
|
| | | goodsVO.setPicture(orderGoodsMap.get(commonOrder.getCommonOrderGoods().getId()).getPicture());
|
| | | }
|
| | | BigDecimal payment = hongBaoOrder.getCommonOrder().getPayment();
|
| | | if (hongBaoOrder.getCommonOrder().getSettlement() != null)
|
| | | payment = hongBaoOrder.getCommonOrder().getSettlement();
|
| | | if (payment == null)
|
| | | payment = new BigDecimal(0);
|
| | |
|
| | | goodsVO.setActualPay("¥" + payment);
|
| | |
|
| | | BigDecimal commission = orderHongBaoMoneyComputeService.computeBaseFanliMoney(commonOrder);
|
| | | goodsVO.setCommision("¥" +commission);
|
| | |
|
| | | BigDecimal darenFanli = orderHongBaoMoneyComputeService.computeFanliMoney(commonOrder,
|
| | | UserLevelEnum.daRen);
|
| | |
|
| | | BigDecimal vipFanli = hongBaoOrder.getHongBaoV2().getMoney();
|
| | |
|
| | | goodsVO.setOriginSubsidy(darenFanli.subtract(commission) + "");
|
| | | goodsVO.setSubsidy("¥" +vipFanli.subtract(commission));
|
| | | voList.add(goodsVO);
|
| | | totalMoney = totalMoney.add(vipFanli);
|
| | | if (upperLevel != null) {
|
| | | upperTotalMoney = upperTotalMoney
|
| | | .add(orderHongBaoMoneyComputeService.computeFanliMoney(commonOrder, upperLevel));
|
| | | }
|
| | | }
|
| | | orderRebateVO.setListGoods(voList);
|
| | | }
|
| | | orderRebateVO.setTotalFanLi("¥" + totalMoney);
|
| | | if (upperLevel != null) {
|
| | | orderRebateVO.setUpperFanLi("¥" + upperTotalMoney);
|
| | | orderRebateVO.setUserLevel(upperLevel.name());
|
| | | orderRebateVO.setJumpLink(upperLevel.getDetailLink());
|
| | | }
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("result", orderRebateVO);
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
|
| | |
|
| | | }
|