|
@@ -6,11 +6,11 @@ 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.exception.CommonException;
|
|
|
import com.diagbot.service.impl.LantoneProductServiceImpl;
|
|
|
import com.diagbot.util.BeanUtil;
|
|
|
import com.diagbot.util.UserUtils;
|
|
@@ -19,7 +19,6 @@ 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;
|
|
|
|
|
@@ -124,8 +123,8 @@ public class LantoneProductFacade extends LantoneProductServiceImpl {
|
|
|
*/
|
|
|
public List<OpendProductWrapper> opendedProduct(OppendedProductVO oppendedProductVO){
|
|
|
OpenedProductsIndex openedProductsIndex =new OpenedProductsIndex();
|
|
|
- Long curren = openedProductsIndex.getCurrent();
|
|
|
- Long size =openedProductsIndex.getSize();
|
|
|
+ Long curren = oppendedProductVO.getCurrent();
|
|
|
+ Long size =oppendedProductVO.getSize();
|
|
|
if(curren==null){
|
|
|
oppendedProductVO.setCurrent(1L);
|
|
|
}
|
|
@@ -133,18 +132,31 @@ public class LantoneProductFacade extends LantoneProductServiceImpl {
|
|
|
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) {
|
|
|
+ for (OpendProductWrapper 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);
|
|
|
+ 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(OpendProductWrapper 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;
|
|
|
}
|
|
|
}
|