|
@@ -7,14 +7,18 @@ import com.diagbot.dto.RespDTO;
|
|
|
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.wrapper.LantoneProductWrapper;
|
|
|
import com.diagbot.entity.wrapper.OpendProductWrapper;
|
|
|
+import com.diagbot.entity.wrapper.OrderDetailsWapper;
|
|
|
import com.diagbot.exception.CommonErrorCode;
|
|
|
import com.diagbot.exception.CommonException;
|
|
|
import com.diagbot.service.impl.LantoneProductServiceImpl;
|
|
|
import com.diagbot.util.BeanUtil;
|
|
|
import com.diagbot.util.UserUtils;
|
|
|
import com.diagbot.vo.OppendedProductVO;
|
|
|
+import com.diagbot.vo.OrderDetialsVO;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
@@ -35,6 +39,8 @@ public class LantoneProductFacade extends LantoneProductServiceImpl {
|
|
|
private ProductOrderFacade productOrderFacade;
|
|
|
@Autowired
|
|
|
private UserServiceClient userServiceClient;
|
|
|
+ @Autowired
|
|
|
+ private OrderDetailsFacade orderDetailsFacade;
|
|
|
/**
|
|
|
* @Description: 添加产品业务逻辑
|
|
|
* @Author: wangyu
|
|
@@ -159,4 +165,48 @@ public class LantoneProductFacade extends LantoneProductServiceImpl {
|
|
|
}
|
|
|
return list;
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @Description: 查询所有订单明细
|
|
|
+ * @Author: wangyu
|
|
|
+ * @Date: 16:19 2018/9/21
|
|
|
+ */
|
|
|
+ public List<OrderDetailsWapper> getAllOrderDetials(OrderDetialsVO orderDetialsVO){
|
|
|
+ OrderDetailsIndex orderDetailsIndex =new OrderDetailsIndex();
|
|
|
+ Long curren = orderDetialsVO.getCurrent();
|
|
|
+ Long size =orderDetialsVO.getSize();
|
|
|
+ if(curren==null){
|
|
|
+ orderDetialsVO.setCurrent(1L);
|
|
|
+ }
|
|
|
+ if (size==null){
|
|
|
+ orderDetialsVO.setSize(10L);
|
|
|
+ }
|
|
|
+ BeanUtil.copyProperties(orderDetialsVO, orderDetailsIndex);
|
|
|
+ orderDetailsIndex.setIndex((orderDetialsVO.getCurrent().longValue()-1)*orderDetialsVO.getSize().longValue());
|
|
|
+ List<OrderDetailsWapper> list =orderDetailsFacade.seleAllOrderDetials(orderDetailsIndex);
|
|
|
+ List<Long> list1 =new ArrayList<>();
|
|
|
+ for (OrderDetails orderDetails:list) {
|
|
|
+ Long longs = orderDetails.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(OrderDetailsWapper 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;
|
|
|
+ }
|
|
|
}
|