From 80cacfd0dcee0174f2a8d9ae322a2fcf857cef63 Mon Sep 17 00:00:00 2001 From: kongdeqiang <123456> Date: 星期三, 04 十二月 2024 15:31:35 +0800 Subject: [PATCH] fix : 新增修改出场接口 --- src/main/java/com/boying/controller/phone/YCPayController.java | 39 +++++++++++++++++++++++++++++++++++---- 1 files changed, 35 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/boying/controller/phone/YCPayController.java b/src/main/java/com/boying/controller/phone/YCPayController.java index a517dc6..a19093c 100644 --- a/src/main/java/com/boying/controller/phone/YCPayController.java +++ b/src/main/java/com/boying/controller/phone/YCPayController.java @@ -13,6 +13,7 @@ import com.boying.service.*; import com.boying.util.DateUtilOther; import com.google.gson.Gson; + import lombok.RequiredArgsConstructor; import org.springframework.data.redis.core.StringRedisTemplate; import org.springframework.http.ResponseEntity; @@ -59,7 +60,7 @@ private final EnterParkService enterParkService; private final WXService wxService; private final OutParkLogService outParkLogService; - private StringRedisTemplate redisTemplate; + private final StringRedisTemplate redisTemplate; /** @@ -146,6 +147,37 @@ } } + /** + * 鍒ゆ柇鏀粯绔槸鍚﹀凡缁忔敮浠樿繃 + * @param id + * @return + */ + @PostMapping("parkJudg") + public Object parkJudg(Long id){ + if(id == null){ + return R.failed("鏈壘鍒版暟鎹紝璇风◢鍚庨噸鏂扮偣鍑�"); + } + OutPark outPark = outParkService.getById(id); + if(outPark == null){ + return R.failed("鏈壘鍒版暟鎹紝璇风◢鍚庨噸鏂扮偣鍑�"); + } + if(StringUtils.isNotBlank(outPark.getPayCode()) && outPark.getStatus() == 0){ + return R.ok(1,"璁㈠崟宸叉彁浜ゆ敮浠樿姹�"); + } + if(StringUtils.isNotBlank(outPark.getPayCode()) && outPark.getStatus() == 1){ + return R.failed(0,"璁㈠崟宸茬即璐�"); + } + if(StringUtils.isBlank(outPark.getPayCode())){ + OutPark by10min = outParkService.findBy10min(outPark.getCarNo(), outPark.getParkId(), outPark.getCreateTime(),outPark.getId()); + if(by10min !=null){ + return R.ok(1,"璁㈠崟宸叉彁浜ゆ敮浠樿姹�"); + }else { + return R.ok(0,"璇锋彁浜ゆ敮浠�"); + } + } + return R.failed(0,"璇锋彁浜ゆ敮浠�"); + } + /** * 鍒ゆ柇鏄惁缂磋垂 @@ -162,7 +194,6 @@ updateOutPark(outPark.getId(),"03"); return R.failed("鏈鍋滆溅鏃犻渶鏀粯璐圭敤"); } - //鍒ゆ柇鏄惁鍦ㄧ櫧鍚嶅崟 QueryWrapper<WhiteList> wrapper = new QueryWrapper<>(); wrapper.lambda() @@ -682,8 +713,8 @@ outPark.setStatus(1); outParkService.saveOrUpdate(outPark); //缂撳瓨鍦╮edis閲� -// String jsonValue = JSON.toJSONString(outPark); -// redisTemplate.opsForValue().set("outPark-"+outPark.getBarrierId(), jsonValue); + String jsonValue = JSON.toJSONString(outPark); + redisTemplate.opsForValue().set("outPark-"+outPark.getBarrierId(), jsonValue); } } } -- Gitblit v1.9.1