From 199202813dd8ca536ed2334f5eeb6aba3ad25b21 Mon Sep 17 00:00:00 2001
From: kongdeqiang <123456>
Date: 星期一, 22 十二月 2025 08:49:51 +0800
Subject: [PATCH] fix : 新分支
---
src/main/java/com/boying/controller/phone/YCPayController.java | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++---
1 files changed, 56 insertions(+), 3 deletions(-)
diff --git a/src/main/java/com/boying/controller/phone/YCPayController.java b/src/main/java/com/boying/controller/phone/YCPayController.java
index 0adef10..eb20fea 100644
--- a/src/main/java/com/boying/controller/phone/YCPayController.java
+++ b/src/main/java/com/boying/controller/phone/YCPayController.java
@@ -13,6 +13,8 @@
import com.boying.service.*;
import com.boying.util.DateUtilOther;
import com.google.gson.Gson;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.http.ResponseEntity;
@@ -46,6 +48,7 @@
@RestController
@RequestMapping("/ffzf/api")
@RequiredArgsConstructor
+@Tag(description = "ffzf/api" , name = "閭偍/閭㈠彴閾惰 瀵规帴鏀粯鎺ュ彛" )
public class YCPayController {
private final OutParkService outParkService;
private final PayLogService payLogService;
@@ -61,6 +64,8 @@
private final OutParkLogService outParkLogService;
private final StringRedisTemplate redisTemplate;
+ private final PaymentLogService paymentLogService;
+
/**
* 鏌ヨ璁㈠崟鎺ュ彛
@@ -68,21 +73,56 @@
* @return
*/
@GetMapping("/getByQueryId")
+ @Operation(summary = "鏍规嵁鍑哄満id鑾峰彇鍑哄満鏁版嵁" , description = "鏍规嵁鍑哄満id鑾峰彇鍑哄満鏁版嵁" )
public Object getByQueryId(Long queryId){
if(queryId == null){
return R.failed("鍙傛暟涓虹┖");
}
OutPark byId = outParkService.getById(queryId);
- if(byId.getTime() > 0){
- byId.setTimeStr(DateUtilOther.millisToDayHrMinSec(new Double(byId.getTime()).longValue()));
+ PaymentLog byId1 = paymentLogService.getById(queryId);
+ if(byId1 !=null && byId !=null){
+ if(byId.getCreateTime().isAfter(byId1.getCreateTime())){
+ //鍑哄満琛ㄦ椂闂村湪鏈堢エ鍚�
+ if(byId.getTime() > 0){
+ byId.setTimeStr(DateUtilOther.millisToDayHrMinSec(new Double(byId.getTime()).longValue()));
+ }
+ return R.ok(byId,"璇锋眰鎴愬姛");
+ }else {
+ //鍑哄満琛ㄦ椂闂村湪鏈堢エ鍚�
+ OutPark outPark = new OutPark();
+ outPark.setId(byId1.getId());
+ outPark.setCreateTime(LocalDateTime.now());
+ outPark.setEnterTime(LocalDateTime.now());
+ outPark.setTime(0.0);
+ outPark.setTimeStr(DateUtilOther.millisToDayHrMinSec(new Double(outPark.getTime()).longValue()));
+ outPark.setPrice(byId1.getMoney());
+ return R.ok(outPark,"璇锋眰鎴愬姛");
+ }
}
- return R.ok(byId,"璇锋眰鎴愬姛");
+ if(byId == null){
+ OutPark outPark = new OutPark();
+ outPark.setId(byId1.getId());
+ outPark.setCreateTime(LocalDateTime.now());
+ outPark.setEnterTime(LocalDateTime.now());
+ outPark.setTime(0.0);
+ outPark.setTimeStr(DateUtilOther.millisToDayHrMinSec(new Double(outPark.getTime()).longValue()));
+ outPark.setPrice(byId1.getMoney());
+ return R.ok(outPark,"璇锋眰鎴愬姛");
+ }
+ if(byId1 == null){
+ if(byId.getTime() > 0){
+ byId.setTimeStr(DateUtilOther.millisToDayHrMinSec(new Double(byId.getTime()).longValue()));
+ }
+ return R.ok(byId,"璇锋眰鎴愬姛");
+ }
+ return R.failed("鏈煡璇㈠埌鏁版嵁");
}
/**
* 缂存涔�
*/
@PostMapping("park")
+ @Operation(summary = "閭偍鐢宠缂存涔�" , description = "閭偍鐢宠缂存涔�" )
public Object park(Long id){
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd_HH:mm:ss");
OutPark outPark = outParkService.getById(id);
@@ -152,6 +192,7 @@
* @return
*/
@PostMapping("parkJudg")
+ @Operation(summary = "鍒ゆ柇鏀粯绔槸鍚﹀凡缁忕敵璇疯繃鏀粯" , description = "鍒ゆ柇鏀粯绔槸鍚﹀凡缁忕敵璇疯繃鏀粯" )
public Object parkJudg(Long id){
if(id == null){
return R.failed("鏈壘鍒版暟鎹紝璇风◢鍚庨噸鏂扮偣鍑�");
@@ -162,6 +203,9 @@
}
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());
@@ -179,6 +223,7 @@
* 鍒ゆ柇鏄惁缂磋垂
*/
@PostMapping("parkXT")
+ @Operation(summary = "閭㈠彴閾惰鐢宠缂磋垂" , description = "閭㈠彴閾惰鐢宠缂磋垂" )
public Object parkXT(Long id){
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd_HH:mm:ss");
OutPark outPark = outParkService.getById(id);
@@ -253,6 +298,7 @@
* 闃块噷缂磋垂
*/
@PostMapping("payByAli")
+ @Operation(summary = "閭㈠彴閾惰鏀粯瀹濈即璐�" , description = "閭㈠彴閾惰鏀粯瀹濈即璐�" )
public Object payByAli(Long id){
OutPark outPark = outParkService.getById(id);
String xtyhpay = systemConfigProperties.getXTYHPAY();
@@ -328,6 +374,7 @@
* 鑾峰彇寰俊openid
*/
@PostMapping("getOpenId")
+ @Operation(summary = "閭㈠彴閾惰鑾峰彇寰俊鐢ㄦ埛openid" , description = "閭㈠彴閾惰鑾峰彇寰俊鐢ㄦ埛openid" )
public Object park(Long id,String code){
OutPark outPark = outParkService.getById(id);
String openIdByCode = wxService.getOpenIdByCode(code);
@@ -339,6 +386,7 @@
* 寰俊缂磋垂
*/
@PostMapping("payByWX")
+ @Operation(summary = "閭㈠彴閾惰寰俊鏀粯" , description = "閭㈠彴閾惰寰俊鏀粯" )
public Object payByWX(Long id,String openId){
System.out.println("寮�濮嬫敮浠�");
OutPark outPark = outParkService.getById(id);
@@ -431,6 +479,7 @@
* @return
*/
@GetMapping("/result")
+ @Operation(summary = "閭偍鑾峰緱鏀粯鍥炶皟" , description = "閭偍鑾峰緱鏀粯鍥炶皟" )
public Object result(Long queryId,int success,int msg){
OutPark byId = outParkService.getById(queryId);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd_HH:mm:ss");
@@ -465,6 +514,7 @@
* @return
*/
@PostMapping("/getResult")
+ @Operation(summary = "閭㈠彴閾惰鏀粯鍥炶皟鎺ュ彛" , description = "閭㈠彴閾惰鏀粯鍥炶皟鎺ュ彛" )
public Object getResult(HttpServletRequest request){
System.out.println("getResult鏀跺埌璁块棶");
String respCode = request.getParameter("respCode");
@@ -519,6 +569,7 @@
* @return
*/
@PostMapping ("/checkbill")
+ @Operation(summary = "閭偍瀵硅处鎺ュ彛" , description = "閭偍瀵硅处鎺ュ彛" )
public Object checkbill(@RequestBody Map params){
String checkDate = (String) params.get("checkDate");
String tranDate = (String) params.get("tranDate");
@@ -540,6 +591,7 @@
* @return
*/
@PostMapping ("/checkbillXTYH")
+ @Operation(summary = "閭㈠彴閾惰瀵硅处鎺ュ彛" , description = "閭㈠彴閾惰瀵硅处鎺ュ彛" )
public Object checkbillXTYH(String date){
String xtyhpay = systemConfigProperties.getXTYHPAY();
Map<String,Object> map = new HashMap<>();
@@ -584,6 +636,7 @@
* @return
*/
@PostMapping ("/searchPayStatus")
+ @Operation(summary = "浜ゆ槗鐘舵�佹煡璇�" , description = "浜ゆ槗鐘舵�佹煡璇�" )
public Object searchPayStatus(String txnOrderId,String txnOrderTime){
OutPark outPark = outParkService.findByOrderId(txnOrderId);
if(outPark == null){
--
Gitblit v1.9.1