|
@@ -1,6 +1,16 @@
|
|
package com.diagbot.facade;
|
|
package com.diagbot.facade;
|
|
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
|
+import java.util.List;
|
|
|
|
+import java.util.Map;
|
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
+
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
+import org.springframework.stereotype.Component;
|
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
|
|
+
|
|
import com.diagbot.client.UserServiceClient;
|
|
import com.diagbot.client.UserServiceClient;
|
|
|
|
+import com.diagbot.dto.AuthDetailDTO;
|
|
import com.diagbot.dto.ProductAuthProgressDTO;
|
|
import com.diagbot.dto.ProductAuthProgressDTO;
|
|
import com.diagbot.dto.RespDTO;
|
|
import com.diagbot.dto.RespDTO;
|
|
import com.diagbot.dto.UserOrgDTO;
|
|
import com.diagbot.dto.UserOrgDTO;
|
|
@@ -20,13 +30,6 @@ import com.diagbot.util.DateUtil;
|
|
import com.diagbot.util.UserUtils;
|
|
import com.diagbot.util.UserUtils;
|
|
import com.diagbot.vo.AddOrderVO;
|
|
import com.diagbot.vo.AddOrderVO;
|
|
import com.diagbot.vo.ProductOrderVO;
|
|
import com.diagbot.vo.ProductOrderVO;
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
-import org.springframework.stereotype.Component;
|
|
|
|
-import org.springframework.transaction.annotation.Transactional;
|
|
|
|
-
|
|
|
|
-import java.util.ArrayList;
|
|
|
|
-import java.util.List;
|
|
|
|
-import java.util.Map;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
* 订单业务
|
|
* 订单业务
|
|
@@ -60,12 +63,19 @@ public class ProductOrderFacade extends ProductOrderServiceImpl {
|
|
List<ProductAuthProgressDTO> retList = new ArrayList<ProductAuthProgressDTO>();
|
|
List<ProductAuthProgressDTO> retList = new ArrayList<ProductAuthProgressDTO>();
|
|
Long userId = Long.parseLong(UserUtils.getCurrentPrincipleID());
|
|
Long userId = Long.parseLong(UserUtils.getCurrentPrincipleID());
|
|
List<ProductOrder> orderList = baseMapper.getUserProductOrder(userId);
|
|
List<ProductOrder> orderList = baseMapper.getUserProductOrder(userId);
|
|
|
|
+ List<String> nums = new ArrayList<>();
|
|
for(ProductOrder i : orderList){
|
|
for(ProductOrder i : orderList){
|
|
|
|
+ nums.add(i.getNum());
|
|
|
|
+ }
|
|
|
|
+ List<AuthDetailDTO> detailList = baseMapper.getOrderDetailsByNums(nums);
|
|
|
|
+ Map<String, List<AuthDetailDTO>> detailMap = detailList.stream().collect(Collectors.groupingBy(AuthDetailDTO::getNum));
|
|
|
|
+ for(String num:detailMap.keySet()){
|
|
ProductAuthProgressDTO productAuthProgressDTO = new ProductAuthProgressDTO();
|
|
ProductAuthProgressDTO productAuthProgressDTO = new ProductAuthProgressDTO();
|
|
- productAuthProgressDTO.setNum(i.getNum());
|
|
|
|
- productAuthProgressDTO.setProducts(baseMapper.getOrderDetails(i.getNum()));
|
|
|
|
|
|
+ productAuthProgressDTO.setNum(num);
|
|
|
|
+ productAuthProgressDTO.setProducts(detailMap.get(num));
|
|
retList.add(productAuthProgressDTO);
|
|
retList.add(productAuthProgressDTO);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
|
|
return retList;
|
|
return retList;
|
|
}
|
|
}
|