From bc9b3881443190de6df4867a6b0a67bc472bab93 Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期二, 09 六月 2020 17:44:46 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/div' into div --- fanli/src/main/java/com/yeshi/fanli/controller/client/v2/UserOrderControllerV2.java | 356 ++++++++++++++++++++++++++-------------------------------- 1 files changed, 160 insertions(+), 196 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/UserOrderControllerV2.java b/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/UserOrderControllerV2.java index 1318dfb..690f38e 100644 --- a/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/UserOrderControllerV2.java +++ b/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/UserOrderControllerV2.java @@ -7,10 +7,8 @@ import java.util.ArrayList; import java.util.Date; import java.util.HashMap; -import java.util.Iterator; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import javax.annotation.Resource; @@ -40,8 +38,6 @@ import com.yeshi.fanli.entity.order.ESOrder; import com.yeshi.fanli.entity.order.HongBaoOrder; import com.yeshi.fanli.entity.order.UserOrderWeiQuanRecord; -import com.yeshi.fanli.entity.order.dividents.TeamDividentsSourceOrder; -import com.yeshi.fanli.entity.order.dividents.TeamDividentsSourceOrderUserMap; import com.yeshi.fanli.entity.system.ConfigKeyEnum; import com.yeshi.fanli.entity.system.SystemCoupon.CouponTypeEnum; import com.yeshi.fanli.entity.taobao.TaoBaoWeiQuanOrder; @@ -123,7 +119,7 @@ @Resource private HongBaoV2Service hongBaoV2Service; - + @Resource private HongBaoOrderService hongBaoOrderService; @@ -132,42 +128,39 @@ @Resource private CommonOrderGoodsService commonOrderGoodsService; - + @Resource private TaoBaoWeiQuanOrderService taoBaoWeiQuanOrderService; - - + @Resource private JumpDetailV2Service jumpDetailV2Service; - + @Resource private UserSystemCouponRecordService userSystemCouponRecordService; - + @Resource private UserInviteService userInviteService; - + @Resource private ThreeSaleSerivce threeSaleSerivce; - + @Resource private OrderHongBaoMapService orderHongBaoMapService; - + @Resource - private PreviewInfoService previewInfoService; - + private PreviewInfoService previewInfoService; + @Resource private TeamDividentsSourceOrderService teamDividentsSourceOrderService; - + @Resource private TeamDividentsSourceOrderUserMapService teamDividentsSourceOrderUserMapService; - + @Resource private UserOrderWeiQuanRecordService userOrderWeiQuanRecordService; - + @Resource private ThreeSaleDetailService threeSaleDetailService; - - /** * 璁㈠崟鍒楄〃 @@ -286,11 +279,11 @@ } try { - boolean notBackSuVip = false; + boolean notBackSuVip = false; if (!VersionUtil.greaterThan_2_1_2(acceptData.getPlatform(), acceptData.getVersion())) { notBackSuVip = true; } - + // 绛涢�夌粨鏋滈《閮ㄧ粺璁� String validMoney = "0.00"; String invalidMoney = "0.00"; @@ -313,21 +306,20 @@ } } } - - + long count = 0L; List<CommonOrderVO> list = null; if (VersionUtil.greaterThan_2_1(acceptData.getPlatform(), acceptData.getVersion())) { - list = commonOrderService.getOrderList(acceptData, page, uid, state, orderType, - orderState, orderNo, startTime, endTime, dateType, listSource, notBackSuVip); - - count = commonOrderService.countOrderList(uid, state, orderType, orderState, orderNo, + list = commonOrderService.getOrderList(acceptData, page, uid, state, orderType, orderState, orderNo, startTime, endTime, dateType, listSource, notBackSuVip); + + count = commonOrderService.countOrderList(uid, state, orderType, orderState, orderNo, startTime, + endTime, dateType, listSource, notBackSuVip); } else { - list = commonOrderService.getOrderByUid(acceptData, page, uid, state, orderType, - orderState, orderNo, startTime, endTime, dateType, listSource); - count = commonOrderService.countGroupOrderNoByUid(uid, state, orderType, orderState, orderNo, + list = commonOrderService.getOrderByUid(acceptData, page, uid, state, orderType, orderState, orderNo, startTime, endTime, dateType, listSource); + count = commonOrderService.countGroupOrderNoByUid(uid, state, orderType, orderState, orderNo, startTime, + endTime, dateType, listSource); } // 鍒ゆ柇鏄惁闇�瑕佹樉绀鸿鍗曟壘鍥炴彁绀� 8绉掑唴璇锋眰3娆¤Е鍙� @@ -364,8 +356,12 @@ 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); + if (VersionUtil.greaterThan_2_1_2(acceptData.getPlatform(), acceptData.getVersion())) { + commonOrderService.getOrderList(acceptData, page, uid, null, null, null, key, null, null, null, + null, false); + } else + list = commonOrderService.getOrderByUid(acceptData, page, uid, null, null, null, key, null, null, + null, null); } if (list == null || list.size() == 0) { @@ -501,7 +497,7 @@ BigDecimal shareMoney = null; BigDecimal teamMoney = null; // VIP棰勮淇℃伅 - if (VersionUtil.greaterThan_2_1(acceptData.getPlatform(), acceptData.getVersion())) { + if (VersionUtil.greaterThan_2_1_1(acceptData.getPlatform(), acceptData.getVersion())) { String redisContent = previewInfoService.getRedisContent(uid, PreviewEnum.mineInfo); if (!StringUtil.isNullOrEmpty(redisContent)) { MineInfoVO vo = new Gson().fromJson(redisContent, MineInfoVO.class); @@ -515,14 +511,13 @@ } } } - + if (selfMoney == null) { selfMoney = hongBaoV2CountService.getRewardMoneyToCount(uid, dateType, 1, null); shareMoney = hongBaoV2CountService.getRewardMoneyToCount(uid, dateType, 2, null); teamMoney = hongBaoV2CountService.getRewardMoneyToCount(uid, dateType, 3, null); } - - + JSONObject data = new JSONObject(); data.put("show", show); data.put("selfMoney", selfMoney.setScale(2, BigDecimal.ROUND_DOWN).toString()); @@ -531,7 +526,6 @@ out.print(JsonUtil.loadTrueResult(data)); } - /** * 杩斿埄璇存槑 * @param acceptData @@ -555,9 +549,10 @@ } // 绾㈠寘淇℃伅 - List<HongBaoOrder> hoList = hongBaoOrderService.listDetailByOrderIdAndSourceTypeAndUid(orderNo, sourceType, uid); + List<HongBaoOrder> hoList = hongBaoOrderService.listDetailByOrderIdAndSourceTypeAndUid(orderNo, sourceType, + uid); HongBaoCountVO hongBaoCountVO = hongBaoOrderService.getHongBaoCountVO(hoList); - + Integer hongBaoState = hongBaoCountVO.getCurrentState(); String stateDesc = ""; String predictDesc = ""; @@ -569,7 +564,7 @@ } else if (HongBaoV2.STATE_SHIXIAO == hongBaoState) { stateDesc = "宸插け鏁�"; } - + int type = 0; String typeName = ""; int hongBaoType = hoList.get(0).getHongBaoV2().getType(); @@ -584,8 +579,8 @@ || HongBaoV2.TYPE_ERJI == hongBaoType) { type = 3; typeName = "鏀剁泭"; - } - + } + List<Long> goodsIdList = new ArrayList<>(); if (hoList != null) for (HongBaoOrder hongBaoOrder : hoList) { @@ -598,8 +593,7 @@ if (goodsList != null) for (CommonOrderGoods goods : goodsList) orderGoodsMap.put(goods.getId(), goods); - - + OrderRebateVO orderRebateVO = new OrderRebateVO(); // 绾㈠寘淇℃伅 BigDecimal hongBao = hongBaoCountVO.getValidMoney(); @@ -607,9 +601,9 @@ List<TaoBaoWeiQuanOrder> listWQ = taoBaoWeiQuanOrderService.getWeiQuanSuccessOrders(orderNo); if (listWQ != null && listWQ.size() > 0) { BigDecimal weiQuanMoney = commonOrderService.getWeiQuanMoney(listWQ, sourceType, uid); - + orderRebateVO.setWq(true); - orderRebateVO.setWqMoney("楼"+ weiQuanMoney.setScale(2, BigDecimal.ROUND_DOWN)); + orderRebateVO.setWqMoney("楼" + weiQuanMoney.setScale(2, BigDecimal.ROUND_DOWN)); if (hongBao.compareTo(weiQuanMoney) > 0) { orderRebateVO.setWqDesc("閮ㄥ垎鍞悗閫�鍥�"); } else { @@ -619,14 +613,14 @@ hongBao = MoneyBigDecimalUtil.sub(hongBao, weiQuanMoney); } } - + // 绾㈠寘鑾峰緱鑰� HongBaoV2 hongBaoV2 = hoList.get(0).getHongBaoV2(); UserLevelEnum userLevel = UserLevelUtil.getByOrderRank(hongBaoV2.getUrank()); if (userLevel == null) userLevel = UserLevelEnum.daRen; - UserLevelEnum upperLevel = UserLevelEnum.superVIP; - + UserLevelEnum upperLevel = UserLevelEnum.superVIP; + // 璁㈠崟璐拱鑰� CommonOrder commonOrder1 = hoList.get(0).getCommonOrder(); Date downTime = commonOrder1.getThirdCreateTime(); @@ -634,77 +628,80 @@ if (buyer == null) { buyer = UserLevelEnum.daRen; } - + BigDecimal upperTotalMoney = new BigDecimal(0); List<GoodsRebateVO> voList = new ArrayList<>(); for (HongBaoOrder hongBaoOrder : hoList) { if (hongBaoOrder.getHongBaoV2().getState() == HongBaoV2.STATE_SHIXIAO) hongBaoOrder.getHongBaoV2().setMoney(new BigDecimal(0)); - + GoodsRebateVO goodsVO = new GoodsRebateVO(); - + // 鏍囬銆佸浘鐗� CommonOrder commonOrder = hongBaoOrder.getCommonOrder(); 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(); // 鑻ュ凡缁撶畻 -鏄剧ず缁撶畻閲戦 Integer orderState = hongBaoOrder.getCommonOrder().getState(); - if (hongBaoOrder.getCommonOrder().getSettlement() != null + if (hongBaoOrder.getCommonOrder().getSettlement() != null && (orderState == CommonOrder.STATE_JS || orderState == CommonOrder.STATE_WQ)) payment = hongBaoOrder.getCommonOrder().getSettlement(); if (payment == null) payment = new BigDecimal(0); goodsVO.setActualPay("楼" + payment.setScale(2, BigDecimal.ROUND_DOWN)); - + BigDecimal fanli = hongBaoOrder.getHongBaoV2().getMoney(); // 鍩虹浣i噾 BigDecimal commission = orderHongBaoMoneyComputeService.computeBaseFanliMoney(commonOrder); - goodsVO.setCommision("楼" +commission.setScale(2, BigDecimal.ROUND_DOWN)); - - // 骞冲彴琛ヨ创 = 杩斿埄 - 鍩虹浣i噾 + goodsVO.setCommision("楼" + commission.setScale(2, BigDecimal.ROUND_DOWN)); + + // 骞冲彴琛ヨ创 = 杩斿埄 - 鍩虹浣i噾 goodsVO.setSubsidy("楼" + fanli.subtract(commission).setScale(2, BigDecimal.ROUND_DOWN)); - // 杈句汉琛ヨ创 + // 杈句汉琛ヨ创 if (userLevel != UserLevelEnum.daRen) { - BigDecimal darenFanli = orderHongBaoMoneyComputeService.computeFanliMoney(commonOrder, UserLevelEnum.daRen); + BigDecimal darenFanli = orderHongBaoMoneyComputeService.computeFanliMoney(commonOrder, + UserLevelEnum.daRen); goodsVO.setOriginSubsidy("楼" + darenFanli.subtract(commission).setScale(2, BigDecimal.ROUND_DOWN) + ""); } - + if (type == 3) { // 濂栭噾 - goodsVO.setBonus("楼" + fanli.setScale(2, BigDecimal.ROUND_DOWN) +""); + goodsVO.setBonus("楼" + fanli.setScale(2, BigDecimal.ROUND_DOWN) + ""); } - + voList.add(goodsVO); - - if (type == 1 ) { - upperTotalMoney = upperTotalMoney.add(orderHongBaoMoneyComputeService.computeFanliMoney(commonOrder, upperLevel)); + + if (type == 1) { + upperTotalMoney = upperTotalMoney + .add(orderHongBaoMoneyComputeService.computeFanliMoney(commonOrder, upperLevel)); } else if (type == 2) { - upperTotalMoney = upperTotalMoney.add(orderHongBaoMoneyComputeService.computeShareMoney(commonOrder, upperLevel)); + upperTotalMoney = upperTotalMoney + .add(orderHongBaoMoneyComputeService.computeShareMoney(commonOrder, upperLevel)); } else if (type == 3) { List<UserTeamLevel> bossLevelList = new ArrayList<>(); if (hongBaoV2.getType() == HongBaoV2.TYPE_YIJI || hongBaoV2.getType() == HongBaoV2.TYPE_SHARE_YIJI) { bossLevelList.add(new UserTeamLevel(null, UserLevelEnum.superVIP)); - upperTotalMoney = upperTotalMoney.add(orderHongBaoMoneyComputeService.computeFirstInviteMoney(commonOrder, - buyer, bossLevelList)); + upperTotalMoney = upperTotalMoney.add( + orderHongBaoMoneyComputeService.computeFirstInviteMoney(commonOrder, buyer, bossLevelList)); } else { - Integer bRank = hongBaoV2Service.getDirectBossUrankByPid(hongBaoOrder.getHongBaoV2().getParent().getId()); + Integer bRank = hongBaoV2Service + .getDirectBossUrankByPid(hongBaoOrder.getHongBaoV2().getParent().getId()); UserLevelEnum directBoss = UserLevelUtil.getByOrderRank(bRank); if (directBoss == null) { directBoss = UserLevelEnum.daRen; } bossLevelList.add(new UserTeamLevel(null, directBoss)); bossLevelList.add(new UserTeamLevel(null, UserLevelEnum.superVIP)); - upperTotalMoney = upperTotalMoney.add(orderHongBaoMoneyComputeService.computeSecondInviteMoney(commonOrder, - buyer, bossLevelList)); + upperTotalMoney = upperTotalMoney.add(orderHongBaoMoneyComputeService + .computeSecondInviteMoney(commonOrder, buyer, bossLevelList)); } } } - - + orderRebateVO.setFanLiDesc(predictDesc + typeName); orderRebateVO.setFanLi("楼" + hongBao.setScale(2, BigDecimal.ROUND_DOWN)); orderRebateVO.setType(type); @@ -715,7 +712,7 @@ } else { orderRebateVO.setUserLevel(userLevel.name()); } - + // 瓒呯骇浼氬憳杩斿埄 if (upperLevel != null) { orderRebateVO.setUpperFanLi("楼" + upperTotalMoney); @@ -726,23 +723,26 @@ boolean rewardSuccess = false; List<String> listNo = new ArrayList<String>(); listNo.add(orderNo); - List<UserSystemCouponRecord> useRecord = userSystemCouponRecordService.getRecordByOrderNoList(sourceType, listNo); + List<UserSystemCouponRecord> useRecord = userSystemCouponRecordService.getRecordByOrderNoList(sourceType, + listNo); if (useRecord != null && useRecord.size() > 0) { for (UserSystemCouponRecord couponRecord : useRecord) { Integer state = couponRecord.getState(); String cType = couponRecord.getCouponType(); - if (CouponTypeEnum.rebatePercentCoupon.name().equals(cType) && UserSystemCouponRecord.STATE_SUCCESS == state) { + if (CouponTypeEnum.rebatePercentCoupon.name().equals(cType) + && UserSystemCouponRecord.STATE_SUCCESS == state) { rewardSuccess = true; break; - } else if (CouponTypeEnum.freeCoupon.name().equals(cType) || CouponTypeEnum.welfareFreeCoupon.name().equals(cType) + } else if (CouponTypeEnum.freeCoupon.name().equals(cType) + || CouponTypeEnum.welfareFreeCoupon.name().equals(cType) || CouponTypeEnum.freeCouponBuy.name().equals(cType)) { freeState = state; break; } } } - - if (rewardSuccess) { // 宸蹭娇鐢ㄥ鍔卞埜 + + if (rewardSuccess) { // 宸蹭娇鐢ㄥ鍔卞埜 JSONObject params = new JSONObject(); params.put("orderNo", orderNo); params.put("goodsType", sourceType + ""); @@ -753,7 +753,7 @@ orderRebateVO.setCouponType(1); orderRebateVO.setCouponUse(true); orderRebateVO.setCouponText("濂栧姳鎴愬姛"); - orderRebateVO.setCouponDesc("宸插啀杩斅�" +couponMoney.setScale(2, BigDecimal.ROUND_DOWN)); + orderRebateVO.setCouponDesc("宸插啀杩斅�" + couponMoney.setScale(2, BigDecimal.ROUND_DOWN)); orderRebateVO.setCouponParams(params.toString()); orderRebateVO.setCouponJumpDetail(jumpDetailV2Service.getByTypeCache("rewardCouponDetail")); } else if (freeState > 0) { // 宸蹭娇鐢ㄥ厤鍗曞埜 @@ -775,12 +775,13 @@ } else { Date accountTime = hongBaoV2.getGetTime(); // 鍒拌处鏃堕棿 -绾㈠寘閲戦闄愬埗 - if (accountTime != null && hongBao.compareTo(Constant.REWARD_COUPON_LIMIT_MONEY) <= 0) { + if (accountTime != null && hongBao.compareTo(Constant.REWARD_COUPON_LIMIT_MONEY) <= 0) { boolean vip = userInviteService.verifyVIP(uid); Date endDay = DateUtil.plusDayDate(Constant.COUPON_REWARD_LIMIT_DAY, accountTime); long currentTime = java.lang.System.currentTimeMillis(); if (endDay.getTime() > currentTime && !vip) { - UserSystemCouponRecord couponRecord = userSystemCouponRecordService.getRecordByOrderNo(orderNo, null); + UserSystemCouponRecord couponRecord = userSystemCouponRecordService.getRecordByOrderNo(orderNo, + null); if (couponRecord == null) { orderRebateVO.setCoupon(true); orderRebateVO.setCouponType(1); @@ -790,13 +791,12 @@ } } } - + JSONObject data = new JSONObject(); data.put("result", orderRebateVO); JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data)); } - - + /** * 鐢ㄦ埛璁㈠崟缁熻 * @@ -807,140 +807,103 @@ * @param out */ @RequestMapping(value = "teamOrderSearch") - public void teamOrderSearch(String callback, AcceptData acceptData, Long uid, String key, PrintWriter out) { + public void teamOrderSearch(String callback, AcceptData acceptData, Long uid, Integer page, String key, + PrintWriter out) { if (uid == null) { JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(1, "鐢ㄦ埛鏈櫥褰�")); return; } - + List<TeamOrderVO> resultList = new ArrayList<>(); if (StringUtil.isNullOrEmpty(key)) { JSONObject data = new JSONObject(); + data.put("count", 0); data.put("list", resultList); JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data)); return; } try { - // 鏌ヨ姝ゅ崟鏄惁瀛樺湪鍒嗙孩 - List<TeamOrderVO> tempList = new ArrayList<>(); - List<TeamDividentsSourceOrder> listSourceOrder = teamDividentsSourceOrderService.listByOrderNo(key); - if (listSourceOrder != null && listSourceOrder.size() > 0) { - for (TeamDividentsSourceOrder sourceOrder: listSourceOrder) { - List<TeamDividentsSourceOrderUserMap> listDividents = - teamDividentsSourceOrderUserMapService.listBySourceOrderIdAndTargetUid(sourceOrder.getId(), uid); - if (listDividents != null && listDividents.size() > 0) { - Integer state = null; - Date sendTime = null; - BigDecimal money = BigDecimal.ZERO; - for (TeamDividentsSourceOrderUserMap teamDividents: listDividents) { - money = money.add(teamDividents.getMoney()); - state = teamDividents.getState(); - sendTime = teamDividents.getSendTime(); - } - - TeamOrderVO teamOrderVO = new TeamOrderVO(); - teamOrderVO.setSourceType(sourceOrder.getSourceType()); - teamOrderVO.setOrderNo(sourceOrder.getOrderNo()); - teamOrderVO.setDivMoney(money); - teamOrderVO.setDivState(state); - if (sendTime != null) - teamOrderVO.setAccountTime(TimeUtil.formatDate(sendTime)); - tempList.add(teamOrderVO); - } - } + if (page == null) + page = 1; + + List<TeamOrderVO> list = teamDividentsSourceOrderUserMapService.searchByOrderNoOrSourceUid((page - 1) * 20, + 20, uid, key); + if (list == null) { + list = new ArrayList<>(); } - - if (tempList.size() > 0) { - List<CommonOrder> listOrder = commonOrderService.listByOrderNo(key); - if(listOrder != null && listOrder.size() > 0) { - Map<String, TeamOrderVO> map = new HashMap<String, TeamOrderVO>(); - for (CommonOrder order: listOrder) { - Integer sourceType = order.getSourceType(); - String orderNo = order.getOrderNo(); - String mapKey = orderNo + "##" + sourceType; - - TeamOrderVO teamVO = map.get(mapKey); - if (teamVO != null) { - teamVO.setPayment(teamVO.getPayment().add(order.getPayment())); - } else { - Long orderUid = order.getUserInfo().getId(); - teamVO = new TeamOrderVO(); - teamVO.setUid(orderUid); - teamVO.setOrderNo(orderNo); - teamVO.setSourceType(sourceType); + + if (list.size() > 0) { + for (int i = 0; i < list.size(); i++) { + TeamOrderVO teamVO = list.get(i); + // 绮変笣浠f暟 + ThreeSaleDetail threeDetail = threeSaleDetailService.getByBossUidAndWorkerUid(uid, teamVO.getUid()); + if (threeDetail == null) { + list.remove(i); + i--; + continue; + } + teamVO.setTeamGrade(threeDetail.getLevel()); + + // 绮変笣鍩烘湰淇℃伅 + UserInfo userInfo = userInfoService.getUserByIdWithMybatis(teamVO.getUid()); + if (userInfo == null) { + list.remove(i); + i--; + continue; + } + teamVO.setNickName(userInfo.getNickName()); + teamVO.setPortrait(userInfo.getPortrait()); + + BigDecimal payment = BigDecimal.ZERO; + List<CommonOrder> listOrder = commonOrderService.listBySourceTypeAndOrderId(teamVO.getSourceType(), + teamVO.getOrderNo()); + if (listOrder != null && listOrder.size() > 0) { + for (CommonOrder order : listOrder) { + payment = payment.add(order.getPayment()); teamVO.setSourceName(order.getChildSourceType()); - teamVO.setPayment(order.getPayment()); teamVO.setDownTime(TimeUtil.formatDate(order.getThirdCreateTime())); - + // 涓嬪崟鏃剁瓑绾� UserLevelEnum userLevel = UserLevelUtil.getByOrderRank(order.getUrank()); if (userLevel == null) userLevel = UserLevelEnum.daRen; teamVO.setUserRank(UserLevelUtil.getShowLevel(userLevel).name()); - - // 绮変笣鍩烘湰淇℃伅 - UserInfo userInfo = userInfoService.getUserByIdWithMybatis(orderUid); - if (userInfo == null) { - continue; - } - teamVO.setUid(orderUid); - teamVO.setNickName(userInfo.getNickName()); - teamVO.setPortrait(userInfo.getPortrait()); - - // 绮変笣浠f暟 - ThreeSaleDetail threeDetail = threeSaleDetailService.getByBossUidAndWorkerUid(uid, orderUid); - if (threeDetail == null) { - continue; - } - teamVO.setTeamGrade(threeDetail.getLevel()); - } - // 缁撶畻鏃堕棿 - Date settleTime = order.getSettleTime(); - if (settleTime != null) - teamVO.setSettleTime(TimeUtil.formatDate(settleTime)); - - // 鍒嗙孩淇℃伅 - for (TeamOrderVO teamOrderVO: tempList) { - if (teamOrderVO.getSourceType() == sourceType) { - teamVO.setDivMoney(teamOrderVO.getDivMoney()); - teamVO.setDivState(teamOrderVO.getDivState()); - teamVO.setAccountTime(teamOrderVO.getAccountTime()); - break; - } - } - - // 缁存潈淇℃伅 - Integer orderState = order.getState(); - if (!StringUtil.isNullOrEmpty(teamVO.getServiceTime()) && CommonOrder.STATE_WQ == orderState) { - if (sourceType == Constant.SOURCE_TYPE_TAOBAO) { - UserOrderWeiQuanRecord record = userOrderWeiQuanRecordService.selectByOrderInfoAndUid(uid, order.getTradeId(), sourceType); - if (record != null) { - teamVO.setServiceTime(TimeUtil.formatDate(record.getCreateTime())); + + // 缁撶畻鏃堕棿 + Date settleTime = order.getSettleTime(); + if (settleTime != null) + teamVO.setSettleTime(TimeUtil.formatDate(settleTime)); + + // 缁存潈淇℃伅 + Integer orderState = order.getState(); + if (!StringUtil.isNullOrEmpty(teamVO.getServiceTime()) + && CommonOrder.STATE_WQ == orderState) { + if (order.getSourceType() == Constant.SOURCE_TYPE_TAOBAO) { + UserOrderWeiQuanRecord record = userOrderWeiQuanRecordService + .selectByOrderInfoAndUid(uid, order.getTradeId(), order.getSourceType()); + if (record != null) { + teamVO.setServiceTime(TimeUtil.formatDate(record.getCreateTime())); + } } } + } - String orderTime = "涓嬪崟" + teamVO.getDownTime() ; - if (!StringUtil.isNullOrEmpty(teamVO.getSettleTime())) { - orderTime += "\n鏀惰揣" + teamVO.getSettleTime(); - } - if (!StringUtil.isNullOrEmpty(teamVO.getServiceTime())) { - orderTime += "\n鍞悗" + teamVO.getServiceTime(); - } - teamVO.setOrderTime(orderTime); - map.put(mapKey, teamVO); } - - // 閬嶅巻鏀惧叆鏁扮粍 - Iterator<Entry<String, TeamOrderVO>> entries = map.entrySet().iterator(); - while(entries.hasNext()){ - Entry<String, TeamOrderVO> entry = entries.next(); - resultList.add(entry.getValue()); + teamVO.setPayment(payment); + + // 璁㈠崟鏃堕棿淇℃伅 + String orderTime = "涓嬪崟" + teamVO.getDownTime(); + if (!StringUtil.isNullOrEmpty(teamVO.getSettleTime())) { + orderTime += "\n鏀惰揣" + teamVO.getSettleTime(); } + if (!StringUtil.isNullOrEmpty(teamVO.getServiceTime())) { + orderTime += "\n鍞悗" + teamVO.getServiceTime(); + } + teamVO.setOrderTime(orderTime); } } - - + GsonBuilder gsonBuilder = new GsonBuilder().excludeFieldsWithoutExposeAnnotation(); gsonBuilder.registerTypeAdapter(BigDecimal.class, new JsonSerializer<BigDecimal>() { @Override @@ -949,14 +912,15 @@ return new JsonPrimitive(""); } else { // 淇濈暀2浣嶅皬鏁� - return new JsonPrimitive(MoneyBigDecimalUtil.getWithNoZera(value) + ""); + value = value.setScale(2, BigDecimal.ROUND_DOWN); + return new JsonPrimitive(value.toString()); } } }); Gson gson = gsonBuilder.create(); - JSONObject data = new JSONObject(); - data.put("list", gson.toJson(resultList)); + data.put("count", teamDividentsSourceOrderUserMapService.countSearchByOrderNoOrSourceUid(uid, key)); + data.put("list", gson.toJson(list)); JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data)); } catch (Exception e) { JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("鐢ㄦ埛涓嶅瓨鍦�")); -- Gitblit v1.8.0