Commit fa0dbc7168c2406e97adc29bebcfc455a571e723
1 parent
d665621f
update:订单数量查询
Showing
4 changed files
with
39 additions
and
7 deletions
etrade-order/src/main/java/com/diligrp/etrade/order/api/OrderQueryBuyerController.java
... | ... | @@ -69,25 +69,25 @@ public class OrderQueryBuyerController { |
69 | 69 | return Message.success(orderStateNumbers); |
70 | 70 | } |
71 | 71 | for (OrderStateNumberDto item : numberDtoList){ |
72 | - if (item.getState().equals(OrderState.WAIT_ENTER.getCodeInteger())){ | |
72 | + if (item.getCode().equals(OrderState.WAIT_ENTER.getCodeInteger())){ | |
73 | 73 | orderStateNumbers.setWaitConfirm(item.getNumber()); |
74 | 74 | orderStateNumbers.setAll(orderStateNumbers.getAll()+ item.getNumber()); |
75 | - } else if (item.getState().equals(OrderState.WAIT_PAY.getCodeInteger())) { | |
75 | + } else if (item.getCode().equals(OrderState.WAIT_PAY.getCodeInteger())) { | |
76 | 76 | orderStateNumbers.setWaitPay(item.getNumber()); |
77 | 77 | orderStateNumbers.setAll(orderStateNumbers.getAll()+ item.getNumber()); |
78 | - } else if (item.getState().equals(OrderState.FINISH.getCodeInteger())) { | |
78 | + } else if (item.getCode().equals(OrderState.FINISH.getCodeInteger())) { | |
79 | 79 | orderStateNumbers.setFinished(item.getNumber()); |
80 | 80 | orderStateNumbers.setAll(orderStateNumbers.getAll()+ item.getNumber()); |
81 | - } else if (item.getState().equals(OrderState.CANCEL.getCodeInteger())) { | |
81 | + } else if (item.getCode().equals(OrderState.CANCEL.getCodeInteger())) { | |
82 | 82 | orderStateNumbers.setCancel(item.getNumber()); |
83 | 83 | orderStateNumbers.setAll(orderStateNumbers.getAll()+ item.getNumber()); |
84 | - }else if(item.getState().equals(OrderState.WAIT_MAPPING.getCodeInteger())){ | |
84 | + }else if(item.getCode().equals(OrderState.WAIT_MAPPING.getCodeInteger())){ | |
85 | 85 | orderStateNumbers.setWaitMapping(item.getNumber()); |
86 | 86 | orderStateNumbers.setAll(orderStateNumbers.getAll()+ item.getNumber()); |
87 | - }else if(item.getState().equals(OrderState.WAIT_SEND.getCodeInteger())){ | |
87 | + }else if(item.getCode().equals(OrderState.WAIT_SEND.getCodeInteger())){ | |
88 | 88 | orderStateNumbers.setWaitSend(item.getNumber()); |
89 | 89 | orderStateNumbers.setAll(orderStateNumbers.getAll()+ item.getNumber()); |
90 | - }else if(item.getState().equals(OrderState.WAIT_GET.getCodeInteger())){ | |
90 | + }else if(item.getCode().equals(OrderState.WAIT_GET.getCodeInteger())){ | |
91 | 91 | orderStateNumbers.setWaitReceive(item.getNumber()); |
92 | 92 | orderStateNumbers.setAll(orderStateNumbers.getAll()+ item.getNumber()); |
93 | 93 | } | ... | ... |
etrade-order/src/main/java/com/diligrp/etrade/order/domain/OrderDto.java
... | ... | @@ -226,6 +226,8 @@ public class OrderDto { |
226 | 226 | */ |
227 | 227 | private String payeeSellerame; |
228 | 228 | |
229 | + private String location; | |
230 | + | |
229 | 231 | /** 是否允许微信支付 */ |
230 | 232 | private Boolean weChatEnable; |
231 | 233 | |
... | ... | @@ -725,4 +727,12 @@ public class OrderDto { |
725 | 727 | public void setTransportFee(Long transportFee) { |
726 | 728 | this.transportFee = transportFee; |
727 | 729 | } |
730 | + | |
731 | + public String getLocation() { | |
732 | + return location; | |
733 | + } | |
734 | + | |
735 | + public void setLocation(String location) { | |
736 | + this.location = location; | |
737 | + } | |
728 | 738 | } | ... | ... |
etrade-order/src/main/java/com/diligrp/etrade/order/domain/OrderStateNumberDto.java
... | ... | @@ -10,6 +10,8 @@ public class OrderStateNumberDto { |
10 | 10 | |
11 | 11 | private Integer number; |
12 | 12 | |
13 | + private Integer code; | |
14 | + | |
13 | 15 | public Integer getState() { |
14 | 16 | return state; |
15 | 17 | } |
... | ... | @@ -41,4 +43,12 @@ public class OrderStateNumberDto { |
41 | 43 | public void setAchieveState(Integer achieveState) { |
42 | 44 | this.achieveState = achieveState; |
43 | 45 | } |
46 | + | |
47 | + public Integer getCode() { | |
48 | + return code; | |
49 | + } | |
50 | + | |
51 | + public void setCode(Integer code) { | |
52 | + this.code = code; | |
53 | + } | |
44 | 54 | } | ... | ... |
etrade-order/src/main/java/com/diligrp/etrade/order/service/impl/OrderQueryBuyerServiceImpl.java
... | ... | @@ -55,11 +55,16 @@ public class OrderQueryBuyerServiceImpl implements OrderQueryBuyerService { |
55 | 55 | public List<OrderStateNumberDto> queryOrderStateNumberBuyer(OrderQueryBuyerDto orderQueryDto) { |
56 | 56 | List<OrderStateNumberDto> numberDtoList = orderBuyerQueryMapper.queryOrderStateNumberBuyer(orderQueryDto); |
57 | 57 | Map<Integer,OrderStateNumberDto> map = new HashMap<>(); |
58 | + OrderStateNumberDto payDto = new OrderStateNumberDto(); | |
59 | + payDto.setState(OrderState.PAY_FINISH.getCodeInteger()); | |
60 | + payDto.setCode(OrderState.PAY_FINISH.getCodeInteger()); | |
61 | + payDto.setNumber(0); | |
58 | 62 | if(numberDtoList!=null){ |
59 | 63 | for(OrderStateNumberDto dto : numberDtoList){ |
60 | 64 | if(!Objects.equals(dto.getState(), OrderState.PAY_FINISH.getCodeInteger())){ |
61 | 65 | OrderStateNumberDto orderStateNumberDto = map.get(dto.getState()); |
62 | 66 | if(orderStateNumberDto == null){ |
67 | + dto.setCode(dto.getState()); | |
63 | 68 | map.put(dto.getState(),dto); |
64 | 69 | }else{ |
65 | 70 | orderStateNumberDto.setNumber(dto.getNumber()+orderStateNumberDto.getNumber()); |
... | ... | @@ -67,27 +72,34 @@ public class OrderQueryBuyerServiceImpl implements OrderQueryBuyerService { |
67 | 72 | }else if(OrderVerifyState.BUYER_CREATE.getCodeInteger().equals(dto.getVerifyState())){ |
68 | 73 | OrderStateNumberDto orderStateNumberDto = map.get(OrderState.WAIT_MAPPING.getCodeInteger()); |
69 | 74 | if(orderStateNumberDto == null){ |
75 | + dto.setCode(OrderState.WAIT_MAPPING.getCodeInteger()); | |
70 | 76 | map.put(OrderState.WAIT_MAPPING.getCodeInteger(),dto); |
71 | 77 | }else{ |
72 | 78 | orderStateNumberDto.setNumber(dto.getNumber()+orderStateNumberDto.getNumber()); |
73 | 79 | } |
80 | + payDto.setNumber(payDto.getNumber()+dto.getNumber()); | |
74 | 81 | }else if(OrderAchieveState.WAIT_ACHIEVE.getCodeInteger().equals(dto.getAchieveState())){ |
75 | 82 | OrderStateNumberDto orderStateNumberDto = map.get(OrderState.WAIT_SEND.getCodeInteger()); |
76 | 83 | if(orderStateNumberDto == null){ |
84 | + dto.setCode(OrderState.WAIT_SEND.getCodeInteger()); | |
77 | 85 | map.put(OrderState.WAIT_SEND.getCodeInteger(),dto); |
78 | 86 | }else{ |
79 | 87 | orderStateNumberDto.setNumber(dto.getNumber()+orderStateNumberDto.getNumber()); |
80 | 88 | } |
89 | + payDto.setNumber(payDto.getNumber()+dto.getNumber()); | |
81 | 90 | }else if(OrderAchieveState.ACHIEVING.getCodeInteger().equals(dto.getAchieveState())){ |
82 | 91 | OrderStateNumberDto orderStateNumberDto = map.get(OrderState.WAIT_GET.getCodeInteger()); |
83 | 92 | if(orderStateNumberDto == null){ |
93 | + dto.setCode(OrderState.WAIT_GET.getCodeInteger()); | |
84 | 94 | map.put(OrderState.WAIT_GET.getCodeInteger(),dto); |
85 | 95 | }else{ |
86 | 96 | orderStateNumberDto.setNumber(dto.getNumber()+orderStateNumberDto.getNumber()); |
87 | 97 | } |
98 | + payDto.setNumber(payDto.getNumber()+dto.getNumber()); | |
88 | 99 | } |
89 | 100 | } |
90 | 101 | } |
102 | + map.put(payDto.getCode(),payDto); | |
91 | 103 | List<OrderStateNumberDto> list = map.values().stream().toList(); |
92 | 104 | return list; |
93 | 105 | } | ... | ... |