old mode 100644
new mode 100755
| | |
| | | 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; |
| | | import com.java110.front.smo.AppAbstractComponentSMO; |
| | | import com.java110.front.smo.payment.IRentingToPaySMO; |
| | | import com.java110.front.smo.payment.adapt.IPayAdapt; |
| | | import com.java110.utils.cache.CommonCache; |
| | | import com.java110.utils.cache.MappingCache; |
| | | import com.java110.utils.constant.ServiceConstant; |
| | | import com.java110.utils.constant.WechatConstant; |
| | | import com.java110.utils.factory.ApplicationContextFactory; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.utils.util.BeanConvertUtil; |
| | | import com.java110.utils.util.StringUtil; |
| | | import com.java110.vo.ResultVo; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | |
| | | 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(); |
| | | |
| | | Map result = super.java110Payment(outRestTemplate, feeName, WechatAuthProperties.TRADE_TYPE_NATIVE, orderId, money, "", smallWeChatDto); |
| | | 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(); |
| | | } |
| | | String payAdapt = MappingCache.getValue(WechatConstant.WECHAT_DOMAIN, WechatConstant.PAY_ADAPT); |
| | | payAdapt = StringUtil.isEmpty(payAdapt) ? DEFAULT_PAY_ADAPT : payAdapt; |
| | | //支付适配器 |
| | | IPayAdapt tPayAdapt = ApplicationContextFactory.getBean(payAdapt, IPayAdapt.class); |
| | | Map result = tPayAdapt.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"))) { |