|
@@ -11,6 +11,7 @@ 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;
|
|
@@ -112,9 +113,36 @@ public class LantoneProductFacade extends LantoneProductServiceImpl {
|
|
|
public List<LantoneProductWrapper> opendedProductByCurrentUser() {
|
|
|
Long userId = Long.parseLong(UserUtils.getCurrentPrincipleID());
|
|
|
List<LantoneProductWrapper> list = this.opendedProductByUserId(userId);
|
|
|
+ List<Long> userIdList = new ArrayList<>();
|
|
|
+ userIdList.add(userId);
|
|
|
+ RespDTO<Map<Long, UserOrgDTO>> mapRespDTO = userServiceClient.getUserAndOrg(userIdList);
|
|
|
+ if (mapRespDTO == null || !"0".equals(mapRespDTO.code)) {
|
|
|
+ throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
|
|
|
+ "获取用户机构信息失败");
|
|
|
+ }
|
|
|
for (LantoneProductWrapper product : list) {
|
|
|
- product.setAccessTypeArray(product.getAccessType().split(",|,"));
|
|
|
- product.setChargeTypeArray(product.getChargeType().split(",|,"));
|
|
|
+ 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 < chargeType.length; i++) {
|
|
|
+ chargeTypeArray[i] = AccessTypeEnum.getName(Integer.parseInt(chargeType[i]));
|
|
|
+ }
|
|
|
+
|
|
|
+ product.setAccessTypeArray(accessTypeArray);
|
|
|
+ product.setChargeTypeArray(chargeTypeArray);
|
|
|
+
|
|
|
+ String[] serviceIds = product.getServiceIds().split(",|,");
|
|
|
+ Long[] services = new Long[serviceIds.length];
|
|
|
+ for (int i = 0; i < serviceIds.length; i++) {
|
|
|
+ services[i] = Long.parseLong(serviceIds[i]);
|
|
|
+ }
|
|
|
+ product.setServices(services);
|
|
|
}
|
|
|
return list;
|
|
|
}
|