From 3ee0aee46457c3ec5546e077a91b290c0e0d15e8 Mon Sep 17 00:00:00 2001
From: chengf <2156125618@qq.com>
Date: 星期五, 01 八月 2025 18:16:19 +0800
Subject: [PATCH] 修复查询车位sql、查询业主账户等bug2025/07/31
---
service-common/src/main/java/com/java110/common/cmd/carInout/SaveCarInoutCmd.java | 119 ++++++++++++++++++++++++++++++++++++++++++++++++++++-------
1 files changed, 104 insertions(+), 15 deletions(-)
diff --git a/service-common/src/main/java/com/java110/common/cmd/carInout/SaveCarInoutCmd.java b/service-common/src/main/java/com/java110/common/cmd/carInout/SaveCarInoutCmd.java
index f035fb7..2ebd512 100644
--- a/service-common/src/main/java/com/java110/common/cmd/carInout/SaveCarInoutCmd.java
+++ b/service-common/src/main/java/com/java110/common/cmd/carInout/SaveCarInoutCmd.java
@@ -77,6 +77,7 @@
Assert.hasKeyAndValue(reqJson, "communityId", "璇锋眰鎶ユ枃涓湭鍖呭惈communityId");
if (reqJson.containsKey("exit_time")) {
+ reqJson.put("outTime", reqJson.getString("exit_time"));
reqJson.put("state" , "100500");
}else {
reqJson.put("state" , "100300");
@@ -87,23 +88,111 @@
@Override
@Java110Transactional
public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
+ if(reqJson.containsKey("exit_time")){//鍑哄彛
+ if(reqJson.get("paid_status").equals("true")){//宸叉敹鍙栫幇閲�
+ CarInoutPo carInoutPo = BeanConvertUtil.covertBean(reqJson, CarInoutPo.class);
+ carInoutPo.setInoutId(GenerateCodeFactory.getGeneratorId(CODE_PREFIX_ID));
+ int flag = carInoutV1InnerServiceSMOImpl.saveCarInout(carInoutPo);
- CarInoutPo carInoutPo = BeanConvertUtil.covertBean(reqJson, CarInoutPo.class);
- carInoutPo.setInoutId(GenerateCodeFactory.getGeneratorId(CODE_PREFIX_ID));
- int flag = carInoutV1InnerServiceSMOImpl.saveCarInout(carInoutPo);
+ if (flag < 1) {
+ throw new CmdException("淇濆瓨鏁版嵁澶辫触");
+ }
+ JSONObject jsonObject = new JSONObject();
+ jsonObject.put("allow_exit", "true");
+ jsonObject.put("message","鍏佽閫氳");
+ jsonObject.put("payment_required","true");
+ jsonObject.put("amount_due",reqJson.get("payment_amount"));
+ ResponseEntity<String> responseEntity = ResponseEntity
+ .ok()
+ .header("Content-Type", "application/json")
+ .body(jsonObject.toString()); // 鍏抽敭锛氱敤toString()杩斿洖鍘熷JSON瀛楃涓�
- if (flag < 1) {
- throw new CmdException("淇濆瓨鏁版嵁澶辫触");
+ cmdDataFlowContext.setResponseEntity(responseEntity);
+ }
+ else if(reqJson.get("vehicle_type").equals("monthly")){
+ if(reqJson.get("paid_status").equals("false")){
+ JSONObject jsonObject = new JSONObject();
+ jsonObject.put("allow_exit", "false");
+ jsonObject.put("message","绉熻溅璐圭敤鏈粨娓咃紝璇疯ˉ缂村悗閫氳");
+ jsonObject.put("payment_required","false");
+ jsonObject.put("amount_due",reqJson.get("payment_amount"));
+ ResponseEntity<String> responseEntity = ResponseEntity
+ .ok()
+ .header("Content-Type", "application/json")
+ .body(jsonObject.toString()); // 鍏抽敭锛氱敤toString()杩斿洖鍘熷JSON瀛楃涓�
+
+ cmdDataFlowContext.setResponseEntity(responseEntity);
+ }else{
+ CarInoutPo carInoutPo = BeanConvertUtil.covertBean(reqJson, CarInoutPo.class);
+ carInoutPo.setInoutId(GenerateCodeFactory.getGeneratorId(CODE_PREFIX_ID));
+ int flag = carInoutV1InnerServiceSMOImpl.saveCarInout(carInoutPo);
+
+ if (flag < 1) {
+ throw new CmdException("淇濆瓨鏁版嵁澶辫触");
+ }
+ JSONObject jsonObject = new JSONObject();
+ jsonObject.put("allow_exit", "true");
+ jsonObject.put("message","鍏佽閫氳");
+ jsonObject.put("payment_required","true");
+ jsonObject.put("amount_due","0");
+ ResponseEntity<String> responseEntity = ResponseEntity
+ .ok()
+ .header("Content-Type", "application/json")
+ .body(jsonObject.toString()); // 鍏抽敭锛氱敤toString()杩斿洖鍘熷JSON瀛楃涓�
+
+ cmdDataFlowContext.setResponseEntity(responseEntity);
+ }
+ }
+ else if(1 == 1){//濡傛灉涓嶈兘鐩存帴鏀粯
+ JSONObject jsonObject = new JSONObject();
+ jsonObject.put("allow_exit", "false");
+ jsonObject.put("message","璇锋敮浠橀噾棰�"+reqJson.get("payment_amount"));
+ jsonObject.put("payment_required","false");
+ jsonObject.put("amount_due",reqJson.get("payment_amount"));
+ ResponseEntity<String> responseEntity = ResponseEntity
+ .ok()
+ .header("Content-Type", "application/json")
+ .body(jsonObject.toString()); // 鍏抽敭锛氱敤toString()杩斿洖鍘熷JSON瀛楃涓�
+
+ cmdDataFlowContext.setResponseEntity(responseEntity);
+ }else{//鑳界洿鎺ユ敮浠�
+ CarInoutPo carInoutPo = BeanConvertUtil.covertBean(reqJson, CarInoutPo.class);
+ carInoutPo.setInoutId(GenerateCodeFactory.getGeneratorId(CODE_PREFIX_ID));
+ int flag = carInoutV1InnerServiceSMOImpl.saveCarInout(carInoutPo);
+
+ if (flag < 1) {
+ throw new CmdException("淇濆瓨鏁版嵁澶辫触");
+ }
+ JSONObject jsonObject = new JSONObject();
+ jsonObject.put("allow_exit", "true");
+ jsonObject.put("message","鍏佽閫氳");
+ jsonObject.put("payment_required","true");
+ jsonObject.put("amount_due",reqJson.get("payment_amount"));
+ ResponseEntity<String> responseEntity = ResponseEntity
+ .ok()
+ .header("Content-Type", "application/json")
+ .body(jsonObject.toString()); // 鍏抽敭锛氱敤toString()杩斿洖鍘熷JSON瀛楃涓�
+
+ cmdDataFlowContext.setResponseEntity(responseEntity);
+ }
+ }else{//杩涘彛
+ CarInoutPo carInoutPo = BeanConvertUtil.covertBean(reqJson, CarInoutPo.class);
+ carInoutPo.setInoutId(GenerateCodeFactory.getGeneratorId(CODE_PREFIX_ID));
+ int flag = carInoutV1InnerServiceSMOImpl.saveCarInout(carInoutPo);
+
+ if (flag < 1) {
+ throw new CmdException("淇濆瓨鏁版嵁澶辫触");
+ }
+ JSONObject jsonObject = new JSONObject();
+ jsonObject.put("allow_entry","true");
+ jsonObject.put("message","鍏佽閫氳");
+ jsonObject.put("expire_date","");// 濡傛灉鏄寘鏈堣溅锛岃繑鍥炴湁鏁堟湡
+ ResponseEntity<String> responseEntity = ResponseEntity
+ .ok()
+ .header("Content-Type", "application/json")
+ .body(jsonObject.toString()); // 鍏抽敭锛氱敤toString()杩斿洖鍘熷JSON瀛楃涓�
+
+ cmdDataFlowContext.setResponseEntity(responseEntity);
}
- JSONObject jsonObject = new JSONObject();
- jsonObject.put("allow_entry","true");
- jsonObject.put("message","鍏佽閫氳");
- jsonObject.put("expire_date","");// 濡傛灉鏄寘鏈堣溅锛岃繑鍥炴湁鏁堟湡
- ResponseEntity<String> responseEntity = ResponseEntity
- .ok()
- .header("Content-Type", "application/json")
- .body(jsonObject.toString()); // 鍏抽敭锛氱敤toString()杩斿洖鍘熷JSON瀛楃涓�
-
- cmdDataFlowContext.setResponseEntity(responseEntity);
}
}
--
Gitblit v1.8.0