|
@@ -1,12 +1,5 @@
|
|
|
package com.diagbot.facade;
|
|
|
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
-
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.stereotype.Component;
|
|
|
-
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.diagbot.client.UserServiceClient;
|
|
@@ -15,9 +8,12 @@ import com.diagbot.dto.UserOrgDTO;
|
|
|
import com.diagbot.entity.LantoneProduct;
|
|
|
import com.diagbot.entity.OpenedProductsIndex;
|
|
|
import com.diagbot.entity.OrderDetails;
|
|
|
+import com.diagbot.entity.OrderDetailsIndex;
|
|
|
+import com.diagbot.entity.ProductOrderIndex;
|
|
|
import com.diagbot.entity.wrapper.LantoneProductWrapper;
|
|
|
import com.diagbot.entity.wrapper.OpendProductWrapper;
|
|
|
import com.diagbot.entity.wrapper.OrderDetailsWapper;
|
|
|
+import com.diagbot.entity.wrapper.ProductOrderWrapper;
|
|
|
import com.diagbot.exception.CommonErrorCode;
|
|
|
import com.diagbot.exception.CommonException;
|
|
|
import com.diagbot.service.impl.LantoneProductServiceImpl;
|
|
@@ -25,6 +21,13 @@ import com.diagbot.util.BeanUtil;
|
|
|
import com.diagbot.util.UserUtils;
|
|
|
import com.diagbot.vo.OppendedProductVO;
|
|
|
import com.diagbot.vo.OrderDetialsVO;
|
|
|
+import com.diagbot.vo.ProductOrderVO;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.stereotype.Component;
|
|
|
+
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
|
|
|
/**
|
|
|
* @Description:产品业务层
|
|
@@ -209,4 +212,48 @@ public class LantoneProductFacade extends LantoneProductServiceImpl {
|
|
|
}
|
|
|
return list;
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @Description: 产品申请查询所有订单信息
|
|
|
+ * @Author: wangyu
|
|
|
+ * @Date: 20:23 2018/9/24
|
|
|
+ */
|
|
|
+ public List<ProductOrderWrapper> selectAllProductOrder(ProductOrderVO productOrderVO){
|
|
|
+ ProductOrderIndex productOrderIndex =new ProductOrderIndex();
|
|
|
+ Long curren = productOrderVO.getCurrent();
|
|
|
+ Long size =productOrderVO.getSize();
|
|
|
+ if(curren==null){
|
|
|
+ productOrderVO.setCurrent(1L);
|
|
|
+ }
|
|
|
+ if (size==null){
|
|
|
+ productOrderVO.setSize(10L);
|
|
|
+ }
|
|
|
+ BeanUtil.copyProperties(productOrderVO, productOrderIndex);
|
|
|
+ productOrderIndex.setIndex((productOrderVO.getCurrent().longValue()-1)*productOrderVO.getSize().longValue());
|
|
|
+ List<ProductOrderWrapper> list =productOrderFacade.selectAllProductOrder(productOrderIndex);
|
|
|
+ List<Long> list1 =new ArrayList<>();
|
|
|
+ for (ProductOrderWrapper productOrderWrapper:list) {
|
|
|
+ Long longs = productOrderWrapper.getUserId();
|
|
|
+ list1.add(longs);
|
|
|
+ }
|
|
|
+ RespDTO<Map<Long, UserOrgDTO>> mapRespDTO = userServiceClient.getUserAndOrg(list1);
|
|
|
+ if(mapRespDTO == null || !"0".equals(mapRespDTO.code) ) {
|
|
|
+ throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
|
|
|
+ "获取用户和机构信息失败");
|
|
|
+ }
|
|
|
+ Map<Long, UserOrgDTO> dataMap = mapRespDTO.data;
|
|
|
+ for(ProductOrderWrapper bean : list) {
|
|
|
+ UserOrgDTO uo = dataMap.get(bean.getUserId());
|
|
|
+ if(uo != null) {
|
|
|
+ bean.setUsername(uo.getUsername());
|
|
|
+ bean.setLinkman(uo.getLinkman());
|
|
|
+ bean.setEmail(uo.getEmail());
|
|
|
+ bean.setOrgId(uo.getOrgId());
|
|
|
+ bean.setOrgName(uo.getOrgName());
|
|
|
+ bean.setIsReject(uo.getIsReject());
|
|
|
+ bean.setAuStatus(uo.getAuStatus());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return list;
|
|
|
+ }
|
|
|
}
|