java110
2020-09-25 95f06441fe22057e267384a3080253d9baab97c8
service-front/src/main/java/com/java110/front/smo/payment/impl/RentingToPaySMOImpl.java
@@ -6,6 +6,7 @@
import com.java110.core.context.PageData;
import com.java110.core.factory.GenerateCodeFactory;
import com.java110.dto.owner.OwnerAppUserDto;
import com.java110.dto.rentingConfig.RentingConfigDto;
import com.java110.dto.rentingPool.RentingPoolDto;
import com.java110.dto.smallWeChat.SmallWeChatDto;
import com.java110.front.properties.WechatAuthProperties;
@@ -104,18 +105,24 @@
        if (RentingPoolDto.STATE_TO_PAY.equals(rentingPoolDto.getState())) {
            rate = Double.parseDouble(rentingPoolDto.getServiceTenantRate());
            feeName += "(租客)";
        } else if (RentingPoolDto.STATE_TO_PAY.equals(rentingPoolDto.getState())) {
        } else if (RentingPoolDto.STATE_OWNER_TO_PAY.equals(rentingPoolDto.getState())) {
            rate = Double.parseDouble(rentingPoolDto.getServiceOwnerRate());
            feeName += "(业主)";
        } else {
            throw new IllegalAccessException("当前状态不是支付状态");
        }
        String rentingFormula = rentingPoolDto.getRentingFormula();
        BigDecimal serviceDec = new BigDecimal(service);
        BigDecimal rateDec = new BigDecimal(rate);
        double money = serviceDec.multiply(rateDec).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue();
        double money = 0.0;
        if (RentingConfigDto.RENTING_FORMULA_RATE.equals(rentingFormula)) {
            BigDecimal monthMoney = new BigDecimal(rentingPoolDto.getPrice());
            money = serviceDec.multiply(rateDec).multiply(monthMoney).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue();
        } else {
            money = serviceDec.multiply(rateDec).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue();
        }
        Map result = super.java110Payment(outRestTemplate, feeName, WechatAuthProperties.TRADE_TYPE_NATIVE, orderId, money, "", smallWeChatDto);
        Map result = super.java110Payment(outRestTemplate, feeName, WechatAuthProperties.TRADE_TYPE_NATIVE, orderId, money, "", smallWeChatDto, wechatAuthProperties.getRentingNotifyUrl());
        result.put("money", money);
        responseEntity = new ResponseEntity(JSONObject.toJSONString(result), HttpStatus.OK);
        if (!"0".equals(result.get("code"))) {