浏览代码

优化代码

wuxw 4 年之前
父节点
当前提交
811de7a8d4
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      service-fee/src/main/java/com/java110/fee/cmd/fee/PayFeePreCmd.java

+ 3 - 1
service-fee/src/main/java/com/java110/fee/cmd/fee/PayFeePreCmd.java

@@ -148,7 +148,9 @@ public class PayFeePreCmd extends AbstractServiceCmdListener {
             receivedAmount = 0.0;
             receivedAmount = 0.0;
         }
         }
         paramOut.put("receivedAmount", receivedAmount);
         paramOut.put("receivedAmount", receivedAmount);
+
         ResponseEntity<String> responseEntity = new ResponseEntity<>(paramOut.toJSONString(), HttpStatus.OK);
         ResponseEntity<String> responseEntity = new ResponseEntity<>(paramOut.toJSONString(), HttpStatus.OK);
+        reqJson.putAll(paramOut);
         CommonCache.setValue("payFeePre" + paramOut.getString("oId"), reqJson.toJSONString(), 24 * 60 * 60);
         CommonCache.setValue("payFeePre" + paramOut.getString("oId"), reqJson.toJSONString(), 24 * 60 * 60);
         cmdDataFlowContext.setResponseEntity(responseEntity);
         cmdDataFlowContext.setResponseEntity(responseEntity);
     }
     }
@@ -232,7 +234,7 @@ public class PayFeePreCmd extends AbstractServiceCmdListener {
         for (CouponUserDto couponUser : couponUserDtos) {
         for (CouponUserDto couponUser : couponUserDtos) {
             //不计算已过期购物券金额
             //不计算已过期购物券金额
             if (couponUser.getEndTime().compareTo(DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_B)) >= 0) {
             if (couponUser.getEndTime().compareTo(DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_B)) >= 0) {
-                couponPrice.add(new BigDecimal(Double.parseDouble(couponUser.getActualPrice())));
+                couponPrice = couponPrice.add(new BigDecimal(Double.parseDouble(couponUser.getActualPrice())));
             }
             }
         }
         }
         paramObj.put("couponPrice", couponPrice.doubleValue());
         paramObj.put("couponPrice", couponPrice.doubleValue());