Merge remote-tracking branch 'origin/master'
| | |
| | | StatusModeStatisticsVO statusModeStatistics1 = this.baseMapper.getStatusModeStatistics(siteIds,1); |
| | | StatusModeStatisticsVO statusModeStatistics2 = this.baseMapper.getStatusModeStatistics(siteIds,2); |
| | | StatusModeStatisticsVO statusModeStatistics3 = this.baseMapper.getStatusModeStatistics(siteIds,3); |
| | | if (statusModeStatistics1==null){ |
| | | StatusModeStatisticsVO vo = new StatusModeStatisticsVO(); |
| | | vo.setChargeMode(1); |
| | | vo.setFreeCount(0); |
| | | vo.setFilledCount(0); |
| | | vo.setInsertCount(0); |
| | | vo.setChargingCount(0); |
| | | statusModeStatistics1 =vo; |
| | | } |
| | | statusModeStatisticsVOS.add(statusModeStatistics1); |
| | | if (statusModeStatistics2==null){ |
| | | StatusModeStatisticsVO vo = new StatusModeStatisticsVO(); |
| | | vo.setChargeMode(2); |
| | | vo.setFreeCount(0); |
| | | vo.setFilledCount(0); |
| | | vo.setInsertCount(0); |
| | | vo.setChargingCount(0); |
| | | statusModeStatistics2 =vo; |
| | | } |
| | | statusModeStatisticsVOS.add(statusModeStatistics2); |
| | | |
| | | if (statusModeStatistics3==null){ |
| | | StatusModeStatisticsVO vo = new StatusModeStatisticsVO(); |
| | | vo.setChargeMode(3); |
| | | vo.setFreeCount(0); |
| | | vo.setFilledCount(0); |
| | | vo.setInsertCount(0); |
| | | vo.setChargingCount(0); |
| | | statusModeStatistics3 =vo; |
| | | } |
| | | statusModeStatisticsVOS.add(statusModeStatistics3); |
| | | gunStatusStatisticsVO.setStatusModeStatistics(statusModeStatisticsVOS); |
| | | return gunStatusStatisticsVO; |
| | |
| | | brands.add(objectMap.get("vehicle_brand").toString()); |
| | | } |
| | | |
| | | if (carBrandMap.size()>=5) { |
| | | Long count = chargingOrderService.countCar(brands); |
| | | Map<String, Object> others = new HashMap<>(); |
| | | others.put("vehicle_brand","其他"); |
| | | others.put("counts",count); |
| | | carBrandMap.add(others); |
| | | } |
| | | //本地车数量 |
| | | Map<String,Object> localCarMap = chargingOrderService.countLocalCar(); |
| | | |
| | |
| | | select count(1) |
| | | from |
| | | charging_pile_account.t_app_user_car |
| | | where del_flag = 0 and vehicle_brand not in |
| | | where del_flag = 0 |
| | | |
| | | <if test="brands != null and brands.size() > 0"> |
| | | and vehicle_brand not in |
| | | <foreach collection="brands" item="brand" open="(" separator="," close=")"> |
| | | #{brand} |
| | | </foreach> |
| | | </if> |
| | | </select> |
| | | </mapper> |
| | |
| | | import com.ruoyi.other.service.TActivityService; |
| | | import com.ruoyi.other.service.TCouponService; |
| | | import com.ruoyi.other.service.TGoodsService; |
| | | import com.ruoyi.payment.api.feignClient.AliPaymentClient; |
| | | import com.ruoyi.payment.api.feignClient.WxPaymentClient; |
| | | import com.ruoyi.payment.api.vo.AliPaymentReq; |
| | | import com.ruoyi.payment.api.vo.AliPaymentResp; |
| | | import com.ruoyi.payment.api.vo.PaymentOrder; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | |
| | | } |
| | | |
| | | @Resource |
| | | private AliPaymentClient aliPaymentClient; |
| | | |
| | | @ApiOperation(tags = {"小程序-现金商城"},value = "支付商品") |
| | | @PostMapping(value = "/app/pay") |
| | | public R<Map<String, Object>> pay(@RequestBody ExchangeDto exchangeDto) { |
| | | public Object pay(@RequestBody ExchangeDto exchangeDto) { |
| | | Long userId = tokenService.getLoginUserApplet().getUserId(); |
| | | TAppUser user = appUserClient.getUserById(userId).getData(); |
| | | boolean isVip = false; |
| | |
| | | mapR.getData().put("orderId",shopOrder.getId().toString()); |
| | | return mapR; |
| | | }else { |
| | | //todo 罗 支付宝支付 |
| | | return R.ok(); |
| | | AliPaymentReq req = new AliPaymentReq(); |
| | | req.setOutTradeNo(shopOrder.getCode()); |
| | | req.setTotalAmount(shopOrder.getPaymentAmount().toString()); |
| | | req.setSubject("购买商品"); |
| | | req.setBuyerOpenId(user.getAliOpenid()); |
| | | req.setBody("购买商品"); |
| | | AliPaymentResp data = aliPaymentClient.payment(req).getData(); |
| | | if(null != data){ |
| | | data.setNotifyUrl(data.getNotifyUrl() + "/payment/callBack/ali/all"); |
| | | return AjaxResult.success(data); |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | @ApiOperation(value = "购买会员", tags = {"小程序-个人中心"}) |
| | | @GetMapping("/vipInfo/pay") |
| | | public R vipInfoPay(@RequestParam("vipId")Integer vipId,@RequestParam("buyType") Integer buyType, |
| | | public Object vipInfoPay(@RequestParam("vipId")Integer vipId,@RequestParam("buyType") Integer buyType, |
| | | @RequestParam("payType") Integer payType |
| | | ) { |
| | | |
| | |
| | | |
| | | Long userId = tokenService.getLoginUserApplet().getUserId(); |
| | | |
| | | return R.ok(vipService.vipInfoPay(byId,payMoney,payType,discountMoney,discount,buyType,userId)); |
| | | return vipService.vipInfoPay(byId,payMoney,payType,discountMoney,discount,buyType,userId); |
| | | } |
| | | } |
| | | |
| | |
| | | package com.ruoyi.other.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.other.api.domain.TVip; |
| | | |
| | |
| | | paymentOrder.setAmount(shopOrder.getPaymentAmount()); |
| | | paymentOrder.setOpenId(user.getWxOpenid()); |
| | | paymentOrder.setDescription("购买会员"); |
| | | return wxPaymentClient.orderPay(paymentOrder).getData(); |
| | | return AjaxResult.success(wxPaymentClient.orderPay(paymentOrder).getData()); |
| | | }else { |
| | | AliPaymentReq req = new AliPaymentReq(); |
| | | req.setOutTradeNo(shopOrder.getCode()); |
| | |
| | | req.setBody("充电充值"); |
| | | AliPaymentResp data = aliPaymentClient.payment(req).getData(); |
| | | if(null != data){ |
| | | data.setNotifyUrl(data.getNotifyUrl() + "/callBack/ali/all"); |
| | | data.setNotifyUrl(data.getNotifyUrl() + "/payment/callBack/ali/all"); |
| | | return AjaxResult.success(data); |
| | | } |
| | | } |
| | |
| | | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.order.api.feignClient.ChargingOrderClient; |
| | | import com.ruoyi.order.api.feignClient.OrderClient; |
| | | import com.ruoyi.payment.ali.config.AliProperties; |
| | | import com.ruoyi.payment.ali.v2.AppletPayUtil; |
| | | import com.ruoyi.payment.api.model.*; |
| | |
| | | } |
| | | |
| | | |
| | | @Resource |
| | | private OrderClient orderClient; |
| | | @Resource |
| | | private ChargingOrderClient chargingOrderClient; |
| | | @ResponseBody |
| | | @PostMapping(value = "/allCallBack") |
| | | @PostMapping(value = "/all") |
| | | public void chargingOrderALICallback(@RequestBody AliQueryOrder aliQueryOrder, HttpServletResponse response) { |
| | | try { |
| | | String out_trade_no = aliQueryOrder.getOutTradeNo(); |
| | | String transaction_id = aliQueryOrder.getTradeNo(); |
| | | String attach = aliQueryOrder.getPassbackParams(); |
| | | // AjaxResult ajaxResult = chargingOrderService.chargingOrderCallback(2, out_trade_no, transaction_id, attach); |
| | | // if (ajaxResult.isSuccess()) { |
| | | // PrintWriter writer = response.getWriter(); |
| | | // writer.println("success"); |
| | | // writer.flush(); |
| | | // writer.close(); |
| | | // } |
| | | String substring = out_trade_no.substring(0, 2); |
| | | switch (substring){ |
| | | //购物订单 |
| | | case "GW": |
| | | R r = orderClient.callBack(out_trade_no, transaction_id); |
| | | System.err.println("----收到购物回调"); |
| | | break; |
| | | case "HY": |
| | | orderClient.vipCallBack(out_trade_no,transaction_id); |
| | | System.err.println("----收到会员回调"); |
| | | break; |
| | | case "CD": |
| | | chargingOrderClient.chargingOrderWXCallback(out_trade_no, transaction_id, attach); |
| | | System.err.println("----充电支付回调"); |
| | | break; |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |