Commit f1b5b14f by 陶光胜

观云台小程序

parent 83c96bcd
......@@ -6,6 +6,9 @@ import com.alibaba.fastjson.JSONObject;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.cloud.dto.DataAuthDTO;
import com.gic.cloud.service.DataAuthApiService;
import com.gic.store.dto.StoreDTO;
import com.gic.store.dto.StoreSearchDTO;
import com.gic.store.service.StoreApiService;
import com.gic.store.service.StoreWidgetApiService;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
......@@ -15,6 +18,7 @@ import org.springframework.stereotype.Component;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
@Component
public class DataAuthUtils {
......@@ -24,6 +28,8 @@ public class DataAuthUtils {
private DataAuthApiService dataAuthApiService;
@Autowired
private StoreWidgetApiService storeWidgetApiService;
@Autowired
private StoreApiService storeApiService;
public StoreAuth getStoreAuth(Integer userId, Integer enterpriseId){
ServiceResponse<DataAuthDTO> response = this.dataAuthApiService.ggetDataAuthByUserId(enterpriseId, userId);
......@@ -37,7 +43,10 @@ public class DataAuthUtils {
storeAuth.setStoreInfoIdList(storeInfoIdList);
storeAuth.setStoreWidgetId(storeWidgetId);
}else {
storeAuth.setStoreInfoIdList(new ArrayList<>());
StoreSearchDTO storeSearchDTO = new StoreSearchDTO();
storeSearchDTO.setEnterpriseId(enterpriseId);
List<StoreDTO> result = this.storeApiService.listStore(storeSearchDTO, 1, 20000).getResult().getResult();
storeAuth.setStoreInfoIdList(result.stream().map(storeDTO -> storeDTO.getStoreInfoId()).collect(Collectors.toList()));
}
}
return storeAuth;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment