| | |
| | | import com.ruoyi.order.util.PreviousSixMonths; |
| | | import com.ruoyi.order.util.mongodb.service.UploadRealTimeMonitoringDataService; |
| | | import com.ruoyi.order.vo.EndOfChargePageInfo; |
| | | import com.ruoyi.order.vo.ChargingSimulationVO; |
| | | import com.ruoyi.order.vo.IcbcAdminSubOrderVO; |
| | | import com.ruoyi.order.vo.StatisticsOfBatteryVO; |
| | | import com.ruoyi.order.vo.UpdateOrderPaymentAmountDto; |
| | | import com.ruoyi.order.vo.WatchChargingOrderVo; |
| | |
| | | import com.ruoyi.other.api.feignClient.UserSiteClient; |
| | | import com.ruoyi.payment.api.feignClient.AliPaymentClient; |
| | | import com.ruoyi.payment.api.feignClient.WxPaymentClient; |
| | | import com.ruoyi.payment.api.vo.IcbcPaymentResp; |
| | | import com.ruoyi.payment.api.vo.IcbcRefundResp; |
| | | import com.ruoyi.payment.api.vo.IcbcSubOrderRefundResp; |
| | | import com.ruoyi.system.api.domain.SysUser; |
| | | import com.ruoyi.system.api.feignClient.SysUserClient; |
| | | import com.ruoyi.system.api.feignClient.SysUserRoleClient; |
| | |
| | | public AjaxResult paymentChargingOrder(@RequestBody AddChargingOrder addChargingOrder) { |
| | | return chargingOrderService.paymentChargingOrder(addChargingOrder); |
| | | } |
| | | |
| | | @RequiresPermissions(value = {"/chargingPileOrder", "/paymentOrder/refund"}, logical = Logical.AND) |
| | | @PostMapping("/icbc/fund/payment-query") |
| | | @ApiOperation(value = "管理后台查询工行支付订单", tags = {"后台-充电桩订单"}) |
| | | public AjaxResult<IcbcPaymentResp> queryIcbcAdminPayment(@RequestBody IcbcAdminFundOperationReq request) { |
| | | return AjaxResult.success(chargingOrderService.queryIcbcAdminPayment(request == null ? null : request.getOrderCode())); |
| | | } |
| | | |
| | | @RequiresPermissions(value = {"/chargingPileOrder", "/paymentOrder/refund"}, logical = Logical.AND) |
| | | @PostMapping("/icbc/fund/refund") |
| | | @ApiOperation(value = "管理后台工行主订单退款", tags = {"后台-充电桩订单"}) |
| | | public AjaxResult<IcbcRefundResp> refundIcbcAdminPayment(@RequestBody IcbcAdminFundOperationReq request) { |
| | | return AjaxResult.success(chargingOrderService.refundIcbcAdminPayment(request)); |
| | | } |
| | | |
| | | @RequiresPermissions(value = {"/chargingPileOrder", "/paymentOrder/refund"}, logical = Logical.AND) |
| | | @PostMapping("/icbc/fund/sub-orders") |
| | | @ApiOperation(value = "管理后台查询工行分账子订单", tags = {"后台-充电桩订单"}) |
| | | public AjaxResult<List<IcbcAdminSubOrderVO>> queryIcbcAdminSubOrders(@RequestBody IcbcAdminFundOperationReq request) { |
| | | return AjaxResult.success(chargingOrderService.queryIcbcAdminSubOrders(request == null ? null : request.getOrderCode())); |
| | | } |
| | | |
| | | @RequiresPermissions(value = {"/chargingPileOrder", "/paymentOrder/refund"}, logical = Logical.AND) |
| | | @PostMapping("/icbc/fund/sub-order-refund") |
| | | @ApiOperation(value = "管理后台工行分账子订单退款", tags = {"后台-充电桩订单"}) |
| | | public AjaxResult<IcbcSubOrderRefundResp> refundIcbcAdminSubOrder(@RequestBody IcbcAdminFundOperationReq request) { |
| | | return AjaxResult.success(chargingOrderService.refundIcbcAdminSubOrder(request)); |
| | | } |
| | | |
| | | @ResponseBody |
| | | @GetMapping("/simulation/current") |
| | | @ApiOperation(value = "查询当前枪可模拟结算的工行订单", tags = {"小程序-模拟充电"}) |
| | | public AjaxResult<ChargingSimulationVO> getCurrentSimulationOrder(@RequestParam("gunId") Integer gunId) { |
| | | return AjaxResult.success(chargingOrderService.getCurrentSimulationOrder(gunId)); |
| | | } |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/simulation/complete") |
| | | @ApiOperation(value = "模拟完成充电并执行真实结算", tags = {"小程序-模拟充电"}) |
| | | public AjaxResult<ChargingSimulationVO> completeSimulation(@RequestBody ChargingSimulationReq request) { |
| | | return AjaxResult.success(chargingOrderService.completeSimulation(request)); |
| | | } |
| | | |
| | | /** |
| | | * 充电充值支付回调 |
| | |
| | | public R<List<SixChargingDto>> charge(Integer siteId) { |
| | | Long userId = tokenService.getLoginUser().getUserid(); |
| | | SysUser sysUser = sysUserClient.getSysUser(userId).getData(); |
| | | boolean partnerView = isPartnerView(sysUser); |
| | | List<Integer> siteIds = resolvePlatformRevenueSiteIds(userId, sysUser, siteId); |
| | | LocalDate sixBefore = PreviousSixMonths.get(); |
| | | //通过siteIds进行sql查询统计 |
| | | List<SixChargingDto> sixChargingDtos = generateLastSixMonths(); |
| | | List<SixChargingDto> chargingDtos = chargingOrderService.charge(sixBefore, siteIds); |
| | | List<SixChargingDto> chargingDtos = chargingOrderService.charge(sixBefore, siteIds, partnerView); |
| | | for (SixChargingDto sixChargingDto : sixChargingDtos) { |
| | | for (SixChargingDto chargingDto : chargingDtos) { |
| | | if (sixChargingDto.getMonth().equals(chargingDto.getMonth())){ |
| | |
| | | public R<List<SixCircleDto>> circle() { |
| | | Long userId = tokenService.getLoginUser().getUserid(); |
| | | SysUser sysUser = sysUserClient.getSysUser(userId).getData(); |
| | | boolean partnerView = isPartnerView(sysUser); |
| | | List<Integer> siteIds = resolvePlatformRevenueSiteIds(userId, sysUser, null); |
| | | LocalDate sixBefore = PreviousSixMonths.get(); |
| | | List<SixCircleDto> sixCircleDtos = chargingOrderService.circle(siteIds,sixBefore); |
| | | List<SixCircleDto> sixCircleDtos = chargingOrderService.circle(siteIds,sixBefore, partnerView); |
| | | for (SixCircleDto sixCircleDto : sixCircleDtos) { |
| | | Site site = siteClient.getSiteByIds(Arrays.asList(sixCircleDto.getSiteId())).getData().get(0); |
| | | sixCircleDto.setSiteName(site.getName()); |
| | |
| | | //count近6个月的数据 |
| | | Long userId = tokenService.getLoginUser().getUserid(); |
| | | SysUser sysUser = sysUserClient.getSysUser(userId).getData(); |
| | | boolean partnerView = isPartnerView(sysUser); |
| | | List<Integer> siteIds = resolvePlatformRevenueSiteIds(userId, sysUser, null); |
| | | Map<String,Object> map = chargingOrderService.countAll(siteIds); |
| | | boolean platformVisible = 1 == sysUser.getObjectId(); |
| | | Map<String,Object> map = chargingOrderService.countAll(siteIds, partnerView); |
| | | if (map == null) { |
| | | map = new HashMap<String,Object>(); |
| | | } |
| | | boolean platformVisible = !partnerView; |
| | | if(platformVisible){ |
| | | BigDecimal data = parkingLotClient.getRecordAmount().getData(); |
| | | if (map ==null){ |
| | | map = new HashMap<String,Object>(); |
| | | } |
| | | map.put("parkingAmount",data); |
| | | BigDecimal data1 = shoppingOrderService.getSumAmount(); |
| | | map.put("shopAmount",data1); |
| | |
| | | public R<List<SixIncomeCircleDto>> payTypeCircle() { |
| | | Long userId = tokenService.getLoginUser().getUserid(); |
| | | SysUser sysUser = sysUserClient.getSysUser(userId).getData(); |
| | | boolean partnerView = isPartnerView(sysUser); |
| | | List<Integer> siteIds = resolvePlatformRevenueSiteIds(userId, sysUser, null); |
| | | LocalDate sixBefore = PreviousSixMonths.get(); |
| | | return R.ok(chargingOrderService.payTypeCircle(sixBefore, siteIds)); |
| | | return R.ok(chargingOrderService.payTypeCircle(sixBefore, siteIds, partnerView)); |
| | | } |
| | | |
| | | private boolean isPartnerView(SysUser sysUser) { |
| | | return sysUser != null && Integer.valueOf(2).equals(sysUser.getRoleType()); |
| | | } |
| | | |
| | | /** |