| @@ -124,20 +124,22 @@ public class CouponExpiringSchedule { | |||||
| wxGame.setStatus(EnumGameStatus.STATUS_THROW_IN.getCode()); | wxGame.setStatus(EnumGameStatus.STATUS_THROW_IN.getCode()); | ||||
| List<WxGame> list = wxGameMapper.findList(wxGame); | List<WxGame> list = wxGameMapper.findList(wxGame); | ||||
| list.stream().forEach(g->{ | |||||
| WxCouponChannel couponChannel = new WxCouponChannel(); | |||||
| couponChannel.updateTenantInfo(g); | |||||
| couponChannel.setTargetAd(EnumCouponChannelType.COUPON_CHANNEL_ID_GAME.getCode()); | |||||
| couponChannel.setSubTargetId(g.getId()); | |||||
| couponChannel.setStatus(EnumCouponChannelStatus.STATUS_THROW_IN.getCode()); | |||||
| int count = wxCouponChannelMapper.countCouponChannel(couponChannel); | |||||
| if (count == 0) { | |||||
| WxGame record = new WxGame(); | |||||
| record.setId(g.getId()); | |||||
| record.setStatus(EnumGameStatus.STATUS_TAKE_OFFF.getCode()); | |||||
| wxGameMapper.updateById(record); | |||||
| } | |||||
| }); | |||||
| if (null != list && list.size() > 0 ) { | |||||
| list.stream().forEach(g->{ | |||||
| WxCouponChannel couponChannel = new WxCouponChannel(); | |||||
| couponChannel.updateTenantInfo(g); | |||||
| couponChannel.setTargetAd(EnumCouponChannelType.COUPON_CHANNEL_ID_GAME.getCode()); | |||||
| couponChannel.setSubTargetId(g.getId()); | |||||
| couponChannel.setStatus(EnumCouponChannelStatus.STATUS_THROW_IN.getCode()); | |||||
| int count = wxCouponChannelMapper.countCouponChannel(couponChannel); | |||||
| if (count == 0) { | |||||
| WxGame record = new WxGame(); | |||||
| record.setId(g.getId()); | |||||
| record.setStatus(EnumGameStatus.STATUS_TAKE_OFFF.getCode()); | |||||
| wxGameMapper.updateById(record); | |||||
| } | |||||
| }); | |||||
| } | |||||
| } | } | ||||
| @@ -66,15 +66,17 @@ public class CouponOrderExpiringSchedule { | |||||
| List<WxMall> malls = getMalls(); | List<WxMall> malls = getMalls(); | ||||
| for (WxMall mall: malls) { | for (WxMall mall: malls) { | ||||
| List<WxCouponOrder> list = wxCouponOrderMapper.findExpiredFreeCouponOrderByValidDate(mall.getTenantId()); | List<WxCouponOrder> list = wxCouponOrderMapper.findExpiredFreeCouponOrderByValidDate(mall.getTenantId()); | ||||
| list.stream().forEach(co -> { | |||||
| // 券过期,更改状态及库存退回 | |||||
| try { | |||||
| proxy.couponOrderExpire(co, true); | |||||
| } catch (Exception e) { | |||||
| logger.error(e.getMessage(),e); | |||||
| } | |||||
| }); | |||||
| if (null != list && list.size() > 0 ) { | |||||
| list.stream().forEach(co -> { | |||||
| // 券过期,更改状态及库存退回 | |||||
| try { | |||||
| proxy.couponOrderExpire(co, true); | |||||
| } catch (Exception e) { | |||||
| logger.error(e.getMessage(),e); | |||||
| } | |||||
| }); | |||||
| } | |||||
| } | } | ||||
| } | } | ||||
| @@ -86,13 +88,15 @@ public class CouponOrderExpiringSchedule { | |||||
| List<WxMall> malls = getMalls(); | List<WxMall> malls = getMalls(); | ||||
| for (WxMall mall: malls) { | for (WxMall mall: malls) { | ||||
| List<WxCouponOrder> list = wxCouponOrderMapper.findExpiredCouponOrderByValidDate(mall.getTenantId()); | List<WxCouponOrder> list = wxCouponOrderMapper.findExpiredCouponOrderByValidDate(mall.getTenantId()); | ||||
| list.stream().forEach(co -> { | |||||
| try { | |||||
| proxy.refund(co); | |||||
| }catch(Exception e) { | |||||
| logger.error(e.getMessage(),e); | |||||
| } | |||||
| }); | |||||
| if (null != list && list.size() > 0 ) { | |||||
| list.stream().forEach(co -> { | |||||
| try { | |||||
| proxy.refund(co); | |||||
| }catch(Exception e) { | |||||
| logger.error(e.getMessage(),e); | |||||
| } | |||||
| }); | |||||
| } | |||||
| } | } | ||||
| } | } | ||||
| @@ -70,28 +70,30 @@ public class DaliyAmountSchedule { | |||||
| wxDateAmountRecordService.saveAmount(dateAmountRecord); | wxDateAmountRecordService.saveAmount(dateAmountRecord); | ||||
| list = wxCouponOrderMapper.findListOfVerifiedByDate(dateMap); | list = wxCouponOrderMapper.findListOfVerifiedByDate(dateMap); | ||||
| logger.info("\nfind " + list.size() + " coupon order from " + startDate + " to " + endDate); | |||||
| total_price = list.stream().mapToInt(p -> p.getCouponPrice()).sum(); | |||||
| logger.info("\nFound " + list.size() + " coupon orders \n" + | |||||
| "for merchantId:" + merchant.getId() + "\n" + | |||||
| "from " + startDate + " to " + endDate + "\n" + | |||||
| "TOTAL VERIFIED=" + total_price); | |||||
| dateAmountRecord.setPayPrice(total_price); | |||||
| dateAmountRecord.setType(EnumDateAmtType.VERIFY_RECORD.getCode()); | |||||
| wxDateAmountRecordService.saveAmount(dateAmountRecord); | |||||
| Map microPayMap = wxOrderMapper.dayMicroPayAmountList(dateMap); | |||||
| Long countMic = (Long) microPayMap.get("count"); | |||||
| BigDecimal totalPriceMic = (BigDecimal) microPayMap.get("total_price"); | |||||
| logger.info("\nFound " + countMic + " order " + "\n" + | |||||
| "for merchantId:" + merchant.getId() + "\n" + | |||||
| "from " + startDate + " to " + endDate + "\n" + | |||||
| "TOTAL Payment=" + totalPriceMic); | |||||
| dateAmountRecord.setPayPrice(totalPriceMic.intValue()); | |||||
| dateAmountRecord.setType(EnumDateAmtType.MICROPAY_RECORD.getCode()); | |||||
| wxDateAmountRecordService.saveAmount(dateAmountRecord); | |||||
| if (null != list && list.size() > 0) { | |||||
| logger.info("\nfind " + list.size() + " coupon order from " + startDate + " to " + endDate); | |||||
| total_price = list.stream().mapToInt(p -> p.getCouponPrice()).sum(); | |||||
| logger.info("\nFound " + list.size() + " coupon orders \n" + | |||||
| "for merchantId:" + merchant.getId() + "\n" + | |||||
| "from " + startDate + " to " + endDate + "\n" + | |||||
| "TOTAL VERIFIED=" + total_price); | |||||
| dateAmountRecord.setPayPrice(total_price); | |||||
| dateAmountRecord.setType(EnumDateAmtType.VERIFY_RECORD.getCode()); | |||||
| wxDateAmountRecordService.saveAmount(dateAmountRecord); | |||||
| Map microPayMap = wxOrderMapper.dayMicroPayAmountList(dateMap); | |||||
| Long countMic = (Long) microPayMap.get("count"); | |||||
| BigDecimal totalPriceMic = (BigDecimal) microPayMap.get("total_price"); | |||||
| logger.info("\nFound " + countMic + " order " + "\n" + | |||||
| "for merchantId:" + merchant.getId() + "\n" + | |||||
| "from " + startDate + " to " + endDate + "\n" + | |||||
| "TOTAL Payment=" + totalPriceMic); | |||||
| dateAmountRecord.setPayPrice(totalPriceMic.intValue()); | |||||
| dateAmountRecord.setType(EnumDateAmtType.MICROPAY_RECORD.getCode()); | |||||
| wxDateAmountRecordService.saveAmount(dateAmountRecord); | |||||
| } | |||||
| } | } | ||||
| @@ -123,13 +123,15 @@ public class OrderExpiringSchedule { | |||||
| dateMap.put("endDate", expireDate); | dateMap.put("endDate", expireDate); | ||||
| dateMap.put("tenantId", tenantId); | dateMap.put("tenantId", tenantId); | ||||
| List<WxOrder> orderCoupons = wxOrderMapper.findListOfUnpaidOrderByDate(dateMap); | List<WxOrder> orderCoupons = wxOrderMapper.findListOfUnpaidOrderByDate(dateMap); | ||||
| orderCoupons.stream().forEach( o -> { | |||||
| try { | |||||
| proxy.orderExpired(o,true,payWay); | |||||
| } catch (Exception e) { | |||||
| logger.error("券过期失败" + e.getMessage()); | |||||
| } | |||||
| }); | |||||
| if (null != orderCoupons && orderCoupons.size() > 0) { | |||||
| orderCoupons.stream().forEach( o -> { | |||||
| try { | |||||
| proxy.orderExpired(o,true,payWay); | |||||
| } catch (Exception e) { | |||||
| logger.error("券过期失败" + e.getMessage()); | |||||
| } | |||||
| }); | |||||
| } | |||||
| // 砍价相关订单, | // 砍价相关订单, | ||||
| // 1. 如果已经砍价完成,必须60分钟内支付, 未支付,订单过期 | // 1. 如果已经砍价完成,必须60分钟内支付, 未支付,订单过期 | ||||
| @@ -138,25 +140,29 @@ public class OrderExpiringSchedule { | |||||
| dateMap.put("endDate", pressExpireDate); | dateMap.put("endDate", pressExpireDate); | ||||
| dateMap.put("tenantId", tenantId); | dateMap.put("tenantId", tenantId); | ||||
| List<WxOrder> orderPresss = wxOrderMapper.findListOfCompleteUnPaidPressOrderByDate(dateMap); | List<WxOrder> orderPresss = wxOrderMapper.findListOfCompleteUnPaidPressOrderByDate(dateMap); | ||||
| orderPresss.stream().forEach( o -> { | |||||
| try { | |||||
| proxy.orderPressExpired(o, true,true,payWay); | |||||
| } catch (Exception e) { | |||||
| logger.error("砍价券支付过期失败" + e.getMessage()); | |||||
| } | |||||
| }); | |||||
| if (null != orderPresss && orderPresss.size() > 0) { | |||||
| orderPresss.stream().forEach( o -> { | |||||
| try { | |||||
| proxy.orderPressExpired(o, true,true,payWay); | |||||
| } catch (Exception e) { | |||||
| logger.error("砍价券支付过期失败" + e.getMessage()); | |||||
| } | |||||
| }); | |||||
| } | |||||
| // 2. 当前已超过砍价结束时间, 订单过期 | // 2. 当前已超过砍价结束时间, 订单过期 | ||||
| dateMap.put("type", EnumOrderType.COUPON.getCode()); | dateMap.put("type", EnumOrderType.COUPON.getCode()); | ||||
| dateMap.put("endDate", curDate); | dateMap.put("endDate", curDate); | ||||
| dateMap.put("tenantId", tenantId); | dateMap.put("tenantId", tenantId); | ||||
| orderPresss = wxOrderMapper.findListOfUnpaidPressOrderByDate(dateMap); | orderPresss = wxOrderMapper.findListOfUnpaidPressOrderByDate(dateMap); | ||||
| orderPresss.stream().forEach( o -> { | |||||
| try { | |||||
| proxy.orderPressExpired(o, false,true,payWay); | |||||
| } catch (Exception e) { | |||||
| logger.error("砍价券过期失败" +e.getMessage()); | |||||
| } | |||||
| }); | |||||
| if (null != orderPresss && orderPresss.size() > 0) { | |||||
| orderPresss.stream().forEach( o -> { | |||||
| try { | |||||
| proxy.orderPressExpired(o, false,true,payWay); | |||||
| } catch (Exception e) { | |||||
| logger.error("砍价券过期失败" +e.getMessage()); | |||||
| } | |||||
| }); | |||||
| } | |||||
| // 拼团取消 | // 拼团取消 | ||||
| @@ -174,13 +180,15 @@ public class OrderExpiringSchedule { | |||||
| dateMap.put("endDate", groupExpireDate); | dateMap.put("endDate", groupExpireDate); | ||||
| dateMap.put("tenantId", tenantId); | dateMap.put("tenantId", tenantId); | ||||
| List<WxOrder> orderGroups = wxOrderMapper.findListOfUnpaidGroupOrderByDate(dateMap); | List<WxOrder> orderGroups = wxOrderMapper.findListOfUnpaidGroupOrderByDate(dateMap); | ||||
| orderGroups.stream().forEach( o -> { | |||||
| try { | |||||
| proxy.orderGroupExpired(o,true,true,payWay); | |||||
| } catch (Exception e) { | |||||
| logger.error("砍价券支付过期失败" + e.getMessage()); | |||||
| } | |||||
| }); | |||||
| if (null != orderGroups && orderGroups.size() > 0) { | |||||
| orderGroups.stream().forEach( o -> { | |||||
| try { | |||||
| proxy.orderGroupExpired(o,true,true,payWay); | |||||
| } catch (Exception e) { | |||||
| logger.error("砍价券支付过期失败" + e.getMessage()); | |||||
| } | |||||
| }); | |||||
| } | |||||
| //更新拼团过期状态 | //更新拼团过期状态 | ||||
| @@ -188,57 +196,71 @@ public class OrderExpiringSchedule { | |||||
| //拼团过期 | //拼团过期 | ||||
| order.setOrderStatus(EnumOrderStatus.ORDER_STATUS_COOPERATING_OVERTIME.getCode()); | order.setOrderStatus(EnumOrderStatus.ORDER_STATUS_COOPERATING_OVERTIME.getCode()); | ||||
| order.setTenantId(tenantId); | order.setTenantId(tenantId); | ||||
| wxOrderMapper.selectList(new QueryWrapper(order)).stream().forEach(o -> { | |||||
| try { | |||||
| proxy.expiredAndReturnMoney((WxOrder) o,false,payWay); | |||||
| } catch (Exception e) { | |||||
| logger.error("拼团过期退款失败" + e.getMessage()); | |||||
| } | |||||
| }); | |||||
| List<WxOrder> _orderList = wxOrderMapper.selectList(new QueryWrapper(order)); | |||||
| if (null != _orderList && _orderList.size() > 0) { | |||||
| _orderList.stream().forEach(o -> { | |||||
| try { | |||||
| proxy.expiredAndReturnMoney((WxOrder) o,false,payWay); | |||||
| } catch (Exception e) { | |||||
| logger.error("拼团过期退款失败" + e.getMessage()); | |||||
| } | |||||
| }); | |||||
| } | |||||
| //拼团券下架 | //拼团券下架 | ||||
| order.setOrderStatus(EnumOrderStatus.ORDER_STATUS_COOPERATING_CANCEL.getCode()); | order.setOrderStatus(EnumOrderStatus.ORDER_STATUS_COOPERATING_CANCEL.getCode()); | ||||
| wxOrderMapper.selectList(new QueryWrapper(order)).stream().forEach(o -> { | |||||
| try { | |||||
| proxy.returnMoney((WxOrder) o,payWay); | |||||
| } catch (Exception e) { | |||||
| logger.error("拼团券下架退款失败" + e.getMessage()); | |||||
| } | |||||
| }); | |||||
| _orderList = wxOrderMapper.selectList(new QueryWrapper(order)); | |||||
| if (null != _orderList && _orderList.size() > 0) { | |||||
| _orderList.stream().forEach(o -> { | |||||
| try { | |||||
| proxy.returnMoney((WxOrder) o,payWay); | |||||
| } catch (Exception e) { | |||||
| logger.error("拼团券下架退款失败" + e.getMessage()); | |||||
| } | |||||
| }); | |||||
| } | |||||
| //参团失败 | //参团失败 | ||||
| order.setOrderStatus(EnumOrderStatus.ORDER_STATUS_COOPERATING_FAILD.getCode()); | order.setOrderStatus(EnumOrderStatus.ORDER_STATUS_COOPERATING_FAILD.getCode()); | ||||
| wxOrderMapper.selectList(new QueryWrapper(order)).stream().forEach(o -> { | |||||
| try { | |||||
| proxy.expiredAndReturnMoney((WxOrder) o,true,payWay); | |||||
| } catch (Exception e) { | |||||
| logger.error("参团失败退款失败" + e.getMessage()); | |||||
| } | |||||
| }); | |||||
| _orderList = wxOrderMapper.selectList(new QueryWrapper(order)); | |||||
| if (null != _orderList && _orderList.size() > 0) { | |||||
| _orderList.stream().forEach(o -> { | |||||
| try { | |||||
| proxy.expiredAndReturnMoney((WxOrder) o,true,payWay); | |||||
| } catch (Exception e) { | |||||
| logger.error("参团失败退款失败" + e.getMessage()); | |||||
| } | |||||
| }); | |||||
| } | |||||
| //无需查询付款状态的订单-退款,回滚库存 | //无需查询付款状态的订单-退款,回滚库存 | ||||
| order.setOrderStatus(EnumOrderStatus.ORDER_STATUS_COOPERATING_SCHEDU_REFUND.getCode()); | order.setOrderStatus(EnumOrderStatus.ORDER_STATUS_COOPERATING_SCHEDU_REFUND.getCode()); | ||||
| wxOrderMapper.selectList(new QueryWrapper(order)).stream().forEach(o -> { | |||||
| try { | |||||
| proxy.expiredAndReturnMoney((WxOrder) o,false,payWay); | |||||
| } catch (Exception e) { | |||||
| logger.error("参团失败退款失败" + e.getMessage()); | |||||
| } | |||||
| }); | |||||
| _orderList = wxOrderMapper.selectList(new QueryWrapper(order)); | |||||
| if (null != _orderList && _orderList.size() > 0) { | |||||
| _orderList.stream().forEach(o -> { | |||||
| try { | |||||
| proxy.expiredAndReturnMoney((WxOrder) o,false,payWay); | |||||
| } catch (Exception e) { | |||||
| logger.error("参团失败退款失败" + e.getMessage()); | |||||
| } | |||||
| }); | |||||
| } | |||||
| //此处是拼团完成后,会将其他失效的订单置成该状态。需要查询是否已经付款,如果已经付款,则退款,退款回回滚库存。如果没付款,则主动回滚库存 | //此处是拼团完成后,会将其他失效的订单置成该状态。需要查询是否已经付款,如果已经付款,则退款,退款回回滚库存。如果没付款,则主动回滚库存 | ||||
| order.setOrderStatus(EnumOrderStatus.ORDER_STATUS_COOPERATING_COMPLETE_REFUND.getCode()); | order.setOrderStatus(EnumOrderStatus.ORDER_STATUS_COOPERATING_COMPLETE_REFUND.getCode()); | ||||
| wxOrderMapper.selectList(new QueryWrapper(order)).stream().forEach(o -> { | |||||
| try { | |||||
| proxy.expiredCheckAndReturnMoney((WxOrder) o,payWay); | |||||
| } catch (Exception e) { | |||||
| logger.error("参团失败退款失败" + e.getMessage()); | |||||
| } | |||||
| }); | |||||
| _orderList = wxOrderMapper.selectList(new QueryWrapper(order)); | |||||
| if (null != _orderList && _orderList.size() > 0) { | |||||
| _orderList.stream().forEach(o -> { | |||||
| try { | |||||
| proxy.expiredCheckAndReturnMoney((WxOrder) o,payWay); | |||||
| } catch (Exception e) { | |||||
| logger.error("参团失败退款失败" + e.getMessage()); | |||||
| } | |||||
| }); | |||||
| } | |||||
| } | } | ||||
| @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) | @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) | ||||
| public void expiredCheckAndReturnMoney(WxOrder wxOrder,EnumPayWay payWay) throws MallinkException, Exception { | public void expiredCheckAndReturnMoney(WxOrder wxOrder,EnumPayWay payWay) throws MallinkException, Exception { | ||||
| if (wxPaySuccess(wxOrder, false, payWay)) { | if (wxPaySuccess(wxOrder, false, payWay)) { | ||||
| @@ -67,15 +67,17 @@ public class PowerBillAutoBuildSchedule { | |||||
| logger.info("自动生成电费账单开始...."); | logger.info("自动生成电费账单开始...."); | ||||
| int dayOfMonth = LocalDate.now().getDayOfMonth(); | int dayOfMonth = LocalDate.now().getDayOfMonth(); | ||||
| List<WxPowerBillAutoConfig> wxPowerBillAutoConfigs = wxPowerBillAutoConfigMapper.selectList(new QueryWrapper(null)); | List<WxPowerBillAutoConfig> wxPowerBillAutoConfigs = wxPowerBillAutoConfigMapper.selectList(new QueryWrapper(null)); | ||||
| wxPowerBillAutoConfigs = wxPowerBillAutoConfigs.stream().filter(config -> StringUtils.isNotEmpty(config.getUnitPrice()) | |||||
| && StringUtils.isNotEmpty(config.getBuildDay()) | |||||
| && StringUtils.isNotEmpty(config.getReceiveDay())) | |||||
| .collect(Collectors.toList()); | |||||
| for (int i = 0; i < wxPowerBillAutoConfigs.size(); i++) { | |||||
| WxPowerBillAutoConfig wxPowerBillAutoConfig = wxPowerBillAutoConfigs.get(i); | |||||
| if (String.valueOf(dayOfMonth).equals(wxPowerBillAutoConfig.getBuildDay())) { | |||||
| merchantPowerBillConfigStart(wxPowerBillAutoConfig); | |||||
| } | |||||
| if (null != wxPowerBillAutoConfigs) { | |||||
| wxPowerBillAutoConfigs = wxPowerBillAutoConfigs.stream().filter(config -> StringUtils.isNotEmpty(config.getUnitPrice()) | |||||
| && StringUtils.isNotEmpty(config.getBuildDay()) | |||||
| && StringUtils.isNotEmpty(config.getReceiveDay())) | |||||
| .collect(Collectors.toList()); | |||||
| for (int i = 0; i < wxPowerBillAutoConfigs.size(); i++) { | |||||
| WxPowerBillAutoConfig wxPowerBillAutoConfig = wxPowerBillAutoConfigs.get(i); | |||||
| if (String.valueOf(dayOfMonth).equals(wxPowerBillAutoConfig.getBuildDay())) { | |||||
| merchantPowerBillConfigStart(wxPowerBillAutoConfig); | |||||
| } | |||||
| } | |||||
| } | } | ||||
| logger.info("自动生成电费账单结束...."); | logger.info("自动生成电费账单结束...."); | ||||
| } | } | ||||
| @@ -84,8 +86,10 @@ public class PowerBillAutoBuildSchedule { | |||||
| WxMerchantPowerBillConfig wxMerchantPowerBillConfig = new WxMerchantPowerBillConfig(); | WxMerchantPowerBillConfig wxMerchantPowerBillConfig = new WxMerchantPowerBillConfig(); | ||||
| wxMerchantPowerBillConfig.updateTenantInfo(wxPowerBillAutoConfig); | wxMerchantPowerBillConfig.updateTenantInfo(wxPowerBillAutoConfig); | ||||
| List<WxMerchantPowerBillConfig> wxMerchantPowerBillConfigs = wxMerchantPowerBillConfigMapper.selectList(new QueryWrapper(wxMerchantPowerBillConfig)); | List<WxMerchantPowerBillConfig> wxMerchantPowerBillConfigs = wxMerchantPowerBillConfigMapper.selectList(new QueryWrapper(wxMerchantPowerBillConfig)); | ||||
| for (int i = 0; i < wxMerchantPowerBillConfigs.size(); i++) { | |||||
| buildPowerBill(wxMerchantPowerBillConfigs.get(i), wxPowerBillAutoConfig); | |||||
| if (null != wxMerchantPowerBillConfigs) { | |||||
| for (int i = 0; i < wxMerchantPowerBillConfigs.size(); i++) { | |||||
| buildPowerBill(wxMerchantPowerBillConfigs.get(i), wxPowerBillAutoConfig); | |||||
| } | |||||
| } | } | ||||
| } | } | ||||
| @@ -52,40 +52,44 @@ public class SharingOrderRedoSchedule { | |||||
| wxProfitSharingOrder.setType(EnumProfitSharingOrderType.PROFIT_SHARING_SINGLE.getCode()); | wxProfitSharingOrder.setType(EnumProfitSharingOrderType.PROFIT_SHARING_SINGLE.getCode()); | ||||
| wxProfitSharingOrder.setSharingStatus(EnumProfitSharingOrderStatus.PROFIT_SHARING_APPLY_FAILED.getCode()); | wxProfitSharingOrder.setSharingStatus(EnumProfitSharingOrderStatus.PROFIT_SHARING_APPLY_FAILED.getCode()); | ||||
| List<WxProfitSharingOrder> list = wxProfitSharingOrderMapper.findList(wxProfitSharingOrder); | List<WxProfitSharingOrder> list = wxProfitSharingOrderMapper.findList(wxProfitSharingOrder); | ||||
| list.stream().forEach(sharingOrder->{ | |||||
| try { | |||||
| ResultData result = wxProfitSharingOrderService.redoSharingOrder(sharingOrder); | |||||
| if (result.code != ResultData.SUCCESS) { | |||||
| logger.error("分账重试失败:" + EnumProfitSharingOrderType.PROFIT_SHARING_SINGLE.getMessage() | |||||
| + " ID:" +sharingOrder.getId() | |||||
| + " RES:" + result.message); | |||||
| } | |||||
| } catch (Exception e){ | |||||
| logger.error("分账重试失败:" + EnumProfitSharingOrderType.PROFIT_SHARING_SINGLE.getMessage() | |||||
| + " ID:" +sharingOrder.getId() | |||||
| + " MSG:" + e.getMessage()); | |||||
| } | |||||
| }); | |||||
| if (null != list) { | |||||
| list.stream().forEach(sharingOrder->{ | |||||
| try { | |||||
| ResultData result = wxProfitSharingOrderService.redoSharingOrder(sharingOrder); | |||||
| if (result.code != ResultData.SUCCESS) { | |||||
| logger.error("分账重试失败:" + EnumProfitSharingOrderType.PROFIT_SHARING_SINGLE.getMessage() | |||||
| + " ID:" +sharingOrder.getId() | |||||
| + " RES:" + result.message); | |||||
| } | |||||
| } catch (Exception e){ | |||||
| logger.error("分账重试失败:" + EnumProfitSharingOrderType.PROFIT_SHARING_SINGLE.getMessage() | |||||
| + " ID:" +sharingOrder.getId() | |||||
| + " MSG:" + e.getMessage()); | |||||
| } | |||||
| }); | |||||
| } | |||||
| wxProfitSharingOrder.setType(EnumProfitSharingOrderType.PROFIT_SHARING_MULTI.getCode()); | wxProfitSharingOrder.setType(EnumProfitSharingOrderType.PROFIT_SHARING_MULTI.getCode()); | ||||
| wxProfitSharingOrder.setSharingStatus(EnumProfitSharingOrderStatus.PROFIT_SHARING_APPLY_FAILED.getCode()); | wxProfitSharingOrder.setSharingStatus(EnumProfitSharingOrderStatus.PROFIT_SHARING_APPLY_FAILED.getCode()); | ||||
| list = wxProfitSharingOrderMapper.findList(wxProfitSharingOrder); | list = wxProfitSharingOrderMapper.findList(wxProfitSharingOrder); | ||||
| list.stream().forEach(sharingOrder->{ | |||||
| try { | |||||
| ResultData result = wxProfitSharingOrderService.redoSharingOrder(sharingOrder); | |||||
| if (result.code != ResultData.SUCCESS) { | |||||
| logger.error("分账重试失败:" + EnumProfitSharingOrderType.PROFIT_SHARING_MULTI.getMessage() | |||||
| + " ID:" +sharingOrder.getId() | |||||
| + " RES:" + result.message); | |||||
| } | |||||
| } catch (Exception e){ | |||||
| logger.error("分账重试失败:" + EnumProfitSharingOrderType.PROFIT_SHARING_MULTI.getMessage() | |||||
| + " ID:" +sharingOrder.getId() | |||||
| + " MSG:" + e.getMessage()); | |||||
| } | |||||
| }); | |||||
| if (null != list) { | |||||
| list.stream().forEach(sharingOrder->{ | |||||
| try { | |||||
| ResultData result = wxProfitSharingOrderService.redoSharingOrder(sharingOrder); | |||||
| if (result.code != ResultData.SUCCESS) { | |||||
| logger.error("分账重试失败:" + EnumProfitSharingOrderType.PROFIT_SHARING_MULTI.getMessage() | |||||
| + " ID:" +sharingOrder.getId() | |||||
| + " RES:" + result.message); | |||||
| } | |||||
| } catch (Exception e){ | |||||
| logger.error("分账重试失败:" + EnumProfitSharingOrderType.PROFIT_SHARING_MULTI.getMessage() | |||||
| + " ID:" +sharingOrder.getId() | |||||
| + " MSG:" + e.getMessage()); | |||||
| } | |||||
| }); | |||||
| } | |||||
| } | } | ||||
| } | } | ||||
| @@ -63,13 +63,15 @@ public class WxCUserTagsSchedule { | |||||
| PageInfo page; | PageInfo page; | ||||
| do{ | do{ | ||||
| page = wxCUserBasicInfoService.listAsPage(wxCUserBasicInfo, pageIndex++, pageSize); | page = wxCUserBasicInfoService.listAsPage(wxCUserBasicInfo, pageIndex++, pageSize); | ||||
| page.getList().stream().forEach(cubi -> { | |||||
| try { | |||||
| wxCUserTagsService.triggerAssignTags(EnumAssignTagsTrigger.ASSIGN_TAGS_TRIGGER_SCAN, new WxCUserBasicTagVo((WxCUserBasicInfo)cubi,mall.getTenantId()),mall,null); | |||||
| }catch(Exception e) { | |||||
| logger.error("wxCUserTagsSchedule error."+cubi.toString(),e); | |||||
| } | |||||
| }); | |||||
| if (null != page && null != page.getList()) { | |||||
| page.getList().stream().forEach(cubi -> { | |||||
| try { | |||||
| wxCUserTagsService.triggerAssignTags(EnumAssignTagsTrigger.ASSIGN_TAGS_TRIGGER_SCAN, new WxCUserBasicTagVo((WxCUserBasicInfo)cubi,mall.getTenantId()),mall,null); | |||||
| }catch(Exception e) { | |||||
| logger.error("wxCUserTagsSchedule error."+cubi.toString(),e); | |||||
| } | |||||
| }); | |||||
| } | |||||
| } while ((page.isHasNextPage())); | } while ((page.isHasNextPage())); | ||||
| } | } | ||||