|
@@ -11,7 +11,6 @@ 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.enums.AccessTypeEnum;
|
|
|
import com.diagbot.enums.IsDeleteEnum;
|
|
|
import com.diagbot.enums.StatusEnum;
|
|
|
import com.diagbot.exception.CommonErrorCode;
|
|
@@ -27,7 +26,6 @@ import com.diagbot.vo.UpdateProductVO;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
-import java.lang.reflect.Array;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
@@ -114,28 +112,9 @@ public class LantoneProductFacade extends LantoneProductServiceImpl {
|
|
|
public List<LantoneProductWrapper> opendedProductByCurrentUser() {
|
|
|
Long userId = Long.parseLong(UserUtils.getCurrentPrincipleID());
|
|
|
List<LantoneProductWrapper> list = this.opendedProductByUserId(userId);
|
|
|
- List<Long> list1 = new ArrayList<>();
|
|
|
- RespDTO<Map<Long, UserOrgDTO>> mapRespDTO = userServiceClient.getUserAndOrg(list1);
|
|
|
- if (mapRespDTO == null || !"0".equals(mapRespDTO.code)) {
|
|
|
- throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
|
|
|
- "获取用户机构信息失败");
|
|
|
- }
|
|
|
for (LantoneProductWrapper product : list) {
|
|
|
- product.setOrganizationName(mapRespDTO.data.get(userId).getOrgName());
|
|
|
- String[] accessType = product.getAccessType().split(",|,");
|
|
|
- String[] chargeType = product.getChargeType().split(",|,");
|
|
|
- String[] accessTypeArray = new String[accessType.length];
|
|
|
- String[] chargeTypeArray = new String[chargeType.length];
|
|
|
-
|
|
|
- for (int i = 0; i < accessType.length; i++) {
|
|
|
- accessTypeArray[i] = AccessTypeEnum.getName(Integer.parseInt(accessType[i]));
|
|
|
- }
|
|
|
- for (int i = 0; i < accessType.length; i++) {
|
|
|
- chargeTypeArray[i] = AccessTypeEnum.getName(Integer.parseInt(chargeType[i]));
|
|
|
- }
|
|
|
-
|
|
|
- product.setAccessTypeArray(accessTypeArray);
|
|
|
- product.setChargeTypeArray(chargeTypeArray);
|
|
|
+ product.setAccessTypeArray(product.getAccessType().split(",|,"));
|
|
|
+ product.setChargeTypeArray(product.getChargeType().split(",|,"));
|
|
|
}
|
|
|
return list;
|
|
|
}
|
|
@@ -162,10 +141,10 @@ public class LantoneProductFacade extends LantoneProductServiceImpl {
|
|
|
OpenedProductsIndex openedProductsIndex = new OpenedProductsIndex();
|
|
|
Long curren = oppendedProductVO.getCurrent();
|
|
|
Long size = oppendedProductVO.getSize();
|
|
|
- if (curren == null || curren == 0) {
|
|
|
+ if (curren == null || curren==0) {
|
|
|
oppendedProductVO.setCurrent(1L);
|
|
|
}
|
|
|
- if (size == null || curren == 0) {
|
|
|
+ if (size == null || curren==0) {
|
|
|
oppendedProductVO.setSize(10L);
|
|
|
}
|
|
|
BeanUtil.copyProperties(oppendedProductVO, openedProductsIndex);
|
|
@@ -185,7 +164,7 @@ public class LantoneProductFacade extends LantoneProductServiceImpl {
|
|
|
for (OpendProductWrapper bean : list) {
|
|
|
UserOrgDTO uo = dataMap.get(bean.getUserId());
|
|
|
if (uo != null) {
|
|
|
- BeanUtil.copyProperties(uo, bean);
|
|
|
+ BeanUtil.copyProperties(uo,bean);
|
|
|
}
|
|
|
}
|
|
|
return list;
|