Commit fa0dbc7168c2406e97adc29bebcfc455a571e723

Authored by fengliang
1 parent d665621f

update:订单数量查询

etrade-order/src/main/java/com/diligrp/etrade/order/api/OrderQueryBuyerController.java
@@ -69,25 +69,25 @@ public class OrderQueryBuyerController { @@ -69,25 +69,25 @@ public class OrderQueryBuyerController {
69 return Message.success(orderStateNumbers); 69 return Message.success(orderStateNumbers);
70 } 70 }
71 for (OrderStateNumberDto item : numberDtoList){ 71 for (OrderStateNumberDto item : numberDtoList){
72 - if (item.getState().equals(OrderState.WAIT_ENTER.getCodeInteger())){ 72 + if (item.getCode().equals(OrderState.WAIT_ENTER.getCodeInteger())){
73 orderStateNumbers.setWaitConfirm(item.getNumber()); 73 orderStateNumbers.setWaitConfirm(item.getNumber());
74 orderStateNumbers.setAll(orderStateNumbers.getAll()+ item.getNumber()); 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 orderStateNumbers.setWaitPay(item.getNumber()); 76 orderStateNumbers.setWaitPay(item.getNumber());
77 orderStateNumbers.setAll(orderStateNumbers.getAll()+ item.getNumber()); 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 orderStateNumbers.setFinished(item.getNumber()); 79 orderStateNumbers.setFinished(item.getNumber());
80 orderStateNumbers.setAll(orderStateNumbers.getAll()+ item.getNumber()); 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 orderStateNumbers.setCancel(item.getNumber()); 82 orderStateNumbers.setCancel(item.getNumber());
83 orderStateNumbers.setAll(orderStateNumbers.getAll()+ item.getNumber()); 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 orderStateNumbers.setWaitMapping(item.getNumber()); 85 orderStateNumbers.setWaitMapping(item.getNumber());
86 orderStateNumbers.setAll(orderStateNumbers.getAll()+ item.getNumber()); 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 orderStateNumbers.setWaitSend(item.getNumber()); 88 orderStateNumbers.setWaitSend(item.getNumber());
89 orderStateNumbers.setAll(orderStateNumbers.getAll()+ item.getNumber()); 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 orderStateNumbers.setWaitReceive(item.getNumber()); 91 orderStateNumbers.setWaitReceive(item.getNumber());
92 orderStateNumbers.setAll(orderStateNumbers.getAll()+ item.getNumber()); 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,6 +226,8 @@ public class OrderDto {
226 */ 226 */
227 private String payeeSellerame; 227 private String payeeSellerame;
228 228
  229 + private String location;
  230 +
229 /** 是否允许微信支付 */ 231 /** 是否允许微信支付 */
230 private Boolean weChatEnable; 232 private Boolean weChatEnable;
231 233
@@ -725,4 +727,12 @@ public class OrderDto { @@ -725,4 +727,12 @@ public class OrderDto {
725 public void setTransportFee(Long transportFee) { 727 public void setTransportFee(Long transportFee) {
726 this.transportFee = transportFee; 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,6 +10,8 @@ public class OrderStateNumberDto {
10 10
11 private Integer number; 11 private Integer number;
12 12
  13 + private Integer code;
  14 +
13 public Integer getState() { 15 public Integer getState() {
14 return state; 16 return state;
15 } 17 }
@@ -41,4 +43,12 @@ public class OrderStateNumberDto { @@ -41,4 +43,12 @@ public class OrderStateNumberDto {
41 public void setAchieveState(Integer achieveState) { 43 public void setAchieveState(Integer achieveState) {
42 this.achieveState = achieveState; 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,11 +55,16 @@ public class OrderQueryBuyerServiceImpl implements OrderQueryBuyerService {
55 public List<OrderStateNumberDto> queryOrderStateNumberBuyer(OrderQueryBuyerDto orderQueryDto) { 55 public List<OrderStateNumberDto> queryOrderStateNumberBuyer(OrderQueryBuyerDto orderQueryDto) {
56 List<OrderStateNumberDto> numberDtoList = orderBuyerQueryMapper.queryOrderStateNumberBuyer(orderQueryDto); 56 List<OrderStateNumberDto> numberDtoList = orderBuyerQueryMapper.queryOrderStateNumberBuyer(orderQueryDto);
57 Map<Integer,OrderStateNumberDto> map = new HashMap<>(); 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 if(numberDtoList!=null){ 62 if(numberDtoList!=null){
59 for(OrderStateNumberDto dto : numberDtoList){ 63 for(OrderStateNumberDto dto : numberDtoList){
60 if(!Objects.equals(dto.getState(), OrderState.PAY_FINISH.getCodeInteger())){ 64 if(!Objects.equals(dto.getState(), OrderState.PAY_FINISH.getCodeInteger())){
61 OrderStateNumberDto orderStateNumberDto = map.get(dto.getState()); 65 OrderStateNumberDto orderStateNumberDto = map.get(dto.getState());
62 if(orderStateNumberDto == null){ 66 if(orderStateNumberDto == null){
  67 + dto.setCode(dto.getState());
63 map.put(dto.getState(),dto); 68 map.put(dto.getState(),dto);
64 }else{ 69 }else{
65 orderStateNumberDto.setNumber(dto.getNumber()+orderStateNumberDto.getNumber()); 70 orderStateNumberDto.setNumber(dto.getNumber()+orderStateNumberDto.getNumber());
@@ -67,27 +72,34 @@ public class OrderQueryBuyerServiceImpl implements OrderQueryBuyerService { @@ -67,27 +72,34 @@ public class OrderQueryBuyerServiceImpl implements OrderQueryBuyerService {
67 }else if(OrderVerifyState.BUYER_CREATE.getCodeInteger().equals(dto.getVerifyState())){ 72 }else if(OrderVerifyState.BUYER_CREATE.getCodeInteger().equals(dto.getVerifyState())){
68 OrderStateNumberDto orderStateNumberDto = map.get(OrderState.WAIT_MAPPING.getCodeInteger()); 73 OrderStateNumberDto orderStateNumberDto = map.get(OrderState.WAIT_MAPPING.getCodeInteger());
69 if(orderStateNumberDto == null){ 74 if(orderStateNumberDto == null){
  75 + dto.setCode(OrderState.WAIT_MAPPING.getCodeInteger());
70 map.put(OrderState.WAIT_MAPPING.getCodeInteger(),dto); 76 map.put(OrderState.WAIT_MAPPING.getCodeInteger(),dto);
71 }else{ 77 }else{
72 orderStateNumberDto.setNumber(dto.getNumber()+orderStateNumberDto.getNumber()); 78 orderStateNumberDto.setNumber(dto.getNumber()+orderStateNumberDto.getNumber());
73 } 79 }
  80 + payDto.setNumber(payDto.getNumber()+dto.getNumber());
74 }else if(OrderAchieveState.WAIT_ACHIEVE.getCodeInteger().equals(dto.getAchieveState())){ 81 }else if(OrderAchieveState.WAIT_ACHIEVE.getCodeInteger().equals(dto.getAchieveState())){
75 OrderStateNumberDto orderStateNumberDto = map.get(OrderState.WAIT_SEND.getCodeInteger()); 82 OrderStateNumberDto orderStateNumberDto = map.get(OrderState.WAIT_SEND.getCodeInteger());
76 if(orderStateNumberDto == null){ 83 if(orderStateNumberDto == null){
  84 + dto.setCode(OrderState.WAIT_SEND.getCodeInteger());
77 map.put(OrderState.WAIT_SEND.getCodeInteger(),dto); 85 map.put(OrderState.WAIT_SEND.getCodeInteger(),dto);
78 }else{ 86 }else{
79 orderStateNumberDto.setNumber(dto.getNumber()+orderStateNumberDto.getNumber()); 87 orderStateNumberDto.setNumber(dto.getNumber()+orderStateNumberDto.getNumber());
80 } 88 }
  89 + payDto.setNumber(payDto.getNumber()+dto.getNumber());
81 }else if(OrderAchieveState.ACHIEVING.getCodeInteger().equals(dto.getAchieveState())){ 90 }else if(OrderAchieveState.ACHIEVING.getCodeInteger().equals(dto.getAchieveState())){
82 OrderStateNumberDto orderStateNumberDto = map.get(OrderState.WAIT_GET.getCodeInteger()); 91 OrderStateNumberDto orderStateNumberDto = map.get(OrderState.WAIT_GET.getCodeInteger());
83 if(orderStateNumberDto == null){ 92 if(orderStateNumberDto == null){
  93 + dto.setCode(OrderState.WAIT_GET.getCodeInteger());
84 map.put(OrderState.WAIT_GET.getCodeInteger(),dto); 94 map.put(OrderState.WAIT_GET.getCodeInteger(),dto);
85 }else{ 95 }else{
86 orderStateNumberDto.setNumber(dto.getNumber()+orderStateNumberDto.getNumber()); 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 List<OrderStateNumberDto> list = map.values().stream().toList(); 103 List<OrderStateNumberDto> list = map.values().stream().toList();
92 return list; 104 return list;
93 } 105 }