调整
This commit is contained in:
		
							parent
							
								
									64de90a7f6
								
							
						
					
					
						commit
						fa7f3d2fb4
					
				|  | @ -261,7 +261,15 @@ public class AppVerifyController extends BaseController | |||
|         if(asDeviceService.isLowBattery(order.getSn())){ | ||||
|             return error("低电量不得骑行"); | ||||
|         } | ||||
|         OrderResponse orderResponse =asDeviceService.snSwitch(order); | ||||
|         OrderResponse orderResponse; | ||||
|         // 加锁 | ||||
|         ServiceUtil.assertion(!redisLock.lock(RedisLockKey.SNSWITCH, order.getSn()), "当前车辆使用人数较多,请稍后再试!"); | ||||
|         try { | ||||
|             orderResponse =asDeviceService.snSwitch(order); | ||||
|         } finally { | ||||
|             // 解锁 | ||||
|             redisLock.unlock(RedisLockKey.SNSWITCH, order.getSn()); | ||||
|         } | ||||
|         return success(orderResponse); | ||||
|     } | ||||
| 
 | ||||
|  | @ -705,9 +713,9 @@ public class AppVerifyController extends BaseController | |||
|      * 所有车辆定位 | ||||
|      */ | ||||
|     @GetMapping(value = "/allVehicleInfo") | ||||
|     public AjaxResult allVehicleInfo(String powerStart,String powerEnd, String status,String sort,String areaId,String onlineStatus) | ||||
|     public AjaxResult allVehicleInfo(String powerStart,String powerEnd, String status,String sort,String areaId,String onlineStatus,String typeSort) | ||||
|     { | ||||
|         List<AsDevice> asDevices = asDeviceService.allVehicleInfo(powerStart,powerEnd,status,sort,areaId,onlineStatus); | ||||
|         List<AsDevice> asDevices = asDeviceService.allVehicleInfo(powerStart,powerEnd,status,sort,areaId,onlineStatus,typeSort); | ||||
|         return success(asDevices); | ||||
|     } | ||||
| 
 | ||||
|  |  | |||
|  | @ -13,7 +13,8 @@ public enum RedisLockKey { | |||
| 
 | ||||
|     DEDUCTION("deduction", "押金抵扣"), | ||||
|     EDITPRICE("editPrice", "改价"), | ||||
|     PAYCALLBACK("payCallback", "支付回调"); | ||||
|     PAYCALLBACK("payCallback", "支付回调"), | ||||
|     SNSWITCH("snSwitch", "扫码开锁"); | ||||
| 
 | ||||
|     private final String key; | ||||
|     private final String name; | ||||
|  |  | |||
|  | @ -170,7 +170,7 @@ public interface IAsDeviceService extends IService<AsDevice> | |||
|     /** | ||||
|      * 所有车辆定位 | ||||
|      */ | ||||
|     List<AsDevice> allVehicleInfo(String powerStart, String powerEnd, String status,String sort,String areaId,String onlineStatus); | ||||
|     List<AsDevice> allVehicleInfo(String powerStart, String powerEnd, String status,String sort,String areaId,String onlineStatus,String typeSort); | ||||
| 
 | ||||
|     /** | ||||
|      * 查询车辆数量 | ||||
|  |  | |||
|  | @ -719,7 +719,7 @@ public class AsDeviceServiceImpl extends ServiceImpl<AsDeviceMapper, AsDevice> i | |||
|      * 所有车辆定位 | ||||
|      */ | ||||
|     @Override | ||||
|     public List<AsDevice> allVehicleInfo(String powerStart, String powerEnd, String status,String sort,String areaId,String onlineStatus) { | ||||
|     public List<AsDevice> allVehicleInfo(String powerStart, String powerEnd, String status,String sort,String areaId,String onlineStatus,String typeSort) { | ||||
|         QueryWrapper<AsDevice> wrapper = new QueryWrapper<>(); | ||||
|         if(StrUtil.isNotBlank(areaId)){ | ||||
|             wrapper.eq("area_id",areaId); | ||||
|  | @ -737,9 +737,17 @@ public class AsDeviceServiceImpl extends ServiceImpl<AsDeviceMapper, AsDevice> i | |||
|         if(StrUtil.isNotBlank(onlineStatus)){ | ||||
|             wrapper.in("online_status",onlineStatus); | ||||
|         } | ||||
|         if(StrUtil.isNotBlank(sort)){ | ||||
|         if(StrUtil.isNotBlank(typeSort)){ | ||||
|             if(StrUtil.equals(typeSort,"1")){ | ||||
|                 wrapper.orderBy(true,!StrUtil.equals(sort, "desc"),"sn"); | ||||
|             }else if(StrUtil.equals(typeSort,"2")){ | ||||
|                 wrapper.orderBy(true,!StrUtil.equals(sort, "desc"),"model_id"); | ||||
|             }else if(StrUtil.equals(typeSort,"3")){ | ||||
|                 wrapper.orderBy(true,!StrUtil.equals(sort, "desc"),"vehicle_num"); | ||||
|             }else{ | ||||
|                 wrapper.orderBy(true,!StrUtil.equals(sort, "desc"),"remaining_power"); | ||||
|             } | ||||
|         } | ||||
|         List<AsDevice> asDevices = asDeviceMapper.selectList(wrapper); | ||||
|         for (AsDevice asDevice:asDevices){ | ||||
|             Long modelId = asDevice.getModelId(); | ||||
|  |  | |||
|  | @ -4,6 +4,7 @@ import cn.hutool.core.util.ObjectUtil; | |||
| import cn.hutool.core.util.StrUtil; | ||||
| import com.alibaba.fastjson2.JSON; | ||||
| import com.alipay.api.response.AlipayTradeRefundResponse; | ||||
| import com.aliyuncs.exceptions.ClientException; | ||||
| import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | ||||
| import com.ruoyi.common.constant.Constants; | ||||
| import com.ruoyi.common.constant.ServiceConstants; | ||||
|  | @ -488,8 +489,11 @@ public class WxPayService implements IWxPayService { | |||
|             request.setNotifyUrl(channelVO.getRefundNotifyUrl()); | ||||
|             log.info("【退款】请求微信参数:【{}】",JSON.toJSONString(request)); | ||||
|             RefundService refundService = getRefundService(channelVO); | ||||
|             Refund refund = refundService.create(request); | ||||
|             log.info("【退款】微信返回结果:【{}】",JSON.toJSONString(refund)); | ||||
|             try { | ||||
|                 refundService.create(request); | ||||
|             } catch (com.wechat.pay.java.core.exception.ServiceException e) { | ||||
|                 throw new ServiceException("【退款】微信退款失败:" + e.getErrorMessage()); | ||||
|             } | ||||
|         }else if(PayChannel.TM_WX.equalsCode(channelVO.getCode())){ | ||||
|             log.info("----------{}-------------","太米微信退款"); | ||||
|             RefundAble refundAble = new RefundAble(); | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	Block a user