Merge branch 'master' of http://120.76.84.145:10101/gitblit/r/java/mx_charging_pile
| | |
| | | |
| | | @PostMapping("/t-exchange-order/create") |
| | | public R<ExchangeBackDto> exchangeCreate(@RequestBody ExchangeDto exchangeDto); |
| | | @PostMapping("/t-vip-order//addVipOrder") |
| | | @PostMapping("/t-vip-order/addVipOrder1") |
| | | public R<Long> addVipOrder(@RequestBody TVipOrder vipOrder); |
| | | @PostMapping("/t-shopping-order/create") |
| | | public R<TShoppingOrder> shopCreate(@RequestBody ExchangeDto exchangeDto); |
| | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "主键") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | @TableId(value = "id", type = IdType.NONE) |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "订单编号") |
| | |
| | | @Data |
| | | public class RefundResp { |
| | | /** |
| | | * 支付宝交易号 |
| | | * 状态 |
| | | */ |
| | | @JsonSetter("code") |
| | | private String code; |
| | | /** |
| | | * 描述 |
| | | */ |
| | | @JsonSetter("msg") |
| | | private String msg; |
| | | /** |
| | | * 退款时间 |
| | | */ |
| | | @JsonSetter("gmt_refund_pay") |
| | | private String gmtRefundPay; |
| | | /** |
| | | * 支付宝退款交易号 |
| | | */ |
| | | @JsonSetter("trade_no") |
| | | private String tradeNo; |
| | |
| | | public R giveVip(@RequestBody GiveVipDto giveVipDto) { |
| | | String[] split = giveVipDto.getUserIds().split(","); |
| | | for (String s : split) { |
| | | |
| | | |
| | | TAppUser nowUser = appUserService.getById(s); |
| | | |
| | | int plusDay = 0; |
| | | if (giveVipDto.getType() == 1) { |
| | | plusDay = 1; |
| | | } else if (giveVipDto.getType() == 2) { |
| | | plusDay = 3; |
| | | } else if (giveVipDto.getType() == 3) { |
| | | plusDay = 12; |
| | | } |
| | | TAppUser nowUser = appUserService.getById(s); |
| | | int plusDay = 0; |
| | | if (giveVipDto.getType() == 1) { |
| | | plusDay = 1; |
| | | } else if (giveVipDto.getType() == 2) { |
| | | plusDay = 3; |
| | | } else if (giveVipDto.getType() == 3) { |
| | | plusDay = 12; |
| | | } |
| | | BigDecimal bigDecimal = new BigDecimal("0"); |
| | | TVip info = vipClient.getInfo1(giveVipDto.getVipId()).getData(); |
| | | switch (giveVipDto.getType()){ |
| | | case 1: |
| | | bigDecimal = bigDecimal.add(info.getMonthlyCard()==null?new BigDecimal(0):info.getMonthlyCard()); |
| | | break; |
| | | case 2: |
| | | bigDecimal = bigDecimal.add(info.getSeasonCard()==null?new BigDecimal(0):info.getSeasonCard()); |
| | | break; |
| | | case 3: |
| | | bigDecimal = bigDecimal.add(info.getAnnualCard()==null?new BigDecimal(0):info.getAnnualCard()); |
| | | break; |
| | | } |
| | | switch (giveVipDto.getType()){ |
| | | case 1: |
| | | bigDecimal = bigDecimal.add(info.getMonthlyCard()==null?new BigDecimal(0):info.getMonthlyCard()); |
| | | break; |
| | | case 2: |
| | | bigDecimal = bigDecimal.add(info.getSeasonCard()==null?new BigDecimal(0):info.getSeasonCard()); |
| | | break; |
| | | case 3: |
| | | bigDecimal = bigDecimal.add(info.getAnnualCard()==null?new BigDecimal(0):info.getAnnualCard()); |
| | | break; |
| | | } |
| | | //增加vipDetail |
| | | giveVipUtil.sendVip(nowUser, giveVipDto.getVipId(),plusDay,giveVipDto.getType()); |
| | | appUserService.updateById(nowUser); |
| | | // 新增后台赠送记录 |
| | | giveVipUtil.sendVip(nowUser, giveVipDto.getVipId(),plusDay,giveVipDto.getType()); |
| | | appUserService.updateById(nowUser); |
| | | // 新增后台赠送记录 |
| | | TGrantVip tGrantVip = new TGrantVip(); |
| | | tGrantVip.setCode(OrderCodeUtil.getOrderCode("ZS")); |
| | | tGrantVip.setAppUserId(nowUser.getId()); |
| | |
| | | if (count==0){ |
| | | R<TIntegralRule> set = integralRuleClient.getSet(); |
| | | TIntegralRule data = set.getData(); |
| | | JSONObject jsonObject = JSON.parseObject(data.getAddVehiclesEarnsPoints()); |
| | | |
| | | |
| | | Integer point = 0; |
| | | //增加车牌50分,必填 |
| | | if(null != data){ |
| | | JSONObject jsonObject = JSON.parseObject(data.getAddVehiclesEarnsPoints()); |
| | | Integer point = 0; |
| | | //增加车牌50分,必填 |
| | | point = point+jsonObject.getInteger("num1"); |
| | | if (doubleVip){ |
| | | point = point+jsonObject.getInteger("num1"); |
| | | } |
| | | //增加车型分 |
| | | //增加车型分 |
| | | if (StringUtils.isNotEmpty(appUserCar.getVehicleModel())){ |
| | | point = point+jsonObject.getInteger("num2"); |
| | | if (doubleVip){ |
| | | point = point+jsonObject.getInteger("num2"); |
| | | } |
| | | } |
| | | //增加车辆用途分 |
| | | //增加车辆用途分 |
| | | if (StringUtils.isNotEmpty(appUserCar.getVehicleUse())){ |
| | | point = point+jsonObject.getInteger("num3"); |
| | | if (doubleVip){ |
| | | point = point+jsonObject.getInteger("num3"); |
| | | } |
| | | } |
| | | //增加续航分 |
| | | //增加续航分 |
| | | if (StringUtils.isNotEmpty(appUserCar.getEndurance())){ |
| | | point = point+jsonObject.getInteger("num4"); |
| | | if (doubleVip){ |
| | | point = point+jsonObject.getInteger("num4"); |
| | | } |
| | | } |
| | | |
| | | //增加积分记录 |
| | | pointDetailUtil.addDetail(byId.getPoints(),byId.getPoints()+point,5,userId,appUserCar.getLicensePlate(),"",""); |
| | | byId.setPoints(byId.getPoints()+point); |
| | | |
| | | //增加积分记录 |
| | | pointDetailUtil.addDetail(byId.getPoints(),byId.getPoints()+point,5,userId,appUserCar.getLicensePlate(),"",""); |
| | | byId.setPoints(byId.getPoints()+point); |
| | | } |
| | | byId.setFirstAdd(1); |
| | | |
| | | |
| | | } |
| | | CarNumDto carNumDto = CarUtil.carNum(appUserCar.getLicensePlate()); |
| | | if (carNumDto==null){ |
| | |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.ruoyi.chargingPile.api.dto.TChargingGunDTO; |
| | | import com.ruoyi.chargingPile.api.model.TChargingGun; |
| | | import com.ruoyi.account.api.dto.SendMessageDTO; |
| | | import com.ruoyi.account.api.feignClient.AppUserClient; |
| | | import com.ruoyi.chargingPile.api.model.Site; |
| | | import com.ruoyi.chargingPile.api.model.TChargingPile; |
| | | import com.ruoyi.chargingPile.api.model.TFaultMessage; |
| | | import com.ruoyi.chargingPile.service.ISiteService; |
| | | import com.ruoyi.chargingPile.service.TChargingPileNotificationService; |
| | | import com.ruoyi.chargingPile.service.TChargingPileService; |
| | | import com.ruoyi.chargingPile.service.TFaultMessageService; |
| | | import com.ruoyi.common.core.domain.R; |
| | |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | public class TFaultMessageController { |
| | | |
| | | private final TFaultMessageService faultMessageService; |
| | | |
| | | private final ISiteService siteService; |
| | | private final TChargingPileService chargingPileService; |
| | | private final TChargingPileNotificationService chargingPileNotificationService; |
| | | @Resource |
| | | private AppUserClient appUserClient; |
| | | @Autowired |
| | | public TFaultMessageController(TFaultMessageService faultMessageService) { |
| | | public TFaultMessageController(TFaultMessageService faultMessageService, ISiteService siteService, TChargingPileService chargingPileService, TChargingPileNotificationService chargingPileNotificationService) { |
| | | this.faultMessageService = faultMessageService; |
| | | this.siteService = siteService; |
| | | this.chargingPileService = chargingPileService; |
| | | this.chargingPileNotificationService = chargingPileNotificationService; |
| | | } |
| | | |
| | | /** |
| | |
| | | faultMessageService.add(dto); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取故障信息列表 |
| | | * @param siteId |
| | |
| | | @PostMapping("/createFaultMessage") |
| | | public R<String> createFaultMessage(@RequestBody TFaultMessage faultMessage){ |
| | | faultMessageService.save(faultMessage); |
| | | |
| | | Site site = siteService.getById(faultMessage.getSiteId()); |
| | | TChargingPile chargingPile = chargingPileService.getById(faultMessage.getChargingPileId()); |
| | | String siteName = site.getName(); |
| | | SendMessageDTO sendMessageDTO = new SendMessageDTO(); |
| | | sendMessageDTO.setPhone(site.getPhone()); |
| | | sendMessageDTO.setSite(site.getName()); |
| | | sendMessageDTO.setChargeGun(chargingPile.getNumber() + ""); |
| | | sendMessageDTO.setType(3); |
| | | String result = appUserClient.sendMessage(sendMessageDTO).getData(); |
| | | if(siteName.length()>10){ |
| | | siteName = siteName.substring(0,10); |
| | | } |
| | | chargingPileNotificationService.saveData(4,faultMessage.getSiteId(),faultMessage.getChargingPileId(),site.getPhone(),"检测到"+siteName+"..."+chargingPile.getNumber()+"号桩设备离线,请及时查看处理!"); |
| | | return R.ok(); |
| | | } |
| | | /** |
| | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.account.api.dto.SendMessageDTO; |
| | | import com.ruoyi.account.api.feignClient.AppUserCarClient; |
| | | import com.ruoyi.account.api.feignClient.AppUserClient; |
| | | import com.ruoyi.account.api.model.TAppUserCar; |
| | | import com.ruoyi.chargingPile.api.dto.PageChargingPileListDTO; |
| | | import com.ruoyi.chargingPile.api.model.*; |
| | |
| | | private SendMessageClient sendMessageClient; |
| | | @Resource |
| | | private TokenService tokenService; |
| | | @Resource |
| | | private TChargingPileNotificationService chargingPileNotificationService; |
| | | |
| | | @Resource |
| | | private AppUserClient appUserClient; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取充电桩列表数据 |
| | | * @param page |
| | |
| | | return AjaxResult.error("设备编号已存在"); |
| | | } |
| | | TChargingPile tChargingPile = this.getById(chargingPile.getId()); |
| | | ShowDeviceResp showDeviceResp = iotInterfaceClient.showDeviceRequest(tChargingPile.getCode()).getData(); |
| | | if(null != showDeviceResp){ |
| | | DeleteDeviceResp deleteDeviceResp = iotInterfaceClient.deleteDevice(tChargingPile.getCode()).getData(); |
| | | if(null == deleteDeviceResp || (deleteDeviceResp.getHttpStatusCode() != 200 && deleteDeviceResp.getHttpStatusCode() != 201 && deleteDeviceResp.getHttpStatusCode() != 204)){ |
| | | return AjaxResult.error("删除设备异常,请查看华为设备管理"); |
| | | //桩号不相同,需要重新绑定设备 |
| | | if(!tChargingPile.getCode().equals(chargingPile.getCode())){ |
| | | ShowDeviceResp showDeviceResp = iotInterfaceClient.showDeviceRequest(tChargingPile.getCode()).getData(); |
| | | if(null != showDeviceResp){ |
| | | DeleteDeviceResp deleteDeviceResp = iotInterfaceClient.deleteDevice(tChargingPile.getCode()).getData(); |
| | | if(null == deleteDeviceResp){ |
| | | return AjaxResult.error("删除设备异常,请查看华为设备管理"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | //调用华为Iot创建设备 |
| | | AddDevice addDevice = new AddDevice(); |
| | | addDevice.setProductId("66da68d21837002b28b34ec0"); |
| | | addDevice.setNodeId(chargingPile.getCode()); |
| | | addDevice.setDeviceName(chargingPile.getName()); |
| | | addDevice.setDescription(chargingPile.getNumber().toString()); |
| | | AddDeviceResp deviceResp = iotInterfaceClient.addDevice(addDevice).getData(); |
| | | if(null != deviceResp){ |
| | | int httpStatusCode = deviceResp.getHttpStatusCode(); |
| | | if(httpStatusCode == 201){ |
| | | chargingPile.setIotdDeviceId(deviceResp.getDeviceId()); |
| | | ShowDeviceResp showDeviceResp = iotInterfaceClient.showDeviceRequest(tChargingPile.getCode()).getData(); |
| | | if(null == showDeviceResp){ |
| | | //调用华为Iot创建设备 |
| | | AddDevice addDevice = new AddDevice(); |
| | | addDevice.setProductId("66da68d21837002b28b34ec0"); |
| | | addDevice.setNodeId(chargingPile.getCode()); |
| | | addDevice.setDeviceName(chargingPile.getName()); |
| | | addDevice.setDescription(chargingPile.getNumber().toString()); |
| | | AddDeviceResp deviceResp = iotInterfaceClient.addDevice(addDevice).getData(); |
| | | if(null != deviceResp){ |
| | | int httpStatusCode = deviceResp.getHttpStatusCode(); |
| | | if(httpStatusCode == 201){ |
| | | chargingPile.setIotdDeviceId(deviceResp.getDeviceId()); |
| | | }else{ |
| | | log.error("华为创建设备失败" + JSON.toJSONString(deviceResp)); |
| | | return AjaxResult.error("华为创建设备失败"); |
| | | } |
| | | }else{ |
| | | log.error("华为创建设备失败" + JSON.toJSONString(deviceResp)); |
| | | return AjaxResult.error("华为创建设备失败"); |
| | | } |
| | | }else{ |
| | | return AjaxResult.error("华为创建设备失败"); |
| | | } |
| | | this.updateById(chargingPile); |
| | | |
| | |
| | | } |
| | | chargingPile.setIotdDeviceId(""); |
| | | } |
| | | |
| | | |
| | | } |
| | | this.removeById(chargingPile); |
| | | } |
| | |
| | | faultMessage.setDelFlag(false); |
| | | faultMessage.setContent("设备离线"); |
| | | faultMessageService.save(faultMessage); |
| | | |
| | | // 发送故障短信 |
| | | Site site = siteService.getById(faultMessage.getSiteId()); |
| | | String siteName = site.getName(); |
| | | SendMessageDTO sendMessageDTO = new SendMessageDTO(); |
| | | sendMessageDTO.setPhone(site.getPhone()); |
| | | sendMessageDTO.setSite(site.getName()); |
| | | sendMessageDTO.setChargeGun(chargingPile.getNumber() + ""); |
| | | sendMessageDTO.setType(3); |
| | | String result = appUserClient.sendMessage(sendMessageDTO).getData(); |
| | | if(siteName.length()>10){ |
| | | siteName = siteName.substring(0,10); |
| | | } |
| | | chargingPileNotificationService.saveData(4,faultMessage.getSiteId(),faultMessage.getChargingPileId(),site.getPhone(),"检测到"+siteName+"..."+chargingPile.getNumber()+"号桩设备离线,请及时查看处理!"); |
| | | |
| | | } |
| | | } |
| | | } |
| | |
| | | // String result = HttpUtils.post(MsgConstants.SEND_URL, reqStr); |
| | | SendMessageDTO sendMessageDTO = new SendMessageDTO(); |
| | | sendMessageDTO.setPhone(site.getPhone()); |
| | | sendMessageDTO.setCode(site.getName()); |
| | | sendMessageDTO.setSite(site.getName()); |
| | | sendMessageDTO.setChargeGun(chargingPile.getNumber() + ""); |
| | | sendMessageDTO.setType(3); |
| | | String result = appUserClient.sendMessage(sendMessageDTO).getData(); |
| | |
| | | pong.setCharging_pile_code(pingMessage.getCharging_pile_code()); |
| | | pong.setCharging_gun_code(pingMessage.getCharging_gun_code()); |
| | | pong.setCharging_gun_status(0); |
| | | result = iotMessageProduce.sendMessage(pong.getCharging_pile_code(), ServiceIdMenu.PONG.getKey(), messageUtil.pong(pong)); |
| | | log.info("充电桩心跳包-返回结果:{}",result); |
| | | iotMessageProduce.sendMessage(pong.getCharging_pile_code(), ServiceIdMenu.PONG.getKey(), messageUtil.pong(pong)); |
| | | sendResult = enhanceProduce.chargingMessage(chargingMessage); |
| | | break; |
| | | case SendTagConstant.END_CHARGE: |
| | |
| | | break; |
| | | case SendTagConstant.TRANSACTION_RECORD: |
| | | TransactionRecordMessage transactionRecordMessage = JSON.parseObject(content.toJSONString(),TransactionRecordMessage.class); |
| | | transactionRecordMessage.setResult(content.toJSONString()); |
| | | chargingMessage.setTransactionRecordMessage(transactionRecordMessage); |
| | | // 响应硬件 |
| | | ConfirmTransactionRecord confirmTransactionRecord = new ConfirmTransactionRecord(); |
| | |
| | | package com.ruoyi.integration.iotda.utils.produce; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.huaweicloud.sdk.core.exception.ConnectionException; |
| | | import com.huaweicloud.sdk.core.exception.RequestTimeoutException; |
| | |
| | | public String sendMessage(String code, String name, JSONObject message){ |
| | | log.info("消息下发至设备:code={},name={},message={}", code, name, message); |
| | | CreateMessageRequest request = new CreateMessageRequest(); |
| | | System.err.println(code); |
| | | System.err.println(JSONObject.toJSONString(config)); |
| | | request.withDeviceId(code); |
| | | DeviceMessageRequest body = new DeviceMessageRequest(); |
| | | body.withMessageId(UUID.randomUUID().toString()); |
| | |
| | | request.withBody(body); |
| | | try { |
| | | CreateMessageResponse response = iotBuilder.buildIot().createMessage(request); |
| | | System.out.println(response.toString()); |
| | | } catch (ConnectionException e) { |
| | | log.info("消息下发至设备结果:{}", JSON.toJSONString(response)); |
| | | return JSON.toJSONString(response); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } catch (RequestTimeoutException e) { |
| | | e.printStackTrace(); |
| | | } catch (ServiceResponseException e) { |
| | | e.printStackTrace(); |
| | | System.out.println(e.getHttpStatusCode()); |
| | | System.out.println(e.getRequestId()); |
| | | System.out.println(e.getErrorCode()); |
| | | System.out.println(e.getErrorMsg()); |
| | | log.info("消息下发至设备异常:code---{},msg---{}", code, e.getMessage()); |
| | | log.error("消息下发至设备异常:code---{},msg---{}", code, e.getMessage()); |
| | | return e.getMessage(); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | } |
| | |
| | | private BigDecimal valley_charge12;// 谷电量 |
| | | private BigDecimal loss_valley_charge12;// 计损谷电量 |
| | | private BigDecimal valley_amount12;// 谷金额 |
| | | |
| | | private String result;//原始字符串 |
| | | |
| | | } |
| | | |
| | |
| | | private TOrderInvoiceService invoiceService; |
| | | @Resource |
| | | private UploadRealTimeMonitoringDataClient uploadRealTimeMonitoringDataClient; |
| | | @Resource |
| | | private PartnerClient partnerClient; |
| | | @Resource |
| | | private SysUserClient sysUserClient; |
| | | |
| | | |
| | | |
| | |
| | | return R.ok(map); |
| | | } |
| | | |
| | | @Resource |
| | | private PartnerClient partnerClient; |
| | | @Resource |
| | | private SysUserClient sysUserClient; |
| | | |
| | | @RequiresPermissions(value = {"/chargeOrderMonitoring"}, logical = Logical.OR) |
| | | @ResponseBody |
| | | @PostMapping(value = "/watch/chargingOrder") |
| | |
| | | } |
| | | |
| | | |
| | | @PostMapping("/addVipOrder1") |
| | | public R<Long> addVipOrder1(@RequestBody TVipOrder dto) { |
| | | if (dto.getId()!=null){ |
| | | List<TVipOrder> list = vipOrderService.lambdaQuery().eq(TVipOrder::getCode, dto.getCode()) |
| | | .ne(TVipOrder::getId, dto.getId()).list(); |
| | | if (!list.isEmpty())return R.fail("订单编号已存在"); |
| | | }else{ |
| | | List<TVipOrder> list = vipOrderService.lambdaQuery().eq(TVipOrder::getCode, dto.getCode()).list(); |
| | | if (!list.isEmpty())return R.fail("订单编号已存在"); |
| | | } |
| | | vipOrderService.saveOrUpdate(dto); |
| | | return R.ok(dto.getId()); |
| | | } |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/vipOrder/del"}, logical = Logical.OR) |
| | | @GetMapping("/deleteVipOrder") |
| | | @ApiOperation(value = "批量删除会员订单", tags = {"管理后台-会员订单"}) |
| | |
| | | |
| | | @PostMapping("/callBack") |
| | | public R callBack(@RequestParam("code")String code,@RequestParam("outTradeNo")String outTradeNo){ |
| | | |
| | | TVipOrder one = vipOrderService.lambdaQuery().eq(TVipOrder::getCode, code).one(); |
| | | one.setSerialNumber(outTradeNo); |
| | | one.setPaymentStatus(2); |
| | |
| | | giveVipDto.setVipId(one.getVipId()); |
| | | giveVipDto.setType(one.getVipType()); |
| | | giveVipDto.setUserIds(one.getAppUserId().toString()); |
| | | |
| | | |
| | | |
| | | appUserClient.giveVip(giveVipDto); |
| | | |
| | | return R.ok(); |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | TChargingGun chargingGun = chargingGunClient.getChargingGunByCode(code).getData(); |
| | | TChargingOrder order = this.getOne(new LambdaQueryWrapper<TChargingOrder>().eq(TChargingOrder::getChargingGunId, chargingGun.getId()) |
| | | .orderByDesc(TChargingOrder::getEndTime).eq(TChargingOrder::getRechargePaymentStatus, 2).last(" limit 0, 1")); |
| | | if(null != order && order.getStatus() != 3){ |
| | | if(null != order && order.getStatus() != 4){ |
| | | return; |
| | | } |
| | | |
| | |
| | | referralReward(chargingOrder); |
| | | |
| | | //开始构建退款费用 |
| | | refundAmount = refundAmount.setScale(2, RoundingMode.HALF_EVEN); |
| | | if(refundAmount.compareTo(BigDecimal.ZERO) > 0){ |
| | | Integer rechargePaymentType = chargingOrder.getRechargePaymentType(); |
| | | //构建退款明细 |
| | |
| | | if(2 == rechargePaymentType){ |
| | | RefundReq dto = new RefundReq(); |
| | | dto.setOutTradeNo(chargingOrder.getCode()); |
| | | dto.setOutRequestNo(chargingOrderRefund.getCode()); |
| | | dto.setOutRequestNo(chargingOrderRefund.getRefundCode()); |
| | | dto.setRefundAmount(refundAmount.toString()); |
| | | dto.setRefundReason("充电完成退款"); |
| | | RefundResp resp = aliPaymentClient.refund(dto).getData(); |
| | | if(null != resp){ |
| | | AjaxResult success = chargingOrderStartupFailureWxRefund(resp.getOutTradeNo(), resp.getTradeNo(), "SUCCESS", null); |
| | | if(success.isSuccess()){ |
| | | chargingOrderRefundService.save(chargingOrderRefund); |
| | | } |
| | | chargingOrderRefundService.save(chargingOrderRefund); |
| | | this.chargingOrderStartupFailureWxRefund(chargingOrderRefund.getRefundCode(), resp.getTradeNo(), "SUCCESS", null); |
| | | } |
| | | } |
| | | |
| | |
| | | siteIds = data; |
| | | } |
| | | } |
| | | }else{ |
| | | siteIds.add(pageList.getSiteId()); |
| | | } |
| | | if (siteIds.isEmpty()){ |
| | | siteIds.add(-1); |
| | | }else{ |
| | | List<Integer> integers = new ArrayList<>(); |
| | | for (Integer siteId : siteIds) { |
| | | // 校验有没有这个站点的权限 |
| | | List<Boolean> t1= partnerClient.chargeEvaluation(sysUser.getObjectId(),siteId).getData(); |
| | | Boolean b = t1.get(0); |
| | | if (b){ |
| | | integers.add(siteId); |
| | | } |
| | | } |
| | | siteIds = integers; |
| | | } |
| | | if (siteIds.isEmpty()){ |
| | | siteIds.add(-1); |
| | | } |
| | | List<GetOrderEvaluatePageListDTO> list = this.baseMapper.getPageList(pageList, evaluationTagIds, siteIds, pageInfo); |
| | | for (GetOrderEvaluatePageListDTO dto : list) { |
| | |
| | | <if test="null != query.content and '' != query.content"> |
| | | and a.content like CONCAT('%', #{query.content}, '%') |
| | | </if> |
| | | <if test="null != query.evaluateType"> |
| | | <if test="null != evaluationTagIds and evaluationTagIds.size() > 0"> |
| | | and a.id in (select order_evaluate_id from t_order_evaluate_tag where evaluation_tag_id in |
| | | <foreach collection="evaluationTagIds" item="item" index="index" open="(" separator="," close=")"> |
| | | #{item} |
| | |
| | | } |
| | | |
| | | |
| | | @GetMapping("/getInfo1") |
| | | @ApiOperation(tags = {"小程序-积分管理"},value = "type 1=积分规则说明," + |
| | | "2=会员折扣说明," + |
| | | "3=优惠券说明," + |
| | | "4=双倍积分说明," + |
| | | "5=商城专享价说明," + |
| | | "6=会员协议," + |
| | | "7=用户协议," + |
| | | "8=隐私协议," + |
| | | "9=邀请好友说明," + |
| | | "10=资质证明," + |
| | | "11=开票说明") |
| | | public R<String> getInfo1(Integer type) { |
| | | THtml g = htmlService.getOne(new QueryWrapper<THtml>().eq("type",type)); |
| | | if (g == null){ |
| | | return R.ok(""); |
| | | } |
| | | return R.ok(g.getContent()); |
| | | } |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/vipSetting/html"}, logical = Logical.OR) |
| | | @PostMapping("/saveInfo") |
| | |
| | | payMoney = byId.getMonthlyCard(); |
| | | } |
| | | break; |
| | | case 2: |
| | | if (byId.getSeasonCardDiscountStart()!=null&&(now.isAfter(byId.getSeasonCardDiscountStart())&&now.isBefore(byId.getSeasonCardDiscountEnd()))){ |
| | | payMoney = byId.getSeasonCard().multiply(byId.getSeasonCardDiscount().divide(new BigDecimal(10))); |
| | | discountMoney = byId.getSeasonCard().subtract(payMoney); |
| | | discount = byId.getSeasonCardDiscount(); |
| | | }else { |
| | | payMoney = byId.getSeasonCard(); |
| | | } |
| | | case 2: |
| | | if (byId.getSeasonCardDiscountStart()!=null&&(now.isAfter(byId.getSeasonCardDiscountStart())&&now.isBefore(byId.getSeasonCardDiscountEnd()))){ |
| | | payMoney = byId.getSeasonCard().multiply(byId.getSeasonCardDiscount().divide(new BigDecimal(10))); |
| | | discountMoney = byId.getSeasonCard().subtract(payMoney); |
| | | discount = byId.getSeasonCardDiscount(); |
| | | }else { |
| | | payMoney = byId.getSeasonCard(); |
| | | } |
| | | break; |
| | | case 3: |
| | | if (byId.getAnnualCardDiscountStart()!=null&&(now.isAfter(byId.getAnnualCardDiscountStart())&&now.isBefore(byId.getAnnualCardDiscountEnd()))){ |
| | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.ruoyi.account.api.feignClient.AppUserClient; |
| | | import com.ruoyi.account.api.model.TAppUser; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.utils.OrderCodeUtil; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | |
| | | @Override |
| | | public Object vipInfoPay(TVip byId, BigDecimal payMoney, Integer payType,BigDecimal discountMoney,BigDecimal discount,Integer buyType, Long userId) { |
| | | TAppUser user = appUserClient.getUserById(userId).getData(); |
| | | |
| | | |
| | | //生成会员购买订单 |
| | | |
| | | TVipOrder shopOrder = new TVipOrder(); |
| | | shopOrder.setCode(OrderCodeUtil.getOrderCode("HY")); |
| | | shopOrder.setType(1); |
| | | |
| | | shopOrder.setAppUserId(userId); |
| | | shopOrder.setType(1); |
| | | shopOrder.setVipId(byId.getId()); |
| | |
| | | shopOrder.setPaymentStatus(1); |
| | | shopOrder.setPaymentType(payType); |
| | | shopOrder.setPayTime(LocalDateTime.now()); |
| | | orderClient.addVipOrder(shopOrder).getData(); |
| | | |
| | | |
| | | R<Long> longR = orderClient.addVipOrder(shopOrder); |
| | | if(200 != longR.getCode()){ |
| | | return AjaxResult.error(longR.getMsg()); |
| | | } |
| | | |
| | | if (payType==1){ |
| | | //调起支付 |
| | | PaymentOrder paymentOrder = new PaymentOrder(); |
| | |
| | | return AjaxResult.success(data); |
| | | } |
| | | } |
| | | |
| | | return null; |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.payment.ali.v2; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.alipay.api.AlipayClient; |
| | | import com.alipay.api.AlipayConfig; |
| | | import com.alipay.api.DefaultAlipayClient; |
| | |
| | | log.info("请求参数:{}", req); |
| | | log.info("返回结果:{}", response.getBody()); |
| | | if (response.isSuccess()) { |
| | | return JSON.parseObject(response.getBody(), RefundResp.class); |
| | | JSONObject jsonObject = JSON.parseObject(response.getBody()); |
| | | RefundResp alipay_trade_refund_response = jsonObject.getObject("alipay_trade_refund_response", RefundResp.class); |
| | | return alipay_trade_refund_response; |
| | | } |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |