| | |
| | | import org.springblade.modules.pay.service.IPaymentInfoService; |
| | | import org.springblade.modules.pay.service.IRefundInfoService; |
| | | import org.springblade.modules.pay.service.IWxPayService; |
| | | import org.springblade.modules.property.entity.PropertyChargeRecord; |
| | | import org.springblade.modules.property.service.IPropertyChargeService; |
| | | import org.springblade.modules.system.entity.User; |
| | | import org.springblade.modules.system.service.IUserService; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.StringUtils; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.FileInputStream; |
| | | import java.io.IOException; |
| | | import java.math.BigDecimal; |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.security.*; |
| | | import java.util.*; |
| | |
| | | import java.util.concurrent.locks.ReentrantLock; |
| | | |
| | | @Service |
| | | public class WxPayServiceImpl extends ServiceImpl<WxPayMapper,WxPayInfo> implements IWxPayService { |
| | | public class WxPayServiceImpl extends ServiceImpl<WxPayMapper, WxPayInfo> implements IWxPayService { |
| | | private static Logger logger = LoggerFactory.getLogger(WxPayServiceImpl.class); |
| | | |
| | | |
| | | @Resource |
| | | private WxPayConfig wxPayConfig; |
| | | |
| | | @Resource |
| | | private IPropertyChargeService iPropertyChargeService; |
| | | |
| | | |
| | | @Resource |
| | | private CloseableHttpClient wxPayClient; |
| | |
| | | private IRefundInfoService refundsInfoService; |
| | | |
| | | private final ReentrantLock lock = new ReentrantLock(); |
| | | |
| | | |
| | | @Override |
| | | public Object getOpenId(String code) { |
| | | return null; |
| | | } |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Override |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | public Map<String, String> jsapiPay(Long properChargeRecordId) throws Exception { |
| | | |
| | | String prepayId = ""; |
| | | //生成订单 |
| | | OrderInfoEntity orderInfo = orderInfoService.getOne(Wrappers.<OrderInfoEntity>lambdaQuery().eq(OrderInfoEntity::getProperChargeRecordId,properChargeRecordId)); |
| | | OrderInfoEntity orderInfo = orderInfoService.getOne(Wrappers.<OrderInfoEntity>lambdaQuery().eq(OrderInfoEntity::getProperChargeRecordId, properChargeRecordId)); |
| | | if (orderInfo.getTotalFee() <= 0) { |
| | | throw new Exception("支付金额不能低于等于0元"); |
| | | } |
| | | IUserService userService = SpringUtils.getBean(IUserService.class); |
| | | User serviceOne = userService.getOne(Wrappers.<User>lambdaQuery().eq(User::getId, AuthUtil.getUserId())); |
| | | |