| | |
| | | @Autowired |
| | | private IOrderService orderService; |
| | | |
| | | @Autowired |
| | | private ICompanyFundFlowService companyFundFlowService; |
| | | |
| | | @Value("${wx.appletsAppid}") |
| | | private String appletsAppid; |
| | | |
| | |
| | | if(null != order){ |
| | | return ResultUtil.error("您还有正在进行的订单"); |
| | | } |
| | | |
| | | String value = redisUtil.getValue("USER" + uid); |
| | | if(ToolUtil.isEmpty(value)){ |
| | | redisUtil.setStrValue("USER" + uid, System.currentTimeMillis() + "", 60); |
| | | }else{ |
| | | Long s = System.currentTimeMillis() - Long.valueOf(value); |
| | | if(s.compareTo(60000L) < 0){//1分钟 |
| | | return ResultUtil.error("数据处理中"); |
| | | } |
| | | redisUtil.setStrValue("USER" + uid, System.currentTimeMillis() + "", 60); |
| | | } |
| | | |
| | | |
| | | String startAddress = travelOrder.getStartAddress(); |
| | | startAddress = startAddress.replaceAll("& #40;", "("); |
| | |
| | | accountChangeDetailService.saveData(accountChangeDetail); |
| | | |
| | | //补贴中分账 |
| | | Double balance = revenueService.queryCompanyBalance();//平台账户余额 |
| | | Double discountedPrice = order.getDiscountedPrice(); |
| | | List<RechargeRecord> rechargeRecords = rechargeRecordService.selectList(new EntityWrapper<RechargeRecord>().eq("type", 4).eq("payStatus", 2).gt("surplusDividedAmount", 0).orderBy("createTime")); |
| | | for (RechargeRecord rechargeRecord : rechargeRecords) { |
| | |
| | | } |
| | | } |
| | | |
| | | CompanyFundFlow companyFundFlow = new CompanyFundFlow(); |
| | | companyFundFlow.setBalance(new BigDecimal(balance)); |
| | | companyFundFlow.setObjectType(1); |
| | | companyFundFlow.setType(5); |
| | | companyFundFlow.setMoney(new BigDecimal(order.getDiscountedPrice())); |
| | | companyFundFlow.setCreateTime(new Date()); |
| | | companyFundFlowService.insert(companyFundFlow); |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | //处理代理商抽佣 |
| | | if(num3 > 0 && null != driver){ |
| | | Double balance = revenueService.queryAgentBalance(driver.getAgentId()); |
| | | Revenue revenue = new Revenue(); |
| | | revenue.setType(1); |
| | | revenue.setUserType(3); |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | CompanyFundFlow companyFundFlow = new CompanyFundFlow(); |
| | | companyFundFlow.setType(3); |
| | | companyFundFlow.setObjectType(2); |
| | | companyFundFlow.setObjectId(driver.getAgentId()); |
| | | companyFundFlow.setBalance(new BigDecimal(balance)); |
| | | companyFundFlow.setMoney(new BigDecimal(num3)); |
| | | companyFundFlow.setCreateTime(new Date()); |
| | | companyFundFlowService.insert(companyFundFlow); |
| | | } |
| | | } |
| | | } |
| | |
| | | accountChangeDetailService.saveData(accountChangeDetail); |
| | | |
| | | //补贴中分账 |
| | | Double balance = revenueService.queryCompanyBalance(); |
| | | Double discountedPrice = order.getDiscountedPrice(); |
| | | List<RechargeRecord> rechargeRecords1 = rechargeRecordService.selectList(new EntityWrapper<RechargeRecord>().eq("type", 4).eq("payStatus", 2).gt("surplusDividedAmount", 0).orderBy("createTime")); |
| | | for (RechargeRecord rechargeRecord : rechargeRecords1) { |
| | |
| | | } |
| | | } |
| | | } |
| | | CompanyFundFlow companyFundFlow = new CompanyFundFlow(); |
| | | companyFundFlow.setBalance(new BigDecimal(balance)); |
| | | companyFundFlow.setObjectType(1); |
| | | companyFundFlow.setType(5); |
| | | companyFundFlow.setMoney(new BigDecimal(order.getDiscountedPrice())); |
| | | companyFundFlow.setCreateTime(new Date()); |
| | | companyFundFlowService.insert(companyFundFlow); |
| | | |
| | | } |
| | | // TODO: 2023/6/25 折扣优惠由司机承担 |
| | |
| | | driverService.updateById(driver); |
| | | accountChangeDetailService.saveData(accountChangeDetail); |
| | | //补贴中分账 |
| | | Double balance = revenueService.queryCompanyBalance(); |
| | | Double discountedPrice = order.getDiscountedPrice(); |
| | | List<RechargeRecord> rechargeRecords = rechargeRecordService.selectList(new EntityWrapper<RechargeRecord>().eq("type", 4).eq("payStatus", 2).gt("surplusDividedAmount", 0).orderBy("createTime")); |
| | | for (RechargeRecord rechargeRecord : rechargeRecords) { |
| | |
| | | } |
| | | } |
| | | |
| | | CompanyFundFlow companyFundFlow = new CompanyFundFlow(); |
| | | companyFundFlow.setBalance(new BigDecimal(balance)); |
| | | companyFundFlow.setObjectType(1); |
| | | companyFundFlow.setType(5); |
| | | companyFundFlow.setMoney(new BigDecimal(order.getDiscountedPrice())); |
| | | companyFundFlow.setCreateTime(new Date()); |
| | | companyFundFlowService.insert(companyFundFlow); |
| | | |
| | | } |
| | | } |
| | | |