From bdcb64f0293f27e2dfb3de12a60f6e8412cb962b Mon Sep 17 00:00:00 2001
From: java110 <928255095@qq.com>
Date: 星期四, 26 五月 2022 01:45:22 +0800
Subject: [PATCH] 退费修改为 从证书地址中获取

---
 service-fee/src/main/java/com/java110/fee/cmd/tempCarFee/GetTempCarFeeOrderCmd.java |   60 +-----------------------------------------------------------
 1 files changed, 1 insertions(+), 59 deletions(-)

diff --git a/service-fee/src/main/java/com/java110/fee/cmd/tempCarFee/GetTempCarFeeOrderCmd.java b/service-fee/src/main/java/com/java110/fee/cmd/tempCarFee/GetTempCarFeeOrderCmd.java
index ef7f33d..34188df 100644
--- a/service-fee/src/main/java/com/java110/fee/cmd/tempCarFee/GetTempCarFeeOrderCmd.java
+++ b/service-fee/src/main/java/com/java110/fee/cmd/tempCarFee/GetTempCarFeeOrderCmd.java
@@ -47,7 +47,6 @@
 
         Assert.hasKeyAndValue(reqJson, "paId", "paId涓嶈兘涓虹┖");
         Assert.hasKeyAndValue(reqJson, "carNum", "carNum涓嶈兘涓虹┖");
-        Assert.hasKeyAndValue(reqJson, "couponIds", "couponIds涓嶈兘涓虹┖");
 
     }
 
@@ -57,63 +56,6 @@
         tempCarPayOrderDto.setPaId(reqJson.getString("paId"));
         tempCarPayOrderDto.setCarNum(reqJson.getString("carNum"));
         ResponseEntity<String> responseEntity = getTempCarFeeRulesImpl.getTempCarFeeOrder(tempCarPayOrderDto);
-
-        if (responseEntity.getStatusCode() != HttpStatus.OK) {
-            cmdDataFlowContext.setResponseEntity(responseEntity);
-            return;
-        }
-        JSONObject orderInfo = JSONObject.parseObject(responseEntity.getBody().toString());
-        if (orderInfo.getIntValue("code") != 0) {
-            cmdDataFlowContext.setResponseEntity(responseEntity);
-            return;
-        }
-
-        JSONObject fee = orderInfo.getJSONObject("data");
-        //double money = fee.getDouble("payCharge");
-        BigDecimal money = new BigDecimal(fee.getDouble("payCharge"));
-        //3.0 鑰冭檻浼樻儬鍗�
-        double couponPrice = checkCouponUser(reqJson);
-        money = money.subtract(new BigDecimal(couponPrice)).setScale(2, BigDecimal.ROUND_HALF_EVEN);
-
-        double receivedAmount = money.doubleValue();
-        //鎵�鏈� 浼樻儬鎶樻墸璁$畻瀹屽悗锛屽鏋滄�婚噾棰濆皬浜庣瓑浜�0锛屽垯杩斿洖鎬绘墸娆句负0
-        if (receivedAmount <= 0) {
-            receivedAmount = 0.0;
-        }
-        fee.put("receivedAmount", receivedAmount);
-        fee.put("oId", GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_oId));
-        ResponseEntity<String> responseEntitys = new ResponseEntity<>(fee.toJSONString(), HttpStatus.OK);
-        fee.putAll(reqJson);
-        CommonCache.setValue("getTempCarFeeOrder" + fee.getString("oId"), fee.toJSONString(), 24 * 60 * 60);
-        cmdDataFlowContext.setResponseEntity(responseEntitys);
-    }
-
-    private double checkCouponUser(JSONObject paramObj) {
-
-        BigDecimal couponPrice = new BigDecimal(0.0);
-        String couponIds = paramObj.getString("couponIds");
-        if (couponIds == null || "".equals(couponIds)) {
-            paramObj.put("couponPrice", couponPrice.doubleValue());
-            paramObj.put("couponUserDtos", new JSONArray()); //杩欓噷鑰冭檻绌�
-            return couponPrice.doubleValue();
-        }
-
-        List<String> result = Arrays.asList(couponIds.split(","));
-        CouponUserDto couponUserDto = new CouponUserDto();
-        couponUserDto.setCouponIds(result.toArray(new String[result.size()]));
-        List<CouponUserDto> couponUserDtos = couponUserV1InnerServiceSMOImpl.queryCouponUsers(couponUserDto);
-        if (couponUserDtos == null || couponUserDtos.size() < 1) {
-            paramObj.put("couponPrice", couponPrice.doubleValue());
-            return couponPrice.doubleValue();
-        }
-        for (CouponUserDto couponUser : couponUserDtos) {
-            //涓嶈绠楀凡杩囨湡璐墿鍒搁噾棰�
-            if (couponUser.getEndTime().compareTo(DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_B)) >= 0) {
-                couponPrice = couponPrice.add(new BigDecimal(Double.parseDouble(couponUser.getActualPrice())));
-            }
-        }
-        paramObj.put("couponPrice", couponPrice.doubleValue());
-        paramObj.put("couponUserDtos", BeanConvertUtil.beanCovertJSONArray(couponUserDtos));
-        return couponPrice.doubleValue();
+        cmdDataFlowContext.setResponseEntity(responseEntity);
     }
 }

--
Gitblit v1.8.0