| | |
| | | import java.math.RoundingMode; |
| | | import java.net.InetAddress; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | @Autowired |
| | | private TbMessageService messageService; |
| | | |
| | | @Autowired |
| | | private TbShareholderService shareholderService; |
| | | |
| | | |
| | | @Override |
| | | public Page<MyPushCompanyListVo> getMyOrderList(MyOrderListQuery query, Long userId) { |
| | | Page<MyPushCompanyListVo> page = new Page<>(query.getPageNum(), query.getPageSize()); |
| | | return this.baseMapper.getMyOrderList(page,query,userId); |
| | | } |
| | | |
| | | @Override |
| | | public HashMap<String, Object> getMyOrderListNum(Long userId, HashMap<String, Object> map) { |
| | | List<MyPushCompanyListVo> list = this.baseMapper.getMyOrderListNum(userId); |
| | | map.put("toBeConfirmed", list.stream().filter(e -> e.getStatus() == 2).count()); |
| | | map.put("pendingPayment", list.stream().filter(e -> e.getStatus() == 3).count()); |
| | | map.put("processing", list.stream().filter(e -> e.getStatus() == 4).count()); |
| | | map.put("completed", list.stream().filter(e -> e.getStatus() == 6).count()); |
| | | return map; |
| | | } |
| | | |
| | | @Override |
| | |
| | | |
| | | @Override |
| | | @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class) |
| | | public void lastPayOrderData(TbOrder tbOrder, AddBuyerCompanyInfoDto dto, Long userId,TbCompany company) { |
| | | public void lastPayOrderData(TbOrder tbOrder, AddBuyerCompanyInfoDto dto, Long userId,TbCompany company, TbBuyerCompanyInfo one) { |
| | | TbBuyerCompanyInfo tbBuyerCompanyInfo = new TbBuyerCompanyInfo(); |
| | | BeanUtils.copyProperties(dto,tbBuyerCompanyInfo); |
| | | if(one!=null){ |
| | | tbBuyerCompanyInfo.setId(one.getId()); |
| | | } |
| | | tbBuyerCompanyInfo.setOrderId(tbOrder.getId()); |
| | | List<TbShareholder> shareholders = dto.getShareholders(); |
| | | |
| | |
| | | addDay = addDay+company.getRelocationAreaDay(); |
| | | } |
| | | // 更新订单金额 |
| | | if(addMoney.compareTo(BigDecimal.ZERO)>0){ |
| | | BigDecimal add = tbOrder.getPrice().add(addMoney); |
| | | BigDecimal add = company.getSaleMoney().add(addMoney); |
| | | tbOrder.setPrice(add); |
| | | tbOrder.setOrderNo(OrderUtil.getOrderNoForPrefix("ZSX")); |
| | | tbOrder.updateById(); |
| | | } |
| | | |
| | | if(addDay>0){ |
| | | tbBuyerCompanyInfo.setAddDay(addDay); |
| | | } |
| | | tbBuyerCompanyInfo.insert(); |
| | | tbBuyerCompanyInfo.insertOrUpdate(); |
| | | |
| | | shareholderService.remove(new LambdaQueryWrapper<TbShareholder>().eq(TbShareholder::getOrderId, tbOrder.getId())); |
| | | for (TbShareholder shareholder : shareholders) { |
| | | shareholder.setOrderId(tbOrder.getId()); |
| | | shareholder.insert(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | InetAddress.getLoopbackAddress().getHostAddress()); |
| | | wxPayUnifiedOrderRequest.setTradeType("JSAPI"); |
| | | wxPayUnifiedOrderRequest.setNotifyUrl( |
| | | wxProperties.getNotifyUrl() +"mall-hotel-order/WX/callback"); |
| | | wxProperties.getNotifyUrl()); |
| | | WxPayMpOrderResult result = wxPayService.createOrder(wxPayUnifiedOrderRequest); |
| | | |
| | | return result; |