|
@@ -2,14 +2,26 @@ package com.diagbot.facade;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
+import com.diagbot.client.UserServiceClient;
|
|
|
+import com.diagbot.dto.RespDTO;
|
|
|
+import com.diagbot.dto.UserOrgDTO;
|
|
|
import com.diagbot.entity.LantoneProduct;
|
|
|
+import com.diagbot.entity.OpenedProducts;
|
|
|
+import com.diagbot.entity.OpenedProductsIndex;
|
|
|
import com.diagbot.entity.wrapper.LantoneProductWrapper;
|
|
|
+import com.diagbot.entity.wrapper.OpendProductWrapper;
|
|
|
import com.diagbot.exception.CommonErrorCode;
|
|
|
import com.diagbot.service.impl.LantoneProductServiceImpl;
|
|
|
+import com.diagbot.util.BeanUtil;
|
|
|
import com.diagbot.util.UserUtils;
|
|
|
+import com.diagbot.vo.OppendedProductVO;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
|
|
|
/**
|
|
|
* @Description:产品业务层
|
|
@@ -18,6 +30,12 @@ import java.util.List;
|
|
|
*/
|
|
|
@Component
|
|
|
public class LantoneProductFacade extends LantoneProductServiceImpl {
|
|
|
+ @Autowired
|
|
|
+ private OpenedProductsFacade openedProductsFacade;
|
|
|
+ @Autowired
|
|
|
+ private ProductOrderFacade productOrderFacade;
|
|
|
+ @Autowired
|
|
|
+ private UserServiceClient userServiceClient;
|
|
|
/**
|
|
|
* @Description: 添加产品业务逻辑
|
|
|
* @Author: wangyu
|
|
@@ -98,4 +116,35 @@ public class LantoneProductFacade extends LantoneProductServiceImpl {
|
|
|
public LantoneProduct selectLanProduct(Long id){
|
|
|
return getById(id);
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @Description: 根据产品id查询当条产品线下所有订单信息
|
|
|
+ * @Author: wangyu
|
|
|
+ * @Date: 10:15 2018/9/21
|
|
|
+ */
|
|
|
+ public List<OpendProductWrapper> opendedProduct(OppendedProductVO oppendedProductVO){
|
|
|
+ OpenedProductsIndex openedProductsIndex =new OpenedProductsIndex();
|
|
|
+ Long curren = openedProductsIndex.getCurrent();
|
|
|
+ Long size =openedProductsIndex.getSize();
|
|
|
+ if(curren==null){
|
|
|
+ oppendedProductVO.setCurrent(1L);
|
|
|
+ }
|
|
|
+ if (size==null){
|
|
|
+ oppendedProductVO.setSize(10L);
|
|
|
+ }
|
|
|
+ BeanUtil.copyProperties(oppendedProductVO, openedProductsIndex);
|
|
|
+
|
|
|
+ openedProductsIndex.setIndex((oppendedProductVO.getCurrent().longValue()-1)*oppendedProductVO.getSize().longValue());
|
|
|
+ List<OpendProductWrapper> list = openedProductsFacade.getByProductId(openedProductsIndex);
|
|
|
+ List<Long> list1 =new ArrayList<>();
|
|
|
+ for (OpenedProducts opendProducts:list) {
|
|
|
+ Long longs = opendProducts.getUserId();
|
|
|
+ list1.add(longs);
|
|
|
+ }
|
|
|
+ RespDTO<Map<Long, UserOrgDTO>> mapRespDTO =userServiceClient.getUserAndOrg(list1);
|
|
|
+ Map map =new HashMap();
|
|
|
+ map.put("1",RespDTO.onSuc(mapRespDTO));
|
|
|
+ System.out.println(list);
|
|
|
+ return list;
|
|
|
+ }
|
|
|
}
|