| | |
| | | import com.doumee.dao.business.model.*; |
| | | import com.doumee.service.business.YwContractRevenueService; |
| | | import com.doumee.service.business.YwCustomerH5BizService; |
| | | import com.doumee.service.business.YwCustomerH5AuthService; |
| | | import com.doumee.service.business.YwCustomerRechargeBizService; |
| | | import com.doumee.service.business.YwCustomerWxPayService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | private YwContractRevenueService ywContractRevenueService; |
| | | @Autowired |
| | | private YwCustomerH5BizService ywCustomerH5BizService; |
| | | @Autowired |
| | | private YwCustomerH5AuthService ywCustomerH5AuthService; |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | |
| | | order.setIsdeleted(Constants.ZERO); |
| | | order.setOrderNo(orderNo); |
| | | order.setCustomerId(user.getCustomerId()); |
| | | order.setMemberId(user.getMemberId()); |
| | | order.setOrderType(orderType); |
| | | order.setBizRefId(bizRefId); |
| | | order.setAmount(dto.getAmount()); |
| | |
| | | if (Objects.equals(order.getStatus(), YwWxPayOrder.STATUS_SUCCESS)) { |
| | | return successXml(); |
| | | } |
| | | LoginUserInfo user = buildCustomerUser(order.getCustomerId()); |
| | | LoginUserInfo user = buildCustomerUser(order); |
| | | try { |
| | | Integer bizRecordId = fulfillBiz(order, user); |
| | | order.setStatus(YwWxPayOrder.STATUS_SUCCESS); |
| | |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "订单类型无效"); |
| | | } |
| | | |
| | | private LoginUserInfo buildCustomerUser(Integer customerId) { |
| | | LoginUserInfo u = new LoginUserInfo(); |
| | | u.setId(customerId); |
| | | u.setCustomerId(customerId); |
| | | u.setH5UserType(LoginUserInfo.H5_USER_CUSTOMER); |
| | | u.setRealname("商户H5"); |
| | | return u; |
| | | private LoginUserInfo buildCustomerUser(YwWxPayOrder order) { |
| | | if (order == null || order.getCustomerId() == null) { |
| | | return null; |
| | | } |
| | | return ywCustomerH5AuthService.buildLoginUserInfo(order.getCustomerId(), order.getMemberId()); |
| | | } |
| | | |
| | | private String successXml() { |