| | |
| | | } |
| | | } |
| | | |
| | | public Map commitOrder(OrderCommitDTO dto, PreOrderDTO p, Map<Long, PriceDTO> priceMap) { |
| | | public Map commitOrder(OrderCommitDTO dto, PreOrderDTO p, Map<Long, PriceDTO> priceMap) throws Exception { |
| | | String userId = SecurityUtils.getUserId(); |
| | | p.getFlowers().forEach(flower -> { |
| | | // 限购数量 鲜花数量校验 |
| | |
| | | } |
| | | totalAmount = totalAmount.add(p.getPacking()).add(transportFee); |
| | | if(totalAmount.doubleValue() <= 0){//假如总价小于等于0,则支付0.01元 |
| | | totalAmount = new BigDecimal(0.01); |
| | | totalAmount = new BigDecimal("0.01"); |
| | | } |
| | | order.setTotalAmount(totalAmount); |
| | | |
| | |
| | | if(orders == null || orders.size() == 0){ |
| | | return; |
| | | } |
| | | /* |
| | | for (Order o : orders) { |
| | | //set status_backend = 'RECEIVE', status = 'RECEIVE' |
| | | o.setStatusBackend("RECEIVE"); |
| | |
| | | |
| | | orderMapper.updateById(o); |
| | | } |
| | | */ |
| | | orderMapper.setPartnerOrderReceive(); |
| | | //orderMapper.setPartnerOrderReceive(); |
| | | } |
| | | |
| | | /** |
| | |
| | | o.setStatusBackend(Constants.ORDER_STATUS_BACKEND.RECEIVE.name()); |
| | | o.update(SecurityUtils.getUserId()); |
| | | |
| | | /* |
| | | //发送微信发货请求 |
| | | JSONObject jsonObject = sendWxDeliveryGood(o); |
| | | if (jsonObject != null && (int) jsonObject.get("errcode") == 0) { |
| | |
| | | o.setWxDeliveryGood(false); |
| | | o.setWxDeliveryMsg(GsonUtil.toJson(jsonObject)); |
| | | } |
| | | */ |
| | | |
| | | orderMapper.updateById(o); |
| | | } |
| | | |
| | |
| | | customerPointService.consumptionPoint(totalAmount, o.getOrderNo(), o.getCreateBy()); |
| | | } |
| | | |
| | | /* |
| | | public JSONObject sendWxDeliveryGood(Order o) { |
| | | JSONObject json = new JSONObject(); |
| | | List<OrderItem> items = orderItemMapper.selectList(new LambdaQueryWrapper<OrderItem>() |
| | |
| | | return json; |
| | | } |
| | | } |
| | | */ |
| | | |
| | | public Order confirmOrderReceive(String id) { |
| | | Order o = orderMapper.selectById(id); |
| | |
| | | return dto; |
| | | } |
| | | |
| | | public void processAbnormalOrder(String id) { |
| | | public void processAbnormalOrder(String id) throws Exception { |
| | | Order o = orderMapper.selectById(id); |
| | | String transferId = o.getTransferId(); |
| | | if (StringUtils.isNotEmpty(transferId)) { |
| | |
| | | orderMapper.updateById(o); |
| | | } |
| | | |
| | | public void processLevelDown(OrderReduceDTO dto) { |
| | | public void processLevelDown(OrderReduceDTO dto) throws Exception { |
| | | Order o = orderMapper.selectById(dto.getId()); |
| | | String transferId = o.getTransferId(); |
| | | if (StringUtils.isNotEmpty(transferId)) { |