| | |
| | | throw new ValidationException("快递号不能为空"); |
| | | } |
| | | Order o = orderMapper.selectById(dto.getId()); |
| | | //上传快递号逻辑调整:由原来输入快递单号直接发送,调整先输入快递单号再点击发送,先保存订单得快递号 |
| | | if (StringUtils.isEmpty(o.getDeliveryNo())) { |
| | | throw new ValidationException("快递号不能为空"); |
| | | } |
| | | if (!Constants.ORDER_STATUS_BACKEND.SEND.name().equals(o.getStatusBackend())) { |
| | | throw new ValidationException("请先完成质检"); |
| | | } |
| | |
| | | o.setWxDeliveryMsg(GsonUtil.toJson(jsonObject)); |
| | | } |
| | | |
| | | orderMapper.updateById(o); |
| | | } |
| | | |
| | | public void saveDeliveryNoInfo(OrderDeliveryNoDTO dto) { |
| | | //上传快递号逻辑调整:由原来输入快递单号直接发送,调整先输入快递单号再点击发送,先保存订单得快递号 |
| | | Order o = orderMapper.selectById(dto.getId()); |
| | | if (!Constants.ORDER_STATUS_BACKEND.SEND.name().equals(o.getStatusBackend())) { |
| | | throw new ValidationException("请先完成质检"); |
| | | } |
| | | o.setDeliveryNo(dto.getDeliveryNo()); |
| | | o.update(SecurityUtils.getUserId()); |
| | | orderMapper.updateById(o); |
| | | } |
| | | |
| | |
| | | sb.append(item.getFlowerName() + "*" + item.getNum() + "扎、");//商品信息 |
| | | } |
| | | try { |
| | | json = wxDeliveryGoodService.wxDeliveryGood( |
| | | o.getId(), |
| | | o.getPayOpenid(), |
| | | o.getPaymentTrId(), |
| | | sb.toString(), |
| | | PyamentV3Configurer.merchantId, |
| | | accessToken); |
| | | json = wxDeliveryGoodService.wxDeliveryGood(o.getId(), o.getPayOpenid(), o.getPaymentTrId(), sb.toString(), PyamentV3Configurer.merchantId, accessToken, o.getPartnerId(), o.getDeliveryNo()); |
| | | } catch (Exception e) { |
| | | log.error("订单" + o.getOrderNo() + "发货,调用微信发货接口失败", e); |
| | | json.put("errcode", -1); |
| | |
| | | orderMapper.updatePaymentCreateDate(order); |
| | | }); |
| | | } |
| | | |
| | | public List<OrderStatusCountDTO> getAbnormalOrderStatusCount(OrderQueryDTO dto) { |
| | | dto.setStartDate(parseLocalDateTime(dto.getStartDateStr(), true)); |
| | | dto.setEndDate(parseLocalDateTime(dto.getEndDateStr(), false)); |
| | | |
| | | dto.setCreateStartDate(parseLocalDateTime(dto.getCreateStartDateStr(), 17, 0, 0, -1)); |
| | | dto.setCreateEndDate(parseLocalDateTime(dto.getCreateEndDateStr(), 17, 0, 0, 0)); |
| | | |
| | | List<CodeValueDTO> ls = codeService.searchValue("ABNORMAL_ORDER_STATUS"); |
| | | List<OrderStatusCountDTO> ll = orderMapper.getAbnormalOrderStatusCount(dto); |
| | | Map<String, Integer> llMap = new HashMap<>(); |
| | | if (ll != null && ll.size() > 0) { |
| | | for (OrderStatusCountDTO c : ll) { |
| | | llMap.put(c.getValue(), c.getOrderCount()); |
| | | } |
| | | } |
| | | |
| | | List<OrderStatusCountDTO> rr = new ArrayList<>(); |
| | | for (CodeValueDTO c : ls) { |
| | | OrderStatusCountDTO r = new OrderStatusCountDTO(); |
| | | r.setValue(c.getValue()); |
| | | r.setLabel(c.getLabel()); |
| | | Integer count = llMap.get(r.getValue()); |
| | | r.setOrderCount(count == null ? 0 : count); |
| | | |
| | | rr.add(r); |
| | | } |
| | | |
| | | return rr; |
| | | } |
| | | } |